17 return vfloat8(_mm256_setzero_ps());
31 return vfloat8(_mm256_add_ps(a.m256,
b.m256));
34 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);
51 __m256
mask = _mm256_castsi256_ps(_mm256_set1_epi32(0x80000000));
52 return vfloat8(_mm256_xor_ps(a.m256,
mask));
54 return make_vfloat8(-a.a, -a.b, -a.c, -a.d, -a.e, -a.f, -a.g, -a.h);
61 return vfloat8(_mm256_sub_ps(a.m256,
b.m256));
64 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);
81 return vfloat8(_mm256_mul_ps(a.m256,
b.m256));
84 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);
101 return vfloat8(_mm256_div_ps(a.m256,
b.m256));
104 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);
146 return (_mm256_movemask_ps(_mm256_castsi256_ps(
147 _mm256_cmpeq_epi32(_mm256_castps_si256(a.m256), _mm256_castps_si256(
b.m256)))) &
148 0b11111111) == 0b11111111;
150 return (a.a ==
b.a && a.b ==
b.b && a.c ==
b.c && a.d ==
b.d && a.e ==
b.e && a.f ==
b.f &&
151 a.g ==
b.g && a.h ==
b.h);
158 return vfloat8(_mm256_xor_ps(a.m256,
b.m256));
174 return vfloat8(_mm256_sqrt_ps(a.m256));
200 vfloat8
b(_mm256_hadd_ps(a.m256, a.m256));
201 vfloat8 h(_mm256_hadd_ps(
b.m256,
b.m256));
204 return a.a + a.b + a.c + a.d + a.e + a.f + a.g + a.h;
216 return vfloat8(_mm256_min_ps(a.m256,
b.m256));
232 return vfloat8(_mm256_max_ps(a.m256,
b.m256));
247 return min(
max(a, mn), mx);
253 return vfloat8(_mm256_blendv_ps(
b, a, _mm256_castsi256_ps(
mask)));
256 (
mask.b) ? a.b :
b.b,
257 (
mask.c) ? a.c :
b.c,
258 (
mask.d) ? a.d :
b.d,
259 (
mask.e) ? a.e :
b.e,
260 (
mask.f) ? a.f :
b.f,
261 (
mask.g) ? a.g :
b.g,
262 (
mask.h) ? a.h :
b.h);
269 return vfloat8(_mm256_and_ps(a.m256, _mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff))));
284 return a + t * (
b - a);
289 return a + t * (
b - a);
312 vfloat8 t(_mm256_dp_ps(a.m256,
b.m256, 0xFF));
315 return (a.a *
b.a) + (a.b *
b.b) + (a.c *
b.c) + (a.d *
b.d) + (a.e *
b.e) + (a.f *
b.f) +
316 (a.g *
b.g) + (a.h *
b.h);
355 (
b.b != 0.0f) ? a.b /
b.b : 0.0f,
356 (
b.c != 0.0f) ? a.c /
b.c : 0.0f,
357 (
b.d != 0.0f) ? a.d /
b.d : 0.0f,
358 (
b.e != 0.0f) ? a.e /
b.e : 0.0f,
359 (
b.f != 0.0f) ? a.f /
b.f : 0.0f,
360 (
b.g != 0.0f) ? a.g /
b.g : 0.0f,
361 (
b.h != 0.0f) ? a.h /
b.h : 0.0f);
387 return vint8(_mm256_castps_si256(a));
403# ifdef __KERNEL_AVX__
404 return float4(_mm256_extractf128_ps(a.m256, 0));
411# ifdef __KERNEL_AVX__
412 return float4(_mm256_extractf128_ps(a.m256, 1));
428# ifdef __KERNEL_AVX__
429 return vfloat8(_mm256_permutevar_ps(a, _mm256_set_epi32(i7, i6, i5, i4, i3, i2, i1, i0)));
431 return make_vfloat8(a[i0], a[i1], a[i2], a[i3], a[i4 + 4], a[i5 + 4], a[i6 + 4], a[i7 + 4]);
435template<
size_t i0, const
size_t i1, const
size_t i2, const
size_t i3>
438# ifdef __KERNEL_AVX__
439 return vfloat8(_mm256_shuffle_ps(a,
b, _MM_SHUFFLE(i3, i2, i1, i0)));
441 return make_vfloat8(shuffle<i0, i1, i2, i3>(high(a), high(
b)),
442 shuffle<i0, i1, i2, i3>(low(a), low(
b)));
446template<
size_t i0, const
size_t i1, const
size_t i2, const
size_t i3>
449 return shuffle<i0, i1, i2, i3>(a, a);
453 return shuffle<i0, i0, i0, i0>(a,
b);
457 return shuffle<i0>(a, a);
462# ifdef __KERNEL_AVX__
463 __m256
b = shuffle<i, i, i, i>(a).m256;
464 return _mm256_cvtss_f32(
b);
__forceinline float extract(const int4 &b)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
VecBase< float, 4 > float4
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
ccl_device_inline vfloat8 safe_divide(const vfloat8 a, const float b)
ccl_device_inline vfloat8 one_vfloat8()
ccl_device_inline vfloat8 operator*(const vfloat8 a, const vfloat8 b)
ccl_device_inline bool operator==(const vfloat8 a, const vfloat8 b)
ccl_device_inline vfloat8 operator/=(vfloat8 a, const float f)
ccl_device_inline vfloat8 fabs(const vfloat8 a)
ccl_device_inline vfloat8 ensure_finite(vfloat8 v)
ccl_device_inline float average(const vfloat8 a)
ccl_device_inline vfloat8 operator+=(vfloat8 a, const vfloat8 b)
ccl_device_inline vfloat8 operator^(const vfloat8 a, const vfloat8 b)
ccl_device_inline vfloat8 operator-(const vfloat8 a)
ccl_device_inline vfloat8 operator/(const vfloat8 a, const vfloat8 b)
ccl_device_inline vfloat8 operator-=(vfloat8 a, const vfloat8 b)
ccl_device_inline bool isequal(const vfloat8 a, const vfloat8 b)
ccl_device_inline float reduce_add(const vfloat8 a)
ccl_device_inline bool is_zero(const vfloat8 a)
ccl_device_inline float dot(const vfloat8 a, const vfloat8 b)
CCL_NAMESPACE_BEGIN ccl_device_inline vfloat8 zero_vfloat8()
ccl_device_inline bool isfinite_safe(vfloat8 v)
ccl_device_inline vfloat8 operator*=(vfloat8 a, const vfloat8 b)
ccl_device_inline float reduce_min(const vfloat8 a)
ccl_device_inline vfloat8 clamp(const vfloat8 a, const vfloat8 mn, const vfloat8 mx)
ccl_device_inline vfloat8 operator+(const vfloat8 a, const vfloat8 b)
ccl_device_inline float reduce_max(const vfloat8 a)
ccl_device_inline vfloat8 make_vfloat8(const float f)
ccl_device_inline vint8 make_vint8(const vfloat8 f)