HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VM_AVX.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: VM_AVX.C ( VM Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __VM_AVX__
12 #define __VM_AVX__
13 
14 #include <SYS/SYS_Visibility.h>
15 #include <SYS/SYS_Math.h>
16 #include <cstdint>
17 
18 #if defined(FORCE_NON_SIMD)
19  #include "VM_BasicAVXFunc.h"
20 #else
21  #include "VM_AVXFunc.h"
22 #endif
23 
24 class v8uf;
25 
26 class v8uu {
27 public:
29  SYS_FORCE_INLINE v8uu(const v8si &v) : vector(v) {}
32  explicit SYS_FORCE_INLINE v8uu(const int32 v[8])
33  { vector = VM_LOAD_AVX(v); }
35  int32 e, int32 f, int32 g, int32 h)
36  { vector = VM_SPLATS_AVX(a, b, c, d, e, f, g, h); }
37 
38  // store (readback)
39  SYS_FORCE_INLINE void store(int32 v[8]) const
40  { VM_STORE_AVX(v, vector); }
41 
42  // Assignment
44  { vector = v8uu(v).vector; return *this; }
46  { vector = v; return *this; }
48  { vector = v.vector; return *this; }
49 
50  SYS_FORCE_INLINE void condAssign(const v8uu &val, const v8uu &c)
51  { *this = (c & val) | ((!c) & *this); }
52 
53  // Comparison
55  { return v8uu(VM_ICMPEQ_AVX(vector, v.vector)); }
57  { return ~(*this == v); }
59  { return v8uu(VM_ICMPGT_AVX(vector, v.vector)); }
61  { return v8uu(VM_ICMPLT_AVX(vector, v.vector)); }
63  { return ~(*this < v); }
65  { return ~(*this > v); }
66 
67  SYS_FORCE_INLINE v8uu operator == (int32 v) const { return *this == v8uu(v); }
68  SYS_FORCE_INLINE v8uu operator != (int32 v) const { return *this != v8uu(v); }
69  SYS_FORCE_INLINE v8uu operator > (int32 v) const { return *this > v8uu(v); }
70  SYS_FORCE_INLINE v8uu operator < (int32 v) const { return *this < v8uu(v); }
71  SYS_FORCE_INLINE v8uu operator >= (int32 v) const { return *this >= v8uu(v); }
72  SYS_FORCE_INLINE v8uu operator <= (int32 v) const { return *this <= v8uu(v); }
73 
74  // BitShifting
77 
78  // Basic math
80  { return v8uu(VM_IADD_AVX(vector, r.vector)); }
82  { return v8uu(VM_ISUB_AVX(vector, r.vector)); }
84  { return v8uu(VM_IMUL_AVX(vector, r.vector)); }
85  SYS_FORCE_INLINE v8uu operator+=(const v8uu &r) { return (*this = *this + r); }
86  SYS_FORCE_INLINE v8uu operator-=(const v8uu &r) { return (*this = *this - r); }
87  SYS_FORCE_INLINE v8uu operator*=(const v8uu &r) { return (*this = *this * r); }
88  SYS_FORCE_INLINE v8uu operator+(int32 r) const { return *this + v8uu(r); }
89  SYS_FORCE_INLINE v8uu operator-(int32 r) const { return *this - v8uu(r); }
90  SYS_FORCE_INLINE v8uu operator*(int32 r) const { return *this * v8uu(r); }
91  SYS_FORCE_INLINE v8uu operator+=(int32 r) { return (*this = *this + r); }
92  SYS_FORCE_INLINE v8uu operator-=(int32 r) { return (*this = *this - r); }
93  SYS_FORCE_INLINE v8uu operator*=(int32 r) { return (*this = *this * r); }
94 
95  // logical/bitwise
96 
98  { return v8uu(VM_OR_AVX(vector, r.vector)); }
100  { return v8uu(VM_AND_AVX(vector, r.vector)); }
102  { return v8uu(VM_XOR_AVX(vector, r.vector)); }
104  { return *this == v8uu(0); }
105 
106  SYS_FORCE_INLINE v8uu operator|(const v8uu &r) const { return *this || r; }
107  SYS_FORCE_INLINE v8uu operator&(const v8uu &r) const { return *this && r; }
109  { return *this ^ v8uu(0xFFFFFFFF); }
113 
114  // component
115  SYS_FORCE_INLINE int32 operator[](int idx) const { return VM_EXTRACT_AVX(vector, idx); }
116  SYS_FORCE_INLINE void setComp(int idx, int32 v) { vector = VM_INSERT_AVX(vector, v, idx); }
117 
118  SYS_FORCE_INLINE v8uf toFloat() const;
119 
120 public:
122 };
123 
124 class v8uf {
125 public:
127  SYS_FORCE_INLINE v8uf(const v8sf &v) : vector(v) {}
129  explicit SYS_FORCE_INLINE v8uf(float v) { vector = VM_SPLATS_AVX(v); }
130  explicit SYS_FORCE_INLINE v8uf(const float v[8])
131  { vector = VM_LOAD_AVX(v); }
132  SYS_FORCE_INLINE v8uf(float a, float b, float c, float d,
133  float e, float f, float g, float h)
134  { vector = VM_SPLATS_AVX(a, b, c, d, e, f , g, h); }
135 
136  // store (readback)
137  SYS_FORCE_INLINE void store(float v[8]) const
138  { VM_STORE_AVX(v, vector); }
139 
140  // Assignment
142  { vector = v8uf(v).vector; return *this; }
144  { vector = v; return *this; }
146  { vector = v.vector; return *this; }
147 
148  SYS_FORCE_INLINE void condAssign(const v8uf &val, const v8uu &c)
149  { *this = (val & c) | (*this & ~c); }
150 
151  // Comparison
153  { return v8uu(VM_CMPEQ_AVX(vector, v.vector)); }
155  { return v8uu(VM_CMPNE_AVX(vector, v.vector)); }
157  { return v8uu(VM_CMPGT_AVX(vector, v.vector)); }
159  { return v8uu(VM_CMPLT_AVX(vector, v.vector)); }
161  { return v8uu(VM_CMPGE_AVX(vector, v.vector)); }
163  { return v8uu(VM_CMPLE_AVX(vector, v.vector)); }
164 
165  SYS_FORCE_INLINE v8uu operator == (float v) const { return *this == v8uf(v); }
166  SYS_FORCE_INLINE v8uu operator != (float v) const { return *this != v8uf(v); }
167  SYS_FORCE_INLINE v8uu operator > (float v) const { return *this > v8uf(v); }
168  SYS_FORCE_INLINE v8uu operator < (float v) const { return *this < v8uf(v); }
169  SYS_FORCE_INLINE v8uu operator >= (float v) const { return *this >= v8uf(v); }
170  SYS_FORCE_INLINE v8uu operator <= (float v) const { return *this <= v8uf(v); }
171 
172 
173  // Basic math
175  { return v8uf(VM_ADD_AVX(vector, r.vector)); }
177  { return v8uf(VM_SUB_AVX(vector, r.vector)); }
179  { return v8uf(VM_NEG_AVX(vector)); }
181  { return v8uf(VM_MUL_AVX(vector, r.vector)); }
183  { return v8uf(VM_DIV_AVX(vector, r.vector)); }
184 
185  SYS_FORCE_INLINE v8uf operator+=(const v8uf &r) { return (*this = *this + r); }
186  SYS_FORCE_INLINE v8uf operator-=(const v8uf &r) { return (*this = *this - r); }
187  SYS_FORCE_INLINE v8uf operator*=(const v8uf &r) { return (*this = *this * r); }
188  SYS_FORCE_INLINE v8uf operator/=(const v8uf &r) { return (*this = *this / r); }
189 
190  SYS_FORCE_INLINE v8uf operator+(float r) const { return *this + v8uf(r); }
191  SYS_FORCE_INLINE v8uf operator-(float r) const { return *this - v8uf(r); }
192  SYS_FORCE_INLINE v8uf operator*(float r) const { return *this * v8uf(r); }
193  SYS_FORCE_INLINE v8uf operator/(float r) const { return *this / v8uf(r); }
194  SYS_FORCE_INLINE v8uf operator+=(float r) { return (*this = *this + r); }
195  SYS_FORCE_INLINE v8uf operator-=(float r) { return (*this = *this - r); }
196  SYS_FORCE_INLINE v8uf operator*=(float r) { return (*this = *this * r); }
197  SYS_FORCE_INLINE v8uf operator/=(float r) { return (*this = *this / r); }
198 
199  // logical/bitwise
200 
202  { return v8uf(V8SF(VM_OR_AVX(V8SI(vector), r.vector))); }
204  { return v8uf(V8SF(VM_AND_AVX(V8SI(vector), r.vector))); }
206  { return v8uf(V8SF(VM_XOR_AVX(V8SI(vector), r.vector))); }
208  { return v8uf(V8SF((*this == v8uf(0.0F)).vector)); }
209 
211  { return v8uf(V8SF(VM_OR_AVX(V8SI(vector), V8SI(r.vector)))); }
213  { return v8uf(V8SF(VM_AND_AVX(V8SI(vector), V8SI(r.vector)))); }
215  { return v8uf(V8SF(VM_XOR_AVX(V8SI(vector), V8SI(r.vector)))); }
216 
217  SYS_FORCE_INLINE v8uf operator|(const v8uu &r) const { return *this || r; }
218  SYS_FORCE_INLINE v8uf operator&(const v8uu &r) const { return *this && r; }
220  { return *this ^ v8uu(0xFFFFFFFF); }
221 
222  SYS_FORCE_INLINE v8uf operator|(const v8uf &r) const { return *this || r; }
223  SYS_FORCE_INLINE v8uf operator&(const v8uf &r) const { return *this && r; }
224 
225  // component
226  SYS_FORCE_INLINE float operator[](int idx) const { return VM_EXTRACT_AVX(vector, idx); }
227  SYS_FORCE_INLINE void setComp(int idx, float v) { vector = VM_INSERT_AVX(vector, v, idx); }
228 
229  // more math
231  SYS_FORCE_INLINE v8uf clamp(const v8uf &low, const v8uf &high) const
232  { return v8uf(VM_MIN_AVX(VM_MAX_AVX(vector, low.vector), high.vector)); }
233  SYS_FORCE_INLINE v8uf clamp(float low, float high) const
234  { return v8uf(VM_MIN_AVX(VM_MAX_AVX(vector,v8uf(low).vector), v8uf(high).vector)); }
236 
237  /// This is a lie, it is a signed int.
240 
242  {
243  v8uu result;
244  VM_P_FLOOR_AVX();
245  result = VM_FLOOR_AVX(vector);
246  VM_E_FLOOR_AVX();
247  return result;
248  }
249 
250  /// Returns the integer part of this float, this becomes the
251  /// 0..1 fractional component.
253  {
254  v8uu base;
255  base = toSignedInt();
256  *this -= base.toFloat();
257  return base;
258  }
259 
260  template <int A, int B, int C, int D>
262  {
263  return VM_SHUFFLE_AVX<A,B,C,D>(vector);
264  }
265 
267  {
268  // If the exponent is the maximum value, it's either infinite or NaN.
269  const v8si mask = VM_SPLATS_AVX(0x7F800000);
270  return ~v8uu(VM_ICMPEQ_AVX(VM_AND_AVX(V8SI(vector), mask), mask));
271  }
272 
273 public:
275 };
276 
279 {
280  return v8uf(VM_IFLOAT_AVX(vector));
281 }
282 
283 //
284 // Bitcast
285 //
286 static SYS_FORCE_INLINE v8uf
287 bitCastIntToFloat(const v8uu &v) { return V8SF(v.vector); }
288 
289 static SYS_FORCE_INLINE v8uu
290 bitCastFloatToInt(const v8uf &v) { return V8SI(v.vector); }
291 
292 //
293 // Custom vector operations
294 //
295 
296 static SYS_FORCE_INLINE v8uf
297 sqrt(const v8uf &a)
298 {
299  return v8uf(VM_SQRT_AVX(a.vector));
300 }
301 
302 static SYS_FORCE_INLINE v8uf
303 fabs(const v8uf &a)
304 {
305  return a.abs();
306 }
307 
308 // Use this operation to mask disabled values to 0
309 // rval = !a ? b : 0;
310 
311 static SYS_FORCE_INLINE v8uf
312 andn(const v8uu &a, const v8uf &b)
313 {
314  return v8uf(V8SF(VM_ANDNOT_AVX(a.vector, V8SI(b.vector))));
315 }
316 
317 static SYS_FORCE_INLINE v8uu
318 andn(const v8uu &a, const v8uu &b)
319 {
320  return v8uu(VM_ANDNOT_AVX(a.vector, b.vector));
321 }
322 
323 // rval = a ? b : c;
324 static SYS_FORCE_INLINE v8uf
325 ternary(const v8uu &a, const v8uf &b, const v8uf &c)
326 {
327  return (b & a) | andn(a, c);
328 }
329 
330 static SYS_FORCE_INLINE v8uu
331 ternary(const v8uu &a, const v8uu &b, const v8uu &c)
332 {
333  return (b & a) | andn(a, c);
334 }
335 
336 // rval = !(a && b)
337 static SYS_FORCE_INLINE v8uu
338 nand(const v8uu &a, const v8uu &b)
339 {
340  return !v8uu(VM_AND_AVX(a.vector, b.vector));
341 }
342 
343 static SYS_FORCE_INLINE v8uf
344 vmin(const v8uf &a, const v8uf &b)
345 {
346  return v8uf(VM_MIN_AVX(a.vector, b.vector));
347 }
348 
349 static SYS_FORCE_INLINE v8uf
350 vmax(const v8uf &a, const v8uf &b)
351 {
352  return v8uf(VM_MAX_AVX(a.vector, b.vector));
353 }
354 
355 static SYS_FORCE_INLINE v8uf
356 clamp(const v8uf &a, const v8uf &b, const v8uf &c)
357 {
358  return vmax(vmin(a, c), b);
359 }
360 
361 static SYS_FORCE_INLINE v8uf
362 clamp(const v8uf &a, float b, float c)
363 {
364  return vmax(vmin(a, v8uf(c)), v8uf(b));
365 }
366 
367 static SYS_FORCE_INLINE bool
368 allbits(const v8uu &a)
369 {
370  return vm_allbits_avx(a.vector);
371 }
372 
373 static SYS_FORCE_INLINE bool
374 anybits(const v8uu &a)
375 {
376  return !allbits(~a);
377 }
378 
379 static SYS_FORCE_INLINE v8uf
380 madd(const v8uf &v, const v8uf &f, const v8uf &a)
381 {
382  return v8uf(VM_MADD_AVX(v.vector, f.vector, a.vector));
383 }
384 
385 static SYS_FORCE_INLINE v8uf
386 madd(const v8uf &v, float f, float a)
387 {
388  return v8uf(VM_MADD_AVX(v.vector, v8uf(f).vector, v8uf(a).vector));
389 }
390 
391 static SYS_FORCE_INLINE v8uf
392 madd(const v8uf &v, float f, const v8uf &a)
393 {
394  return v8uf(VM_MADD_AVX(v.vector, v8uf(f).vector, a.vector));
395 }
396 
397 static SYS_FORCE_INLINE v8uf
398 msub(const v8uf &v, const v8uf &f, const v8uf &s)
399 {
400  return madd(v, f, -s);
401 }
402 
403 static SYS_FORCE_INLINE v8uf
404 msub(const v8uf &v, float f, float s)
405 {
406  return madd(v, f, -s);
407 }
408 
409 static SYS_FORCE_INLINE v8uf
410 lerp(const v8uf &a, const v8uf &b, const v8uf &w)
411 {
412  v8uf w1 = v8uf(1.0F) - w;
413  return madd(a, w1, b*w);
414 }
415 
416 static SYS_FORCE_INLINE v8uf
417 luminance(const v8uf &r, const v8uf &g, const v8uf &b,
418  float rw, float gw, float bw)
419 {
420  return v8uf(madd(r, v8uf(rw), madd(g, v8uf(gw), b * bw)));
421 }
422 
423 static SYS_FORCE_INLINE v8uf
424 sin(const v8uf &x)
425 {
426  return (v8uf)VM_SIN_AVX(x.vector);
427 }
428 
429 static SYS_FORCE_INLINE v8uf
430 cos(const v8uf &x)
431 {
432  return (v8uf)VM_COS_AVX(x.vector);
433 }
434 
435 static SYS_FORCE_INLINE v8uf
436 tan(const v8uf &x)
437 {
438  return (v8uf)VM_TAN_AVX(x.vector);
439 }
440 
441 static SYS_FORCE_INLINE void
442 sincos(const v8uf &x, v8uf *s, v8uf *c)
443 {
444  VM_SINCOS_AVX(x.vector, &(s->vector), &(c->vector));
445 }
446 
447 // These operations are somewhat ill-defined for 8-vectors
448 #if 0
449 static inline float
450 dot3(const v8uf &a, const v8uf &b)
451 {
452  v8uf res = a*b;
453  return res[0] + res[1] + res[2];
454 }
455 
456 static inline float
457 dot4(const v8uf &a, const v8uf &b)
458 {
459  v8uf res = a*b;
460  return res[0] + res[1] + res[2] + res[3];
461 }
462 
463 static inline float
464 length(const v8uf &a)
465 {
466  return SYSsqrt(dot3(a, a));
467 }
468 
469 static inline v8uf
470 normalize(const v8uf &a)
471 {
472  return a / length(a);
473 }
474 
475 static inline v8uf
476 cross(const v8uf &a, const v8uf &b)
477 {
478  return v8uf(a[1]*b[2] - a[2]*b[1],
479  a[2]*b[0] - a[0]*b[2],
480  a[0]*b[1] - a[1]*b[0], 0,
481 
482  a[5]*b[6] - a[6]*b[5],
483  a[6]*b[4] - a[4]*b[6],
484  a[4]*b[5] - a[5]*b[4], 0);
485 }
486 #endif
487 
488 // Currently there is no specific support for signed integers
489 typedef v8uu v8ui;
490 
491 // Assuming that ptr is an array of elements of type STYPE, this operation
492 // will return the index of the first element that is aligned to (1<<ASIZE)
493 // bytes.
494 #define VM_ALIGN_AVX(ptr, ASIZE, STYPE) \
495  ((((1<<ASIZE)-(intptr_t)ptr)&((1<<ASIZE)-1))/sizeof(STYPE))
496 
497 #endif
SYS_FORCE_INLINE v8uu operator=(const v8uu &v)
Definition: VM_AVX.h:47
SYS_FORCE_INLINE v8uf(const v8sf &v)
Definition: VM_AVX.h:127
SYS_FORCE_INLINE void operator^=(const v8uu &r)
Definition: VM_AVX.h:112
SYS_FORCE_INLINE v8uf operator-=(const v8uf &r)
Definition: VM_AVX.h:186
SYS_FORCE_INLINE v8uf operator*(const v8uf &r) const
Definition: VM_AVX.h:180
SYS_API double cos(double x)
Definition: SYS_FPUMath.h:69
SYS_FORCE_INLINE void condAssign(const v8uu &val, const v8uu &c)
Definition: VM_AVX.h:50
SYS_FORCE_INLINE v8uu floor() const
Definition: VM_AVX.h:241
SYS_FORCE_INLINE v8uf operator|(const v8uf &r) const
Definition: VM_AVX.h:222
SYS_FORCE_INLINE v8uf clamp(float low, float high) const
Definition: VM_AVX.h:233
SYS_FORCE_INLINE v8uu operator=(int32 v)
Definition: VM_AVX.h:43
SYS_FORCE_INLINE v8uu operator*=(const v8uu &r)
Definition: VM_AVX.h:87
SYS_FORCE_INLINE void operator&=(const v8uu &r)
Definition: VM_AVX.h:111
#define VM_SUB_AVX
Definition: VM_AVXFunc.h:327
SYS_FORCE_INLINE void setComp(int idx, int32 v)
Definition: VM_AVX.h:116
int int32
Definition: SYS_Types.h:39
#define VM_SHIFTRIGHT_AVX(A, C)
Definition: VM_AVXFunc.h:376
SYS_FORCE_INLINE v8uu operator*(const v8uu &r) const
Definition: VM_AVX.h:83
#define VM_TAN_AVX
Definition: VM_AVXFunc.h:616
GLenum clamp
Definition: glcorearb.h:1234
SYS_FORCE_INLINE v8uu operator&&(const v8uu &r) const
Definition: VM_AVX.h:99
v8uu v8ui
Definition: VM_AVX.h:489
SYS_FORCE_INLINE v8uu operator==(const v8uu &v) const
Definition: VM_AVX.h:54
#define VM_P_FLOOR_AVX()
Definition: VM_AVXFunc.h:365
SYS_FORCE_INLINE void operator|=(const v8uu &r)
Definition: VM_AVX.h:110
SYS_FORCE_INLINE v8uf operator&(const v8uu &r) const
Definition: VM_AVX.h:218
const GLdouble * v
Definition: glcorearb.h:837
SYS_FORCE_INLINE void store(int32 v[8]) const
Definition: VM_AVX.h:39
SYS_FORCE_INLINE v8uu operator+=(const v8uu &r)
Definition: VM_AVX.h:85
SYS_FORCE_INLINE v8uu operator-=(const v8uu &r)
Definition: VM_AVX.h:86
SYS_FORCE_INLINE v8uf operator*=(const v8uf &r)
Definition: VM_AVX.h:187
#define VM_IADD_AVX
Definition: VM_AVXFunc.h:322
virtual bool lerp(GA_AttributeOperand &d, GA_AttributeOperand &a, GA_AttributeOperand &b, GA_AttributeOperand &t) const
d = SYSlerp(a, b, t);
#define VM_COS_AVX
Definition: VM_AVXFunc.h:615
#define VM_MADD_AVX
Definition: VM_AVXFunc.h:338
SYS_FORCE_INLINE v8uf abs() const
Definition: VM_AVX.h:230
SYS_FORCE_INLINE v8uu operator|(const v8uu &r) const
Definition: VM_AVX.h:106
#define VM_ICMPLT_AVX
Definition: VM_AVXFunc.h:318
vfloat4 sqrt(const vfloat4 &a)
Definition: simd.h:7481
GLboolean GLboolean g
Definition: glcorearb.h:1222
SYS_FORCE_INLINE v8uf operator=(const v8uf &v)
Definition: VM_AVX.h:145
SYS_FORCE_INLINE v8uf operator^(const v8uf &r) const
Definition: VM_AVX.h:214
SYS_FORCE_INLINE v8uu(const int32 v[8])
Definition: VM_AVX.h:32
SYS_FORCE_INLINE v8uf clamp(const v8uf &low, const v8uf &high) const
Definition: VM_AVX.h:231
OIIO_HOSTDEVICE void sincos(float x, float *sine, float *cosine)
Definition: fmath.h:703
SYS_FORCE_INLINE v8uf operator~() const
Definition: VM_AVX.h:219
SYS_FORCE_INLINE v8uf operator/(const v8uf &r) const
Definition: VM_AVX.h:182
SYS_FORCE_INLINE v8uf operator||(const v8uf &r) const
Definition: VM_AVX.h:210
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
#define VM_ICMPGT_AVX
Definition: VM_AVXFunc.h:319
v8sf vector
Definition: VM_AVX.h:274
#define VM_DIV_AVX
Definition: VM_AVXFunc.h:329
SYS_FORCE_INLINE v8uf operator-(float r) const
Definition: VM_AVX.h:191
SYS_FORCE_INLINE v8uu operator<=(const v8uf &v) const
Definition: VM_AVX.h:162
#define VM_XOR_AVX
Definition: VM_AVXFunc.h:346
#define VM_AND_AVX
Definition: VM_AVXFunc.h:343
OIIO_FORCEINLINE OIIO_HOSTDEVICE float msub(float a, float b, float c)
Fused multiply and subtract: (a*b - c)
Definition: fmath.h:422
**But if you need a result
Definition: thread.h:613
SYS_FORCE_INLINE v8uf operator=(float v)
Definition: VM_AVX.h:141
#define VM_CMPLT_AVX(A, B)
Definition: VM_AVXFunc.h:311
SYS_FORCE_INLINE v8uu operator<(const v8uu &v) const
Definition: VM_AVX.h:60
SYS_FORCE_INLINE v8uu operator==(const v8uf &v) const
Definition: VM_AVX.h:152
#define VM_IFLOAT_AVX
Definition: VM_AVXFunc.h:372
#define VM_IMUL_AVX
Definition: VM_AVXFunc.h:324
SYS_FORCE_INLINE v8uu operator*=(int32 r)
Definition: VM_AVX.h:93
#define VM_SPLATS_AVX
Definition: VM_AVXFunc.h:307
SYS_FORCE_INLINE v8uu operator>=(const v8uf &v) const
Definition: VM_AVX.h:160
float dot3(const vfloat4 &a, const vfloat4 &b)
Return the float 3-component dot (inner) product of a and b.
Definition: simd.h:7313
#define VM_NEG_AVX
Definition: VM_AVXFunc.h:336
SYS_FORCE_INLINE v8uf operator+(const v8uf &r) const
Definition: VM_AVX.h:174
SYS_FORCE_INLINE v8uf operator-(const v8uf &r) const
Definition: VM_AVX.h:176
SYS_FORCE_INLINE v8uu operator!=(const v8uf &v) const
Definition: VM_AVX.h:154
#define VM_SQRT_AVX
Definition: VM_AVXFunc.h:330
SYS_FORCE_INLINE v8uf()
Definition: VM_AVX.h:126
SYS_FORCE_INLINE v8uu(int32 a, int32 b, int32 c, int32 d, int32 e, int32 f, int32 g, int32 h)
Definition: VM_AVX.h:34
SYS_FORCE_INLINE v8uf operator|(const v8uu &r) const
Definition: VM_AVX.h:217
#define VM_SHIFTLEFT_AVX(A, C)
Definition: VM_AVXFunc.h:375
v8si vector
Definition: VM_AVX.h:121
SYS_FORCE_INLINE v8uu operator^(const v8uu &r) const
Definition: VM_AVX.h:101
SYS_FORCE_INLINE v8uf(float a, float b, float c, float d, float e, float f, float g, float h)
Definition: VM_AVX.h:132
GLfloat f
Definition: glcorearb.h:1926
SYS_FORCE_INLINE v8uf swizzle() const
Definition: VM_AVX.h:261
#define VM_INVERT_AVX
Definition: VM_AVXFunc.h:332
SYS_FORCE_INLINE v8uf operator^(const v8uu &r) const
Definition: VM_AVX.h:205
SYS_FORCE_INLINE v8uf operator-() const
Definition: VM_AVX.h:178
SYS_FORCE_INLINE v8uu toSignedInt() const
Definition: VM_AVX.h:239
#define VM_ICMPEQ_AVX
Definition: VM_AVXFunc.h:320
SYS_FORCE_INLINE v8uu operator~() const
Definition: VM_AVX.h:108
SYS_FORCE_INLINE v8uu operator-(const v8uu &r) const
Definition: VM_AVX.h:81
SYS_FORCE_INLINE v8uu toUnsignedInt() const
This is a lie, it is a signed int.
Definition: VM_AVX.h:238
SYS_FORCE_INLINE v8uu operator+(int32 r) const
Definition: VM_AVX.h:88
Definition: VM_AVX.h:26
#define VM_ADD_AVX
Definition: VM_AVXFunc.h:326
#define VM_STORE_AVX
Definition: VM_AVXFunc.h:309
SYS_FORCE_INLINE v8uf operator/=(const v8uf &r)
Definition: VM_AVX.h:188
SYS_FORCE_INLINE v8uu operator=(v8si v)
Definition: VM_AVX.h:45
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
SYS_FORCE_INLINE v8uf(const v8uf &v)
Definition: VM_AVX.h:128
#define VM_CMPEQ_AVX(A, B)
Definition: VM_AVXFunc.h:315
#define VM_INT_AVX
Definition: VM_AVXFunc.h:368
SYS_FORCE_INLINE void store(float v[8]) const
Definition: VM_AVX.h:137
SYS_FORCE_INLINE v8uu operator-(int32 r) const
Definition: VM_AVX.h:89
#define VM_ABS_AVX
Definition: VM_AVXFunc.h:333
#define V8SF(A)
Definition: VM_AVXFunc.h:58
#define VM_OR_AVX
Definition: VM_AVXFunc.h:345
GLint GLuint mask
Definition: glcorearb.h:124
Definition: VM_AVX.h:124
SYS_FORCE_INLINE v8uu operator+=(int32 r)
Definition: VM_AVX.h:91
#define VM_ANDNOT_AVX
Definition: VM_AVXFunc.h:344
OIIO_FORCEINLINE OIIO_HOSTDEVICE float madd(float a, float b, float c)
Fused multiply and add: (a*b + c)
Definition: fmath.h:413
SYS_FORCE_INLINE v8uu operator>(const v8uf &v) const
Definition: VM_AVX.h:156
SYS_FORCE_INLINE v8uu operator>>(int32 c) const
Definition: VM_AVX.h:76
SYS_FORCE_INLINE v8uu operator!=(const v8uu &v) const
Definition: VM_AVX.h:56
#define VM_FLOOR_AVX
Definition: VM_AVXFunc.h:367
SYS_FORCE_INLINE v8uu operator!() const
Definition: VM_AVX.h:103
SYS_FORCE_INLINE v8uf operator/(float r) const
Definition: VM_AVX.h:193
SYS_FORCE_INLINE v8uu operator||(const v8uu &r) const
Definition: VM_AVX.h:97
SYS_FORCE_INLINE v8uf operator-=(float r)
Definition: VM_AVX.h:195
SYS_FORCE_INLINE v8uf operator+=(const v8uf &r)
Definition: VM_AVX.h:185
#define VM_CMPNE_AVX(A, B)
Definition: VM_AVXFunc.h:316
SYS_FORCE_INLINE v8uu operator&(const v8uu &r) const
Definition: VM_AVX.h:107
SYS_FORCE_INLINE v8uu operator>=(const v8uu &v) const
Definition: VM_AVX.h:62
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
SYS_FORCE_INLINE v8uf recip() const
Definition: VM_AVX.h:235
GLint GLenum GLint x
Definition: glcorearb.h:409
SYS_FORCE_INLINE v8uf(const float v[8])
Definition: VM_AVX.h:130
SYS_FORCE_INLINE void setComp(int idx, float v)
Definition: VM_AVX.h:227
#define VM_E_FLOOR_AVX()
Definition: VM_AVXFunc.h:369
SYS_FORCE_INLINE v8uu splitFloat()
Definition: VM_AVX.h:252
SYS_FORCE_INLINE v8uu operator>(const v8uu &v) const
Definition: VM_AVX.h:58
SYS_API double tan(double x)
Definition: SYS_FPUMath.h:75
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
SYS_FORCE_INLINE v8uf operator&(const v8uf &r) const
Definition: VM_AVX.h:223
#define VM_CMPLE_AVX(A, B)
Definition: VM_AVXFunc.h:312
SYS_FORCE_INLINE v8uf operator&&(const v8uu &r) const
Definition: VM_AVX.h:203
SYS_FORCE_INLINE v8uu operator<(const v8uf &v) const
Definition: VM_AVX.h:158
SYS_FORCE_INLINE v8uu(const v8uu &v)
Definition: VM_AVX.h:30
SYS_FORCE_INLINE int32 operator[](int idx) const
Definition: VM_AVX.h:115
SYS_FORCE_INLINE v8uu(const v8si &v)
Definition: VM_AVX.h:29
SYS_FORCE_INLINE v8uf operator/=(float r)
Definition: VM_AVX.h:197
#define V8SI(A)
Definition: VM_AVXFunc.h:59
SYS_FORCE_INLINE v8uf operator+(float r) const
Definition: VM_AVX.h:190
#define VM_CMPGT_AVX(A, B)
Definition: VM_AVXFunc.h:313
#define VM_INSERT_AVX
Definition: VM_AVXFunc.h:306
SYS_FORCE_INLINE v8uf operator!() const
Definition: VM_AVX.h:207
GLuint GLfloat * val
Definition: glcorearb.h:1608
SYS_FORCE_INLINE v8uf operator=(v8sf v)
Definition: VM_AVX.h:143
SYS_FORCE_INLINE v8uu operator<<(int32 c) const
Definition: VM_AVX.h:75
SYS_FORCE_INLINE v8uf operator&&(const v8uf &r) const
Definition: VM_AVX.h:212
SYS_FORCE_INLINE v8uu operator*(int32 r) const
Definition: VM_AVX.h:90
SYS_FORCE_INLINE v8uf operator*(float r) const
Definition: VM_AVX.h:192
SYS_FORCE_INLINE v8uu operator-=(int32 r)
Definition: VM_AVX.h:92
SYS_FORCE_INLINE v8uu isFinite() const
Definition: VM_AVX.h:266
SYS_FORCE_INLINE v8uu(int32 v)
Definition: VM_AVX.h:31
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
SYS_FORCE_INLINE float operator[](int idx) const
Definition: VM_AVX.h:226
#define VM_MIN_AVX
Definition: VM_AVXFunc.h:340
SYS_FORCE_INLINE v8uf(float v)
Definition: VM_AVX.h:129
GLboolean r
Definition: glcorearb.h:1222
SYS_FORCE_INLINE void condAssign(const v8uf &val, const v8uu &c)
Definition: VM_AVX.h:148
SYS_FORCE_INLINE v8uf toFloat() const
Definition: VM_AVX.h:278
SYS_FORCE_INLINE v8uf operator||(const v8uu &r) const
Definition: VM_AVX.h:201
#define VM_MUL_AVX
Definition: VM_AVXFunc.h:328
SYS_FORCE_INLINE v8uu()
Definition: VM_AVX.h:28
#define VM_LOAD_AVX
Definition: VM_AVXFunc.h:308
SYS_FORCE_INLINE v8uu operator<=(const v8uu &v) const
Definition: VM_AVX.h:64
#define VM_SINCOS_AVX
Definition: VM_AVXFunc.h:613
SYS_FORCE_INLINE v8uu operator+(const v8uu &r) const
Definition: VM_AVX.h:79
SIM_DerVector3 cross(const SIM_DerVector3 &lhs, const SIM_DerVector3 &rhs)
#define VM_MAX_AVX
Definition: VM_AVXFunc.h:341
#define VM_SIN_AVX
Definition: VM_AVXFunc.h:614
#define VM_CMPGE_AVX(A, B)
Definition: VM_AVXFunc.h:314
SYS_API double sin(double x)
Definition: SYS_FPUMath.h:71
#define VM_EXTRACT_AVX
Definition: VM_AVXFunc.h:305
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept
SYS_FORCE_INLINE v8uf operator+=(float r)
Definition: VM_AVX.h:194
#define VM_ISUB_AVX
Definition: VM_AVXFunc.h:323
SYS_FORCE_INLINE v8uf operator*=(float r)
Definition: VM_AVX.h:196