Skip to content

Commit

Permalink
arm-support
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed Feb 26, 2024
1 parent 2bbeb9c commit 8820501
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/xsimd/arch/xsimd_neon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,24 @@ namespace xsimd
return dispatcher.apply(register_type(lhs), register_type(rhs));
}

/*******
* avg *
*******/

WRAP_BINARY_INT_EXCLUDING_64(vrhaddq, detail::identity_return_type)

template <class A, class T, detail::exclude_int64_neon_t<T> = 0>
inline batch<T, A> avg(batch<T, A> const& lhs, batch<T, A> const& rhs, requires_arch<neon>) noexcept
{
using register_type = typename batch<T, A>::register_type;
const detail::neon_dispatcher::binary dispatcher = {
std::make_tuple(wrap::vrhaddq_u8, wrap::vrhaddq_s8, wrap::vrhaddq_u16, wrap::vrhaddq_s16,
wrap::vrhaddq_u32, wrap::vrhaddq_s32)
};
return dispatcher.apply(register_type(lhs), register_type(rhs));
}


/********
* sadd *
********/
Expand Down

0 comments on commit 8820501

Please sign in to comment.