17 #ifndef __UTIL_MATH_INT4_H__
18 #define __UTIL_MATH_INT4_H__
20 #ifndef __UTIL_MATH_H__
21 # error "Do not include this file directly, include util_types.h instead."
30 #ifndef __KERNEL_GPU__
48 #ifndef __KERNEL_GPU__
51 # ifdef __KERNEL_SSE__
52 return int4(_mm_add_epi32(
a.m128, b.m128));
65 # ifdef __KERNEL_SSE__
66 return int4(_mm_srai_epi32(
a.m128, i));
74 # ifdef __KERNEL_SSE__
75 return int4(_mm_slli_epi32(
a.m128, i));
83 # ifdef __KERNEL_SSE__
84 return int4(_mm_cmplt_epi32(
a.m128, b.m128));
92 # ifdef __KERNEL_SSE__
93 return int4(_mm_xor_si128(_mm_set1_epi32(0xffffffff), _mm_cmplt_epi32(
a.m128, b.m128)));
101 # ifdef __KERNEL_SSE__
102 return int4(_mm_and_si128(
a.m128, b.m128));
110 # if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__)
111 return int4(_mm_min_epi32(
a.m128, b.m128));
119 # if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE41__)
120 return int4(_mm_max_epi32(
a.m128, b.m128));
133 # ifdef __KERNEL_SSE__
134 const __m128 m = _mm_cvtepi32_ps(
mask);
136 return int4(_mm_castps_si128(
137 _mm_or_ps(_mm_and_ps(m, _mm_castsi128_ps(
a)), _mm_andnot_ps(m, _mm_castsi128_ps(b)))));
146 # ifdef __KERNEL_SSE__
147 return int4(_mm_loadu_si128((__m128i *)
v));
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define ccl_device_inline
#define CCL_NAMESPACE_END
#define make_int4(x, y, z, w)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
ccl_device_inline int4 load_int4(const int *v)
ccl_device_inline int4 operator>>(const int4 &a, int i)
ccl_device_inline int4 operator<<(const int4 &a, int i)
ccl_device_inline int4 operator<(const int4 &a, const int4 &b)
ccl_device_inline int4 operator&(const int4 &a, const int4 &b)
ccl_device_inline int4 clamp(const int4 &a, const int4 &mn, const int4 &mx)
ccl_device_inline int4 min(int4 a, int4 b)
ccl_device_inline int4 max(int4 a, int4 b)
CCL_NAMESPACE_BEGIN ccl_device_inline int4 operator+(const int4 &a, const int4 &b)
ccl_device_inline int4 operator>=(const int4 &a, const int4 &b)
ccl_device_inline int4 select(const int4 &mask, const int4 &a, const int4 &b)
ccl_device_inline int4 operator+=(int4 &a, const int4 &b)