Blender  V3.3
math_float4.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef __UTIL_MATH_FLOAT4_H__
5 #define __UTIL_MATH_FLOAT4_H__
6 
7 #ifndef __UTIL_MATH_H__
8 # error "Do not include this file directly, include util/types.h instead."
9 #endif
10 
12 
13 /*******************************************************************************
14  * Declaration.
15  */
16 
17 #if !defined(__KERNEL_METAL__)
20 ccl_device_inline float4 operator*(const float4 &a, float f);
21 ccl_device_inline float4 operator*(float f, const float4 &a);
22 ccl_device_inline float4 operator/(const float4 &a, float f);
24 ccl_device_inline float4 operator+(const float4 &a, const float f);
26 ccl_device_inline float4 operator-(const float4 &a, const float f);
32 
36 ccl_device_inline bool operator==(const float4 &a, const float4 &b);
37 
38 ccl_device_inline float distance(const float4 &a, const float4 &b);
39 ccl_device_inline float dot(const float4 &a, const float4 &b);
44 ccl_device_inline float4 cross(const float4 &a, const float4 &b);
45 ccl_device_inline bool is_zero(const float4 &a);
46 ccl_device_inline float average(const float4 &a);
47 ccl_device_inline float len(const float4 &a);
50 ccl_device_inline float4 min(const float4 &a, const float4 &b);
51 ccl_device_inline float4 max(const float4 &a, const float4 &b);
52 ccl_device_inline float4 clamp(const float4 &a, const float4 &mn, const float4 &mx);
55 ccl_device_inline float4 mix(const float4 &a, const float4 &b, float t);
56 #endif /* !__KERNEL_METAL__*/
57 
59 ccl_device_inline float4 safe_divide(const float4 a, const float b);
60 
61 #ifdef __KERNEL_SSE__
62 template<size_t index_0, size_t index_1, size_t index_2, size_t index_3>
63 __forceinline const float4 shuffle(const float4 &b);
64 template<size_t index_0, size_t index_1, size_t index_2, size_t index_3>
65 __forceinline const float4 shuffle(const float4 &a, const float4 &b);
66 
67 template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &b);
68 
69 template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &a, const float4 &b);
70 template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4 &a, const float4 &b);
71 
72 # ifdef __KERNEL_SSE3__
73 template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4 &b);
74 template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4 &b);
75 # endif
76 #endif /* __KERNEL_SSE__ */
77 
81 
82 ccl_device_inline bool isequal(const float4 a, const float4 b);
83 
84 #ifndef __KERNEL_GPU__
85 ccl_device_inline float4 select(const int4 &mask, const float4 &a, const float4 &b);
86 #endif /* !__KERNEL_GPU__ */
87 
88 /*******************************************************************************
89  * Definition.
90  */
91 
93 {
94 #ifdef __KERNEL_SSE__
95  return float4(_mm_setzero_ps());
96 #else
97  return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
98 #endif
99 }
100 
102 {
103  return make_float4(1.0f, 1.0f, 1.0f, 1.0f);
104 }
105 
106 #if !defined(__KERNEL_METAL__)
108 {
109 # ifdef __KERNEL_SSE__
110  __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
111  return float4(_mm_xor_ps(a.m128, mask));
112 # else
113  return make_float4(-a.x, -a.y, -a.z, -a.w);
114 # endif
115 }
116 
118 {
119 # ifdef __KERNEL_SSE__
120  return float4(_mm_mul_ps(a.m128, b.m128));
121 # else
122  return make_float4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
123 # endif
124 }
125 
127 {
128 # if defined(__KERNEL_SSE__)
129  return a * make_float4(f);
130 # else
131  return make_float4(a.x * f, a.y * f, a.z * f, a.w * f);
132 # endif
133 }
134 
136 {
137  return a * f;
138 }
139 
141 {
142  return a * (1.0f / f);
143 }
144 
146 {
147 # ifdef __KERNEL_SSE__
148  return float4(_mm_div_ps(a.m128, b.m128));
149 # else
150  return make_float4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w);
151 # endif
152 }
153 
154 ccl_device_inline float4 operator+(const float4 &a, const float f)
155 {
156  return a + make_float4(f, f, f, f);
157 }
158 
160 {
161 # ifdef __KERNEL_SSE__
162  return float4(_mm_add_ps(a.m128, b.m128));
163 # else
164  return make_float4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
165 # endif
166 }
167 
168 ccl_device_inline float4 operator-(const float4 &a, const float f)
169 {
170  return a - make_float4(f, f, f, f);
171 }
172 
174 {
175 # ifdef __KERNEL_SSE__
176  return float4(_mm_sub_ps(a.m128, b.m128));
177 # else
178  return make_float4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
179 # endif
180 }
181 
183 {
184  return a = a + b;
185 }
186 
188 {
189  return a = a - b;
190 }
191 
193 {
194  return a = a * b;
195 }
196 
198 {
199  return a = a * f;
200 }
201 
203 {
204  return a = a / f;
205 }
206 
208 {
209 # ifdef __KERNEL_SSE__
210  return int4(_mm_castps_si128(_mm_cmplt_ps(a.m128, b.m128)));
211 # else
212  return make_int4(a.x < b.x, a.y < b.y, a.z < b.z, a.w < b.w);
213 # endif
214 }
215 
217 {
218 # ifdef __KERNEL_SSE__
219  return int4(_mm_castps_si128(_mm_cmpge_ps(a.m128, b.m128)));
220 # else
221  return make_int4(a.x >= b.x, a.y >= b.y, a.z >= b.z, a.w >= b.w);
222 # endif
223 }
224 
226 {
227 # ifdef __KERNEL_SSE__
228  return int4(_mm_castps_si128(_mm_cmple_ps(a.m128, b.m128)));
229 # else
230  return make_int4(a.x <= b.x, a.y <= b.y, a.z <= b.z, a.w <= b.w);
231 # endif
232 }
233 
235 {
236 # ifdef __KERNEL_SSE__
237  return (_mm_movemask_ps(_mm_cmpeq_ps(a.m128, b.m128)) & 15) == 15;
238 # else
239  return (a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w);
240 # endif
241 }
242 
243 ccl_device_inline float distance(const float4 &a, const float4 &b)
244 {
245  return len(a - b);
246 }
247 
248 ccl_device_inline float dot(const float4 &a, const float4 &b)
249 {
250 # if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
251 # if defined(__KERNEL_NEON__)
252  __m128 t = vmulq_f32(a, b);
253  return vaddvq_f32(t);
254 # else
255  return _mm_cvtss_f32(_mm_dp_ps(a, b, 0xFF));
256 # endif
257 # else
258  return (a.x * b.x + a.y * b.y) + (a.z * b.z + a.w * b.w);
259 # endif
260 }
261 
263 {
264  return dot(a, a);
265 }
266 
268 {
269 # ifdef __KERNEL_SSE__
270  /* Don't use _mm_rcp_ps due to poor precision. */
271  return float4(_mm_div_ps(_mm_set_ps1(1.0f), a.m128));
272 # else
273  return make_float4(1.0f / a.x, 1.0f / a.y, 1.0f / a.z, 1.0f / a.w);
274 # endif
275 }
276 
278 {
279 # ifdef __KERNEL_SSE__
280  return float4(_mm_sqrt_ps(a.m128));
281 # else
282  return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w));
283 # endif
284 }
285 
287 {
288  return a * a;
289 }
290 
292 {
293 # ifdef __KERNEL_SSE__
294  return (shuffle<1, 2, 0, 0>(a) * shuffle<2, 0, 1, 0>(b)) -
295  (shuffle<2, 0, 1, 0>(a) * shuffle<1, 2, 0, 0>(b));
296 # else
297  return make_float4(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x, 0.0f);
298 # endif
299 }
300 
302 {
303 # ifdef __KERNEL_SSE__
304  return a == zero_float4();
305 # else
306  return (a.x == 0.0f && a.y == 0.0f && a.z == 0.0f && a.w == 0.0f);
307 # endif
308 }
309 
311 {
312  return reduce_add(a) * 0.25f;
313 }
314 
316 {
317  return sqrtf(dot(a, a));
318 }
319 
321 {
322  return a / len(a);
323 }
324 
326 {
327  float t = len(a);
328  return (t != 0.0f) ? a / t : a;
329 }
330 
332 {
333 # ifdef __KERNEL_SSE__
334  return float4(_mm_min_ps(a.m128, b.m128));
335 # else
336  return make_float4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w));
337 # endif
338 }
339 
341 {
342 # ifdef __KERNEL_SSE__
343  return float4(_mm_max_ps(a.m128, b.m128));
344 # else
345  return make_float4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w));
346 # endif
347 }
348 
349 ccl_device_inline float4 clamp(const float4 &a, const float4 &mn, const float4 &mx)
350 {
351  return min(max(a, mn), mx);
352 }
353 
355 {
356 # if defined(__KERNEL_SSE__)
357 # if defined(__KERNEL_NEON__)
358  return float4(vabsq_f32(a));
359 # else
360  return float4(_mm_and_ps(a.m128, _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))));
361 # endif
362 # else
363  return make_float4(fabsf(a.x), fabsf(a.y), fabsf(a.z), fabsf(a.w));
364 # endif
365 }
366 
368 {
369 # ifdef __KERNEL_SSE__
370  return float4(_mm_floor_ps(a));
371 # else
372  return make_float4(floorf(a.x), floorf(a.y), floorf(a.z), floorf(a.w));
373 # endif
374 }
375 
376 ccl_device_inline float4 mix(const float4 &a, const float4 &b, float t)
377 {
378  return a + t * (b - a);
379 }
380 
382 {
383  return make_float4(saturatef(a.x), saturatef(a.y), saturatef(a.z), saturatef(a.w));
384 }
385 
387 {
388  return make_float4(expf(v.x), expf(v.y), expf(v.z), expf(v.z));
389 }
390 
392 {
393  return make_float4(logf(v.x), logf(v.y), logf(v.z), logf(v.z));
394 }
395 
396 #endif /* !__KERNEL_METAL__*/
397 
399 {
400 #if defined(__KERNEL_SSE__)
401 # if defined(__KERNEL_NEON__)
402  return vaddvq_f32(a);
403 # elif defined(__KERNEL_SSE3__)
404  float4 h(_mm_hadd_ps(a.m128, a.m128));
405  return _mm_cvtss_f32(_mm_hadd_ps(h.m128, h.m128));
406 # else
407  float4 h(shuffle<1, 0, 3, 2>(a) + a);
408  return _mm_cvtss_f32(shuffle<2, 3, 0, 1>(h) + h);
409 # endif
410 #else
411  return a.x + a.y + a.z + a.w;
412 #endif
413 }
414 
416 {
417 #if defined(__KERNEL_SSE__)
418 # if defined(__KERNEL_NEON__)
419  return vminvq_f32(a);
420 # else
421  float4 h = min(shuffle<1, 0, 3, 2>(a), a);
422  return _mm_cvtss_f32(min(shuffle<2, 3, 0, 1>(h), h));
423 # endif
424 #else
425  return min(min(a.x, a.y), min(a.z, a.w));
426 #endif
427 }
428 
430 {
431 #if defined(__KERNEL_SSE__)
432 # if defined(__KERNEL_NEON__)
433  return vmaxvq_f32(a);
434 # else
435  float4 h = max(shuffle<1, 0, 3, 2>(a), a);
436  return _mm_cvtss_f32(max(shuffle<2, 3, 0, 1>(h), h));
437 # endif
438 #else
439  return max(max(a.x, a.y), max(a.z, a.w));
440 #endif
441 }
442 
444 {
445 #if defined(__KERNEL_METAL__)
446  return all(a == b);
447 #else
448  return a == b;
449 #endif
450 }
451 
452 #ifdef __KERNEL_SSE__
453 template<size_t index_0, size_t index_1, size_t index_2, size_t index_3>
454 __forceinline const float4 shuffle(const float4 &b)
455 {
456 # if defined(__KERNEL_NEON__)
457  return float4(shuffle_neon<__m128, index_0, index_1, index_2, index_3>(b.m128));
458 # else
459  return float4(_mm_castsi128_ps(
460  _mm_shuffle_epi32(_mm_castps_si128(b), _MM_SHUFFLE(index_3, index_2, index_1, index_0))));
461 # endif
462 }
463 
464 template<size_t index_0, size_t index_1, size_t index_2, size_t index_3>
465 __forceinline const float4 shuffle(const float4 &a, const float4 &b)
466 {
467 # if defined(__KERNEL_NEON__)
468  return float4(shuffle_neon<__m128, index_0, index_1, index_2, index_3>(a.m128, b.m128));
469 # else
470  return float4(_mm_shuffle_ps(a.m128, b.m128, _MM_SHUFFLE(index_3, index_2, index_1, index_0)));
471 # endif
472 }
473 
474 template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &b)
475 {
476  return float4(_mm_castpd_ps(_mm_movedup_pd(_mm_castps_pd(b))));
477 }
478 
479 template<> __forceinline const float4 shuffle<0, 1, 0, 1>(const float4 &a, const float4 &b)
480 {
481  return float4(_mm_movelh_ps(a.m128, b.m128));
482 }
483 
484 template<> __forceinline const float4 shuffle<2, 3, 2, 3>(const float4 &a, const float4 &b)
485 {
486  return float4(_mm_movehl_ps(b.m128, a.m128));
487 }
488 
489 # ifdef __KERNEL_SSE3__
490 template<> __forceinline const float4 shuffle<0, 0, 2, 2>(const float4 &b)
491 {
492  return float4(_mm_moveldup_ps(b));
493 }
494 
495 template<> __forceinline const float4 shuffle<1, 1, 3, 3>(const float4 &b)
496 {
497  return float4(_mm_movehdup_ps(b));
498 }
499 # endif /* __KERNEL_SSE3__ */
500 #endif /* __KERNEL_SSE__ */
501 
502 #ifndef __KERNEL_GPU__
504 {
505 # ifdef __KERNEL_SSE__
506  return float4(_mm_blendv_ps(b.m128, a.m128, _mm_castsi128_ps(mask.m128)));
507 # else
508  return make_float4(
509  (mask.x) ? a.x : b.x, (mask.y) ? a.y : b.y, (mask.z) ? a.z : b.z, (mask.w) ? a.w : b.w);
510 # endif
511 }
512 
514 {
515  /* Replace elements of x with zero where mask isn't set. */
516  return select(mask, a, zero_float4());
517 }
518 
520 {
521 # ifdef __KERNEL_SSE__
522  return float4(_mm_loadu_ps(v));
523 # else
524  return make_float4(v[0], v[1], v[2], v[3]);
525 # endif
526 }
527 
528 #endif /* !__KERNEL_GPU__ */
529 
531 {
532  return (b != 0.0f) ? a / b : zero_float4();
533 }
534 
536 {
537  return make_float4((b.x != 0.0f) ? a.x / b.x : 0.0f,
538  (b.y != 0.0f) ? a.y / b.y : 0.0f,
539  (b.z != 0.0f) ? a.z / b.z : 0.0f,
540  (b.w != 0.0f) ? a.w / b.w : 0.0f);
541 }
542 
544 {
545  return isfinite_safe(v.x) && isfinite_safe(v.y) && isfinite_safe(v.z) && isfinite_safe(v.w);
546 }
547 
549 {
550  if (!isfinite_safe(v.x))
551  v.x = 0.0f;
552  if (!isfinite_safe(v.y))
553  v.y = 0.0f;
554  if (!isfinite_safe(v.z))
555  v.z = 0.0f;
556  if (!isfinite_safe(v.w))
557  v.w = 0.0f;
558  return v;
559 }
560 
562 {
563  return make_float4(powf(v.x, e), powf(v.y, e), powf(v.z, e), powf(v.z, e));
564 }
565 
567 
568 #endif /* __UTIL_MATH_FLOAT4_H__ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
float float4[4]
int int4[4]
__forceinline bool all(const avxb &b)
Definition: avxb.h:201
__forceinline const avxi shuffle< 0, 0, 2, 2 >(const avxi &b)
Definition: avxi.h:612
__forceinline const avxi shuffle< 0, 1, 0, 1 >(const avxi &b)
Definition: avxi.h:620
__forceinline const avxi shuffle< 1, 1, 3, 3 >(const avxi &b)
Definition: avxi.h:616
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define logf(x)
Definition: cuda/compat.h:105
#define expf(x)
Definition: cuda/compat.h:106
#define ccl_private
Definition: cuda/compat.h:48
#define ccl_device_inline
Definition: cuda/compat.h:34
#define powf(x, y)
Definition: cuda/compat.h:103
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
static void shuffle(float2 points[], int size, int rng_seed)
Definition: jitter.cpp:230
ccl_device_inline float len_squared(const float4 &a)
Definition: math_float4.h:262
ccl_device_inline float4 operator+=(float4 &a, const float4 &b)
Definition: math_float4.h:182
ccl_device_inline bool operator==(const float4 &a, const float4 &b)
Definition: math_float4.h:234
ccl_device_inline float4 safe_normalize(const float4 &a)
Definition: math_float4.h:325
ccl_device_inline float4 normalize(const float4 &a)
Definition: math_float4.h:320
ccl_device_inline float4 one_float4()
Definition: math_float4.h:101
ccl_device_inline float4 pow(float4 v, float e)
Definition: math_float4.h:561
ccl_device_inline float reduce_add(const float4 a)
Definition: math_float4.h:398
ccl_device_inline int4 operator<(const float4 &a, const float4 &b)
Definition: math_float4.h:207
ccl_device_inline float4 rcp(const float4 &a)
Definition: math_float4.h:267
ccl_device_inline float4 operator+(const float4 &a, const float f)
Definition: math_float4.h:154
CCL_NAMESPACE_BEGIN ccl_device_inline float4 operator-(const float4 &a)
Definition: math_float4.h:107
ccl_device_inline bool isfinite_safe(float4 v)
Definition: math_float4.h:543
ccl_device_inline float4 saturate(const float4 &a)
Definition: math_float4.h:381
ccl_device_inline int4 operator>=(const float4 &a, const float4 &b)
Definition: math_float4.h:216
ccl_device_inline int4 operator<=(const float4 &a, const float4 &b)
Definition: math_float4.h:225
ccl_device_inline float4 zero_float4()
Definition: math_float4.h:92
ccl_device_inline float distance(const float4 &a, const float4 &b)
Definition: math_float4.h:243
ccl_device_inline float4 floor(const float4 &a)
Definition: math_float4.h:367
ccl_device_inline float4 load_float4(ccl_private const float *v)
Definition: math_float4.h:519
ccl_device_inline float len(const float4 &a)
Definition: math_float4.h:315
ccl_device_inline float4 operator*(const float4 &a, const float4 &b)
Definition: math_float4.h:117
ccl_device_inline float4 sqrt(const float4 &a)
Definition: math_float4.h:277
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
ccl_device_inline float4 sqr(const float4 &a)
Definition: math_float4.h:286
ccl_device_inline float4 fabs(const float4 &a)
Definition: math_float4.h:354
ccl_device_inline float average(const float4 &a)
Definition: math_float4.h:310
ccl_device_inline bool isequal(const float4 a, const float4 b)
Definition: math_float4.h:443
ccl_device_inline float4 mix(const float4 &a, const float4 &b, float t)
Definition: math_float4.h:376
ccl_device_inline float4 safe_divide(const float4 a, const float4 b)
Definition: math_float4.h:535
ccl_device_inline float reduce_max(const float4 a)
Definition: math_float4.h:429
ccl_device_inline float4 ensure_finite(float4 v)
Definition: math_float4.h:548
ccl_device_inline float4 min(const float4 &a, const float4 &b)
Definition: math_float4.h:331
ccl_device_inline float4 exp(float4 v)
Definition: math_float4.h:386
ccl_device_inline float dot(const float4 &a, const float4 &b)
Definition: math_float4.h:248
ccl_device_inline bool is_zero(const float4 &a)
Definition: math_float4.h:301
ccl_device_inline float4 select(const int4 &mask, const float4 &a, const float4 &b)
Definition: math_float4.h:503
ccl_device_inline float4 operator*=(float4 &a, const float4 &b)
Definition: math_float4.h:192
ccl_device_inline float4 operator-=(float4 &a, const float4 &b)
Definition: math_float4.h:187
ccl_device_inline float4 cross(const float4 &a, const float4 &b)
Definition: math_float4.h:291
ccl_device_inline float reduce_min(const float4 a)
Definition: math_float4.h:415
ccl_device_inline float4 log(float4 v)
Definition: math_float4.h:391
ccl_device_inline float4 clamp(const float4 &a, const float4 &mn, const float4 &mx)
Definition: math_float4.h:349
ccl_device_inline float4 max(const float4 &a, const float4 &b)
Definition: math_float4.h:340
ccl_device_inline float4 operator/=(float4 &a, float f)
Definition: math_float4.h:202
ccl_device_inline float4 operator/(const float4 &a, float f)
Definition: math_float4.h:140
#define make_int4(x, y, z, w)
Definition: metal/compat.h:208
#define floorf(x)
Definition: metal/compat.h:224
#define make_float4(x, y, z, w)
Definition: metal/compat.h:205
#define fabsf(x)
Definition: metal/compat.h:219
#define sqrtf(x)
Definition: metal/compat.h:243
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
#define __forceinline
ccl_device_inline float saturatef(float a)
Definition: util/math.h:404