18 return vint8(_mm256_add_epi32(a.m256,
b.m256));
21 a.a +
b.a, a.b +
b.b, a.c +
b.c, a.d +
b.d, a.e +
b.e, a.f +
b.f, a.g +
b.g, a.h +
b.h);
33 return vint8(_mm256_sub_epi32(a.m256,
b.m256));
36 a.a -
b.a, a.b -
b.b, a.c -
b.c, a.d -
b.d, a.e -
b.e, a.f -
b.f, a.g -
b.g, a.h -
b.h);
48 return vint8(_mm256_srai_epi32(a.m256,
i));
51 a.a >>
i, a.b >>
i, a.c >>
i, a.d >>
i, a.e >>
i, a.f >>
i, a.g >>
i, a.h >>
i);
58 return vint8(_mm256_slli_epi32(a.m256,
i));
61 a.a <<
i, a.b <<
i, a.c <<
i, a.d <<
i, a.e <<
i, a.f <<
i, a.g <<
i, a.h <<
i);
68 return vint8(_mm256_cmpgt_epi32(
b.m256, a.m256));
71 a.a <
b.a, a.b <
b.b, a.c <
b.c, a.d <
b.d, a.e <
b.e, a.f <
b.f, a.g <
b.g, a.h <
b.h);
83 return vint8(_mm256_cmpeq_epi32(a.m256,
b.m256));
103# ifdef __KERNEL_AVX__
105 _mm256_xor_si256(_mm256_set1_epi32(0xffffffff), _mm256_cmpgt_epi32(
b.m256, a.m256)));
125# ifdef __KERNEL_AVX__
126 return vint8(_mm256_and_si256(a.m256,
b.m256));
129 a.a &
b.a, a.b &
b.b, a.c &
b.c, a.d &
b.d, a.e &
b.e, a.f &
b.f, a.g &
b.g, a.h &
b.h);
135# ifdef __KERNEL_AVX__
136 return vint8(_mm256_or_si256(a.m256,
b.m256));
139 a.a |
b.a, a.b |
b.b, a.c |
b.c, a.d |
b.d, a.e |
b.e, a.f |
b.f, a.g |
b.g, a.h |
b.h);
145# ifdef __KERNEL_AVX__
146 return vint8(_mm256_xor_si256(a.m256,
b.m256));
149 a.a ^
b.a, a.b ^
b.b, a.c ^
b.c, a.d ^
b.d, a.e ^
b.e, a.f ^
b.f, a.g ^
b.g, a.h ^
b.h);
219# ifdef __KERNEL_AVX__
222 return vint8(_mm256_srli_epi32(a.m256,
b));
228# if defined(__KERNEL_AVX__) && defined(__KERNEL_AVX41__)
229 return vint8(_mm256_min_epi32(a.m256,
b.m256));
244# if defined(__KERNEL_AVX__) && defined(__KERNEL_AVX41__)
245 return vint8(_mm256_max_epi32(a.m256,
b.m256));
260 return min(
max(a, mn), mx);
265# ifdef __KERNEL_AVX__
266 return vint8(_mm256_castps_si256(_mm256_blendv_ps(
267 _mm256_castsi256_ps(
b), _mm256_castsi256_ps(a), _mm256_castsi256_ps(
mask))));
270 (
mask.b) ? a.b :
b.b,
271 (
mask.c) ? a.c :
b.c,
272 (
mask.d) ? a.d :
b.d,
273 (
mask.e) ? a.e :
b.e,
274 (
mask.f) ? a.f :
b.f,
275 (
mask.g) ? a.g :
b.g,
276 (
mask.h) ? a.h :
b.h);
282# ifdef __KERNEL_AVX__
283 return vint8(_mm256_loadu_si256((__m256i *)
v));
293 return vfloat8(_mm256_castsi256_ps(a));
310 _mm256_castps_si256(_mm256_permute_ps(_mm256_castsi256_ps(a), _MM_SHUFFLE(
i,
i,
i,
i))));
315 return vint8(_mm256_permute2f128_si256(a, a, (i1 << 4) | (i0 << 0)));
318template<
size_t i0, const
size_t i1>
321 return vint8(_mm256_permute2f128_si256(a,
b, (i1 << 4) | (i0 << 0)));
324template<
size_t i0, const
size_t i1, const
size_t i2, const
size_t i3>
328 _mm256_castps_si256(_mm256_permute_ps(_mm256_castsi256_ps(a), _MM_SHUFFLE(i3, i2, i1, i0))));
331template<
size_t i0, const
size_t i1, const
size_t i2, const
size_t i3>
334 return vint8(_mm256_castps_si256(_mm256_shuffle_ps(
335 _mm256_castsi256_ps(a), _mm256_castsi256_ps(
b), _MM_SHUFFLE(i3, i2, i1, i0))));
338template<>
__forceinline const vint8 shuffle<0, 0, 2, 2>(
const vint8
b)
340 return vint8(_mm256_castps_si256(_mm256_moveldup_ps(_mm256_castsi256_ps(
b))));
342template<>
__forceinline const vint8 shuffle<1, 1, 3, 3>(
const vint8
b)
344 return vint8(_mm256_castps_si256(_mm256_movehdup_ps(_mm256_castsi256_ps(
b))));
346template<>
__forceinline const vint8 shuffle<0, 1, 0, 1>(
const vint8
b)
348 return vint8(_mm256_castps_si256(
349 _mm256_castpd_ps(_mm256_movedup_pd(_mm256_castps_pd(_mm256_castsi256_ps(
b))))));
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
ccl_device_inline vint8 operator==(const vint8 a, const vint8 b)
ccl_device_inline vint8 & operator&=(vint8 &a, const vint8 b)
ccl_device_inline vint8 operator-(const vint8 a, const vint8 b)
ccl_device_inline vint8 operator^(const vint8 a, const vint8 b)
ccl_device_inline vint8 clamp(const vint8 a, const vint8 mn, const vint8 mx)
ccl_device_inline vint8 operator>=(const vint8 a, const vint8 b)
ccl_device_inline vint8 operator-=(vint8 &a, const vint8 b)
ccl_device_inline vint8 load_vint8(const int *v)
ccl_device_inline vint8 operator|(const vint8 a, const vint8 b)
ccl_device_inline vint8 operator&(const vint8 a, const vint8 b)
ccl_device_inline vint8 & operator>>=(vint8 &a, const int32_t b)
ccl_device_inline vint8 operator<(const vint8 a, const vint8 b)
ccl_device_inline vint8 & operator^=(vint8 &a, const vint8 b)
CCL_NAMESPACE_BEGIN ccl_device_inline vint8 operator+(const vint8 a, const vint8 b)
ccl_device_inline vint8 operator<<(const vint8 a, const int i)
ccl_device_inline vint8 & operator<<=(vint8 &a, const int32_t b)
ccl_device_inline vint8 operator>>(const vint8 a, const int i)
ccl_device_inline vint8 operator+=(vint8 &a, const vint8 b)
ccl_device_inline vint8 & operator|=(vint8 &a, const vint8 b)
ccl_device_inline vfloat8 make_vfloat8(const float f)
ccl_device_inline vint8 make_vint8(const vfloat8 f)