#if !defined(HWY_NAMESPACE)
#include "hwy/ops/shared-inl.h"
HWY_BEFORE_NAMESPACE();
namespace hwy {
namespace HWY_NAMESPACE {
#define HWY_INSIDE_END_NAMESPACE
template <class D>
using VFromD = int;
template <class D>
using TFromV = int;
template <class D>
struct DFromV {};
#endif
#if HWY_IDE || (!HWY_HAVE_SCALABLE && !HWY_TARGET_IS_SVE)
template <class D>
struct Vec2 { … };
template <class D>
struct Vec3 { … };
template <class D>
struct Vec4 { … };
template <class D>
HWY_API Vec2<D> Create2(D , VFromD<D> v0, VFromD<D> v1) { … }
template <class D>
HWY_API Vec3<D> Create3(D , VFromD<D> v0, VFromD<D> v1, VFromD<D> v2) { … }
template <class D>
HWY_API Vec4<D> Create4(D , VFromD<D> v0, VFromD<D> v1, VFromD<D> v2,
VFromD<D> v3) { … }
template <size_t kIndex, class D>
HWY_API VFromD<D> Get2(Vec2<D> tuple) { … }
template <size_t kIndex, class D>
HWY_API VFromD<D> Get3(Vec3<D> tuple) { … }
template <size_t kIndex, class D>
HWY_API VFromD<D> Get4(Vec4<D> tuple) { … }
template <size_t kIndex, class D>
HWY_API Vec2<D> Set2(Vec2<D> tuple, VFromD<D> val) { … }
template <size_t kIndex, class D>
HWY_API Vec3<D> Set3(Vec3<D> tuple, VFromD<D> val) { … }
template <size_t kIndex, class D>
HWY_API Vec4<D> Set4(Vec4<D> tuple, VFromD<D> val) { … }
#endif
#if (defined(HWY_NATIVE_ROL_ROR_8) == defined(HWY_TARGET_TOGGLE))
#ifdef HWY_NATIVE_ROL_ROR_8
#undef HWY_NATIVE_ROL_ROR_8
#else
#define HWY_NATIVE_ROL_ROR_8
#endif
template <class V, HWY_IF_UI8(TFromV<V>)>
HWY_API V Rol(V a, V b) { … }
template <class V, HWY_IF_UI8(TFromV<V>)>
HWY_API V Ror(V a, V b) { … }
#endif
#if (defined(HWY_NATIVE_ROL_ROR_16) == defined(HWY_TARGET_TOGGLE))
#ifdef HWY_NATIVE_ROL_ROR_16
#undef HWY_NATIVE_ROL_ROR_16
#else
#define HWY_NATIVE_ROL_ROR_16
#endif
template <class V, HWY_IF_UI16(TFromV<V>)>
HWY_API V Rol(V a, V b) { … }
template <class V, HWY_IF_UI16(TFromV<V>)>
HWY_API V Ror(V a, V b) { … }
#endif
#if (defined(HWY_NATIVE_ROL_ROR_32_64) == defined(HWY_TARGET_TOGGLE))
#ifdef HWY_NATIVE_ROL_ROR_32_64
#undef HWY_NATIVE_ROL_ROR_32_64
#else
#define HWY_NATIVE_ROL_ROR_32_64
#endif
template <class V, HWY_IF_UI32(TFromV<V>)>
HWY_API V Rol(V a, V b) { … }
template <class V, HWY_IF_UI32(TFromV<V>)>
HWY_API V Ror(V a, V b) { … }
#if HWY_HAVE_INTEGER64
template <class V, HWY_IF_UI64(TFromV<V>)>
HWY_API V Rol(V a, V b) { … }
template <class V, HWY_IF_UI64(TFromV<V>)>
HWY_API V Ror(V a, V b) { … }
#endif
#endif
#if (defined(HWY_NATIVE_ROL_ROR_SAME_8) == defined(HWY_TARGET_TOGGLE))
#ifdef HWY_NATIVE_ROL_ROR_SAME_8
#undef HWY_NATIVE_ROL_ROR_SAME_8
#else
#define HWY_NATIVE_ROL_ROR_SAME_8
#endif
template <class V, HWY_IF_UI8(TFromV<V>)>
HWY_API V RotateLeftSame(V v, int bits) { … }
template <class V, HWY_IF_UI8(TFromV<V>)>
HWY_API V RotateRightSame(V v, int bits) { … }
#endif
#if (defined(HWY_NATIVE_ROL_ROR_SAME_16) == defined(HWY_TARGET_TOGGLE))
#ifdef HWY_NATIVE_ROL_ROR_SAME_16
#undef HWY_NATIVE_ROL_ROR_SAME_16
#else
#define HWY_NATIVE_ROL_ROR_SAME_16
#endif
template <class V, HWY_IF_UI16(TFromV<V>)>
HWY_API V RotateLeftSame(V v, int bits) { … }
template <class V, HWY_IF_UI16(TFromV<V>)>
HWY_API V RotateRightSame(V v, int bits) { … }
#endif
#if (defined(HWY_NATIVE_ROL_ROR_SAME_32_64) == defined(HWY_TARGET_TOGGLE))
#ifdef HWY_NATIVE_ROL_ROR_SAME_32_64
#undef HWY_NATIVE_ROL_ROR_SAME_32_64
#else
#define HWY_NATIVE_ROL_ROR_SAME_32_64
#endif
template <class V, HWY_IF_UI32(TFromV<V>)>
HWY_API V RotateLeftSame(V v, int bits) { … }
template <class V, HWY_IF_UI32(TFromV<V>)>
HWY_API V RotateRightSame(V v, int bits) { … }
#if HWY_HAVE_INTEGER64
template <class V, HWY_IF_UI64(TFromV<V>)>
HWY_API V RotateLeftSame(V v, int bits) { … }
template <class V, HWY_IF_UI64(TFromV<V>)>
HWY_API V RotateRightSame(V v, int bits) { … }
#endif
#endif
#if HWY_TARGET != HWY_SCALAR || HWY_IDE
namespace detail {
template <size_t kToLaneSize, class D, class V>
HWY_INLINE VFromD<D> PromoteEvenTo(
hwy::SignedTag ,
hwy::SizeTag<kToLaneSize> ,
hwy::SignedTag , D d_to, V v) { … }
template <size_t kToLaneSize, class D, class V>
HWY_INLINE VFromD<D> PromoteEvenTo(
hwy::UnsignedTag ,
hwy::SizeTag<kToLaneSize> ,
hwy::UnsignedTag , D d_to, V v) { … }
template <size_t kToLaneSize, class D, class V>
HWY_INLINE VFromD<D> PromoteOddTo(
hwy::SignedTag ,
hwy::SizeTag<kToLaneSize> ,
hwy::SignedTag , D d_to, V v) { … }
template <size_t kToLaneSize, class D, class V>
HWY_INLINE VFromD<D> PromoteOddTo(
hwy::UnsignedTag ,
hwy::SizeTag<kToLaneSize> ,
hwy::UnsignedTag , D d_to, V v) { … }
template <size_t kToLaneSize, class D, class V>
HWY_INLINE VFromD<D> PromoteEvenTo(
hwy::SignedTag ,
hwy::SizeTag<kToLaneSize> ,
hwy::UnsignedTag , D d_to, V v) { … }
template <size_t kToLaneSize, class D, class V>
HWY_INLINE VFromD<D> PromoteOddTo(
hwy::SignedTag ,
hwy::SizeTag<kToLaneSize> ,
hwy::UnsignedTag , D d_to, V v) { … }
template <class FromTypeTag, class DF32, class VBF16,
class VBF16_2 = VFromD<Repartition<bfloat16_t, DF32>>,
hwy::EnableIf<IsSame<TFromV<VBF16>, TFromV<VBF16_2>>()>* = nullptr>
HWY_INLINE VFromD<DF32> PromoteEvenTo(hwy::FloatTag ,
hwy::SizeTag<4> ,
FromTypeTag , DF32 d_to,
VBF16 v) { … }
template <class FromTypeTag, class DF32, class VBF16,
class VBF16_2 = VFromD<Repartition<bfloat16_t, DF32>>,
hwy::EnableIf<IsSame<TFromV<VBF16>, TFromV<VBF16_2>>()>* = nullptr>
HWY_INLINE VFromD<DF32> PromoteOddTo(hwy::FloatTag ,
hwy::SizeTag<4> ,
FromTypeTag , DF32 d_to,
VBF16 v) { … }
template <class ToTypeTag, size_t kToLaneSize, class FromTypeTag, class D,
class V, HWY_IF_LANES_D(D, 1)>
HWY_INLINE VFromD<D> PromoteEvenTo(
ToTypeTag , hwy::SizeTag<kToLaneSize> ,
FromTypeTag , D d_to, V v) { … }
template <class ToTypeTag, size_t kToLaneSize, class FromTypeTag, class D,
class V, HWY_IF_LANES_GT_D(D, 1)>
HWY_INLINE VFromD<D> PromoteEvenTo(
ToTypeTag , hwy::SizeTag<kToLaneSize> ,
FromTypeTag , D d_to, V v) { … }
template <class ToTypeTag, size_t kToLaneSize, class FromTypeTag, class D,
class V>
HWY_INLINE VFromD<D> PromoteOddTo(
ToTypeTag , hwy::SizeTag<kToLaneSize> ,
FromTypeTag , D d_to, V v) { … }
}
template <class D, class V, HWY_IF_T_SIZE_D(D, 2 * sizeof(TFromV<V>)),
class V2 = VFromD<Repartition<TFromV<V>, D>>,
HWY_IF_LANES_D(DFromV<V>, HWY_MAX_LANES_V(V2))>
HWY_API VFromD<D> PromoteEvenTo(D d, V v) { … }
template <class D, class V, HWY_IF_T_SIZE_D(D, 2 * sizeof(TFromV<V>)),
class V2 = VFromD<Repartition<TFromV<V>, D>>,
HWY_IF_LANES_D(DFromV<V>, HWY_MAX_LANES_V(V2))>
HWY_API VFromD<D> PromoteOddTo(D d, V v) { … }
#endif
#ifdef HWY_INSIDE_END_NAMESPACE
#undef HWY_INSIDE_END_NAMESPACE
}
}
HWY_AFTER_NAMESPACE();
#endif