Skip to content

Commit 5e971d6

Browse files
[neon] Implement bitwise_rshift for 64 bit integers on arm32
1 parent c3a8d37 commit 5e971d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,18 @@ namespace xsimd
26532653
return vshlq_s32(lhs, vnegq_s32(rhs));
26542654
}
26552655

2656+
template <class A, class T, detail::enable_sized_unsigned_t<T, 8> = 0>
2657+
XSIMD_INLINE batch<T, A> bitwise_rshift(batch<T, A> const& lhs, batch<as_signed_integer_t<T>, A> const& rhs, requires_arch<neon>) noexcept
2658+
{
2659+
return vshlq_u64(lhs, neg(rhs, neon {}).data);
2660+
}
2661+
2662+
template <class A, class T, detail::enable_sized_signed_t<T, 8> = 0>
2663+
XSIMD_INLINE batch<T, A> bitwise_rshift(batch<T, A> const& lhs, batch<T, A> const& rhs, requires_arch<neon>) noexcept
2664+
{
2665+
return vshlq_s64(lhs, neg(rhs, neon {}).data);
2666+
}
2667+
26562668
// immediate variant
26572669
template <size_t shift, class A, class T, detail::enable_sized_unsigned_t<T, 1> = 0>
26582670
XSIMD_INLINE batch<T, A> bitwise_rshift(batch<T, A> const& x, requires_arch<neon>) noexcept

0 commit comments

Comments
 (0)