Skip to content

Commit 5451915

Browse files
WIP
1 parent b75c165 commit 5451915

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "../types/xsimd_neon_register.hpp"
2222
#include "../types/xsimd_utils.hpp"
23+
#include "./common/xsimd_common_cast.hpp"
2324

2425
// Wrap intrinsics so we can pass them as function pointers
2526
// - OP: intrinsics name prefix, e.g., vorrq
@@ -3211,6 +3212,19 @@ namespace xsimd
32113212
{
32123213
return vreinterpretq_f32_u32(swizzle(batch<uint32_t, A>(vreinterpretq_u32_f32(self)), mask, A {}));
32133214
}
3215+
3216+
/*********
3217+
* widen *
3218+
*********/
3219+
template <class A, class T, detail::enable_sized_signed_t<T, 1> = 0>
3220+
XSIMD_INLINE std::array<batch<widen_t<T>, A>, 2> widen(batch<T, A> const& x, requires_arch<neon>) noexcept {
3221+
return {batch<widen_t<T>, A>(vaddl_s8(vget_low_s8(x), vdup_n_s8(0))), batch<widen_t<T>, A>(vaddl_s8(vget_high_s8(x), vdup_n_s8(0)))};
3222+
}
3223+
template <class A, class T, detail::enable_sized_unsigned_t<T, 1> = 0>
3224+
XSIMD_INLINE std::array<batch<widen_t<T>, A>, 2> widen(batch<T, A> const& x, requires_arch<neon>) noexcept {
3225+
return {batch<widen_t<T>, A>(vaddl_u8(vget_low_u8(x), vdup_n_u8(0))), batch<widen_t<T>, A>(vaddl_u8(vget_high_u8(x), vdup_n_u8(0)))};
3226+
}
3227+
32143228
}
32153229

32163230
}

include/xsimd/arch/xsimd_neon64.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ namespace xsimd
15521552
* widen *
15531553
*********/
15541554
template <class A, class T>
1555-
XSIMD_INLINE std::array<batch<double, A>, 2> widen(batch<float, A> const& x, requires_arch<neon>) noexcept
1555+
XSIMD_INLINE std::array<batch<double, A>, 2> widen(batch<float, A> const& x, requires_arch<neon64>) noexcept
15561556
{
15571557
return { batch<double, A>(vcvt_f64_f32(vget_low_f32(x))), batch<double, A>(vcvt_high_f64_f32(x)) };
15581558
}

0 commit comments

Comments
 (0)