13#if !defined(__KERNEL_METAL__)
17 return int4(_mm_add_epi32(a.m128,
b.m128));
31 return int4(_mm_sub_epi32(a.m128,
b.m128));
50 return int4(_mm_srai_epi32(a.m128, i));
59 return int4(_mm_slli_epi32(a.m128, i));
68 return int4(_mm_cmplt_epi32(a.m128,
b.m128));
87 return int4(_mm_cmpeq_epi32(a.m128,
b.m128));
100# ifdef __KERNEL_SSE__
101 return int4(_mm_xor_si128(_mm_set1_epi32(0xffffffff), _mm_cmplt_epi32(a.m128,
b.m128)));
114# ifdef __KERNEL_SSE__
115 return int4(_mm_and_si128(a.m128,
b.m128));
123# ifdef __KERNEL_SSE__
124 return int4(_mm_or_si128(a.m128,
b.m128));
132# ifdef __KERNEL_SSE__
133 return int4(_mm_xor_si128(a.m128,
b.m128));
207# ifdef __KERNEL_SSE__
208 return int4(_mm_srli_epi32(a.m128, i));
210 return make_int4(uint32_t(a.
x) >> i, uint32_t(a.
y) >> i, uint32_t(a.
z) >> i, uint32_t(a.
w) >> i);
216# if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE42__)
217 return int4(_mm_min_epi32(a.m128,
b.m128));
225# if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE42__)
226 return int4(_mm_max_epi32(a.m128,
b.m128));
234 return min(
max(a, mn), mx);
239# ifdef __KERNEL_SSE__
240 return int4(_mm_or_si128(_mm_and_si128(
mask, a), _mm_andnot_si128(
mask,
b)));
249# ifdef __KERNEL_SSE__
250 return int4(_mm_loadu_si128((__m128i *)v));
252 return make_int4(v[0], v[1], v[2], v[3]);
260 return float4(_mm_castsi128_ps(a));
270 return int4(_mm_andnot_si128(a.m128,
b.m128));
273template<
size_t i0, const
size_t i1, const
size_t i2, const
size_t i3>
276# ifdef __KERNEL_NEON__
277 int32x4_t
result = shuffle_neon<int32x4_t, i0, i1, i2, i3>(vreinterpretq_s32_m128i(a));
278 return int4(vreinterpretq_m128i_s32(result));
280 return int4(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)));
284template<
size_t i0, const
size_t i1, const
size_t i2, const
size_t i3>
287# ifdef __KERNEL_NEON__
288 int32x4_t
result = shuffle_neon<int32x4_t, i0, i1, i2, i3>(vreinterpretq_s32_m128i(a),
289 vreinterpretq_s32_m128i(
b));
290 return int4(vreinterpretq_m128i_s32(result));
292 return int4(_mm_castps_si128(
293 _mm_shuffle_ps(_mm_castsi128_ps(a), _mm_castsi128_ps(
b), _MM_SHUFFLE(i3, i2, i1, i0))));
299 return shuffle<i0, i0, i0, i0>(
b);
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
std::ostream & operator<<(std::ostream &os, DeviceKernel kernel)
constexpr T clamp(T, U, U) RET
__forceinline LightTreeMeasure operator+(const LightTreeMeasure &a, const LightTreeMeasure &b)
ccl_device_inline Extrema< T > operator*(const Extrema< T > a, const T b)
ccl_device_inline Extrema< T > operator+=(ccl_private Extrema< T > &a, const ccl_private Extrema< T > &b)
ccl_device_inline dual< T1 > operator-(const dual< T1 > a, T2 b)
ccl_device_inline bool operator<(const ccl_private dual1 &a, const float b)
ccl_device_inline bool operator==(const float2 a, const float2 b)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
ccl_device_inline int2 operator>=(const float2 a, const float2 b)
ccl_device_inline int3 operator>(const float3 a, const float3 b)
ccl_device_inline float3 operator-=(float3 &a, const float3 b)
ccl_device_inline int4 cast(const float4 a)
ccl_device_inline float4 operator^(const float4 a, const float4 b)
ccl_device_inline int2 operator&(const int2 a, const int2 b)
ccl_device_inline int2 operator>>(const int2 a, const int i)
ccl_device_inline int4 load_int4(const int *v)
ccl_device_inline int4 & operator|=(int4 &a, const int4 b)
ccl_device_inline int4 & operator&=(int4 &a, const int4 b)
ccl_device_inline int4 operator|(const int4 a, const int4 b)
ccl_device_inline int4 & operator>>=(int4 &a, const int32_t b)
ccl_device_inline int4 & operator<<=(int4 &a, const int32_t b)
ccl_device_inline int4 srl(const int4 a, const int i)
ccl_device_inline int4 & operator^=(int4 &a, const int4 b)