HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VM_SIMD.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_SIMD.C ( VM Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __VM_SIMD__
12 #define __VM_SIMD__
13 
14 #include <SYS/SYS_Inline.h>
15 #include <SYS/SYS_Math.h>
16 #include <SYS/SYS_StaticAssert.h>
17 #include <SYS/SYS_Types.h>
18 #include <SYS/SYS_TypeTraits.h>
19 #include <SYS/SYS_Visibility.h>
20 #include <cstdint>
21 
22 //#define FORCE_NON_SIMD
23 
24 // Some older versions of glibc don't correctly align the stack for extra
25 // threads (this problem should have been fixed in 2.3.4 - see
26 // http://sources.redhat.com/bugzilla/show_bug.cgi?id=723). Instead of
27 // checking the glibc version, check the compiler version and assume newer
28 // compilers are used with newer glibc.
29 
30 #if defined(FORCE_NON_SIMD)
31  #include "VM_BasicFunc.h"
32 #else
33  #if defined(LINUX) && SYS_IS_GCC_GE(3, 4) && defined(__SSE2__)
34  #include "VM_SSEFunc.h"
35  #elif defined(WIN32)
36  #include "VM_SSEFunc.h"
37  #elif defined(MBSD_INTEL)
38  #include "VM_SSEFunc.h"
39  #else
40  #include "VM_BasicFunc.h"
41  #endif
42 #endif
43 
44 class v4uf;
45 
46 class v4uu {
47 public:
48  // NOTE: For unknown reasons, BVH construction is significantly
49  // slower on GCC 5.4 if v4uu and v4uf are POD types, so I put
50  // back the previous code.
51 #if 0
52  SYS_FORCE_INLINE v4uu() noexcept = default;
53  SYS_FORCE_INLINE v4uu(const v4si &v) : vector(v) {
54  SYS_STATIC_ASSERT_MSG(SYSisPOD<v4uu>(), "v4uu should be POD, for better performance in UT_Array, etc.");
55  }
56  SYS_FORCE_INLINE v4uu(const v4uu &v) noexcept = default;
57  SYS_FORCE_INLINE v4uu &operator=(const v4uu &v) noexcept = default;
58 #else
60  SYS_FORCE_INLINE v4uu(const v4si &v) : vector(v) {}
61  SYS_FORCE_INLINE v4uu(const v4uu &v) : vector(v.vector) {}
62  SYS_FORCE_INLINE v4uu operator=(const v4uu &v)
63  { vector = v.vector; return *this; }
64 #endif
65  explicit SYS_FORCE_INLINE v4uu(int32 v) { vector = VM_SPLATS(v); }
66  explicit SYS_FORCE_INLINE v4uu(const int32 v[4])
67  { vector = VM_LOAD(v); }
69  { vector = VM_SPLATS(a, b, c, d); }
70 
71  // store (readback)
72  SYS_FORCE_INLINE void store(int32 v[4]) const
73  { VM_STORE(v, vector); }
74 
75  // Assignment
77  { vector = v4uu(v).vector; return *this; }
79  { vector = v; return *this; }
80 
81  SYS_FORCE_INLINE void condAssign(const v4uu &val, const v4uu &c)
82  { *this = (c & val) | ((!c) & *this); }
83 
84  // Comparison
85  SYS_FORCE_INLINE v4uu operator == (const v4uu &v) const
86  { return v4uu(VM_ICMPEQ(vector, v.vector)); }
87  SYS_FORCE_INLINE v4uu operator != (const v4uu &v) const
88  { return ~(*this == v); }
89  SYS_FORCE_INLINE v4uu operator > (const v4uu &v) const
90  { return v4uu(VM_ICMPGT(vector, v.vector)); }
91  SYS_FORCE_INLINE v4uu operator < (const v4uu &v) const
92  { return v4uu(VM_ICMPLT(vector, v.vector)); }
93  SYS_FORCE_INLINE v4uu operator >= (const v4uu &v) const
94  { return ~(*this < v); }
95  SYS_FORCE_INLINE v4uu operator <= (const v4uu &v) const
96  { return ~(*this > v); }
97 
98  SYS_FORCE_INLINE v4uu operator == (int32 v) const { return *this == v4uu(v); }
99  SYS_FORCE_INLINE v4uu operator != (int32 v) const { return *this != v4uu(v); }
100  SYS_FORCE_INLINE v4uu operator > (int32 v) const { return *this > v4uu(v); }
101  SYS_FORCE_INLINE v4uu operator < (int32 v) const { return *this < v4uu(v); }
102  SYS_FORCE_INLINE v4uu operator >= (int32 v) const { return *this >= v4uu(v); }
103  SYS_FORCE_INLINE v4uu operator <= (int32 v) const { return *this <= v4uu(v); }
104 
105  // BitShifting
108 
109  // Basic math
110  SYS_FORCE_INLINE v4uu operator+(const v4uu &r) const
111  { return v4uu(VM_IADD(vector, r.vector)); }
112  SYS_FORCE_INLINE v4uu operator-(const v4uu &r) const
113  { return v4uu(VM_ISUB(vector, r.vector)); }
114 #if defined(VM_IMUL)
115  SYS_FORCE_INLINE v4uu operator*(const v4uu &r) const
116  { return v4uu(VM_IMUL(vector, r.vector)); }
117 #else
118  SYS_FORCE_INLINE v4uu operator*(const v4uu &r) const
119  {
120  return v4uu((*this)[0] * r[0],
121  (*this)[1] * r[1],
122  (*this)[2] * r[2],
123  (*this)[3] * r[3]);
124  }
125 #endif
126  SYS_FORCE_INLINE v4uu operator+=(const v4uu &r) { return (*this = *this + r); }
127  SYS_FORCE_INLINE v4uu operator-=(const v4uu &r) { return (*this = *this - r); }
128  SYS_FORCE_INLINE v4uu operator*=(const v4uu &r) { return (*this = *this * r); }
129  SYS_FORCE_INLINE v4uu operator+(int32 r) const { return *this + v4uu(r); }
130  SYS_FORCE_INLINE v4uu operator-(int32 r) const { return *this - v4uu(r); }
131  SYS_FORCE_INLINE v4uu operator*(int32 r) const { return *this * v4uu(r); }
132  SYS_FORCE_INLINE v4uu operator+=(int32 r) { return (*this = *this + r); }
133  SYS_FORCE_INLINE v4uu operator-=(int32 r) { return (*this = *this - r); }
134  SYS_FORCE_INLINE v4uu operator*=(int32 r) { return (*this = *this * r); }
135 
136  // Modulo
137  SYS_FORCE_INLINE v4uu operator%(const v4uu &r) const
138  {
139  return v4uu((*this)[0] % r[0],
140  (*this)[1] % r[1],
141  (*this)[2] % r[2],
142  (*this)[3] % r[3]);
143  }
144  SYS_FORCE_INLINE v4uu operator%(int r) const
145  {
146  return v4uu((*this)[0] % r,
147  (*this)[1] % r,
148  (*this)[2] % r,
149  (*this)[3] % r);
150  }
151  SYS_FORCE_INLINE v4uu operator%=(const v4uu &r) { return (*this = *this % r); }
152  SYS_FORCE_INLINE v4uu operator%=(int r) { return (*this = *this % r); }
153 
154 
155  // logical/bitwise
156 
157  SYS_FORCE_INLINE v4uu operator||(const v4uu &r) const
158  { return v4uu(VM_OR(vector, r.vector)); }
159  SYS_FORCE_INLINE v4uu operator&&(const v4uu &r) const
160  { return v4uu(VM_AND(vector, r.vector)); }
161  SYS_FORCE_INLINE v4uu operator^(const v4uu &r) const
162  { return v4uu(VM_XOR(vector, r.vector)); }
164  { return *this == v4uu(0); }
165 
166  SYS_FORCE_INLINE v4uu operator|(const v4uu &r) const { return *this || r; }
167  SYS_FORCE_INLINE v4uu operator&(const v4uu &r) const { return *this && r; }
169  { return *this ^ v4uu(0xFFFFFFFF); }
170  SYS_FORCE_INLINE void operator|=(const v4uu &r) { vector = VM_OR(vector, r.vector); }
171  SYS_FORCE_INLINE void operator&=(const v4uu &r) { vector = VM_AND(vector, r.vector); }
172  SYS_FORCE_INLINE void operator^=(const v4uu &r) { vector = VM_XOR(vector, r.vector); }
173 
174  // component
175  SYS_FORCE_INLINE int32 operator[](int idx) const { return VM_EXTRACT(vector, idx); }
176  SYS_FORCE_INLINE void setComp(int idx, int32 v) { vector = VM_INSERT(vector, v, idx); }
177 
178  v4uf toFloat() const;
179 
180  operator v4uf() const;
181 
182 public:
184 };
185 
186 class v4uf {
187 public:
188  SYS_FORCE_INLINE v4uf() noexcept = default;
189  // NOTE: For unknown reasons, BVH construction is significantly
190  // slower on GCC 5.4 if v4uu and v4uf are POD types, so I put
191  // back the previous code.
192 #if 0
193  SYS_FORCE_INLINE v4uf(const v4uf &v) noexcept = default;
194  SYS_FORCE_INLINE v4uf(const v4sf &v) noexcept : vector(v) {
195  SYS_STATIC_ASSERT_MSG(SYSisPOD<v4uf>(), "v4uf should be POD, for better performance in UT_Array, etc.");
196  }
197  SYS_FORCE_INLINE v4uf &operator=(const v4uf &v) noexcept = default;
198 #else
199  SYS_FORCE_INLINE v4uf(const v4sf &v) noexcept : vector(v) {}
200  SYS_FORCE_INLINE v4uf(const v4uf &v) noexcept : vector(v.vector) {}
201  SYS_FORCE_INLINE v4uf operator=(const v4uf &v) noexcept
202  { vector = v.vector; return *this; }
203 #endif
204  explicit SYS_FORCE_INLINE v4uf(float v) { vector = VM_SPLATS(v); }
205  explicit SYS_FORCE_INLINE v4uf(const float v[4])
206  { vector = VM_LOAD(v); }
207  SYS_FORCE_INLINE v4uf(float a, float b, float c, float d)
208  { vector = VM_SPLATS(a, b, c, d); }
209 
210  // store (readback)
211  SYS_FORCE_INLINE void store(float v[4]) const
212  { VM_STORE(v, vector); }
213 
214  // Assignment
216  { vector = v4uf(v).vector; return *this; }
218  { vector = v; return *this; }
219 
220  SYS_FORCE_INLINE void condAssign(const v4uf &val, const v4uu &c)
221  { *this = (val & c) | (*this & ~c); }
222 
223  // Comparison
224  SYS_FORCE_INLINE v4uu operator == (const v4uf &v) const
225  { return v4uu(VM_CMPEQ(vector, v.vector)); }
226  SYS_FORCE_INLINE v4uu operator != (const v4uf &v) const
227  { return v4uu(VM_CMPNE(vector, v.vector)); }
228  SYS_FORCE_INLINE v4uu operator > (const v4uf &v) const
229  { return v4uu(VM_CMPGT(vector, v.vector)); }
230  SYS_FORCE_INLINE v4uu operator < (const v4uf &v) const
231  { return v4uu(VM_CMPLT(vector, v.vector)); }
232  SYS_FORCE_INLINE v4uu operator >= (const v4uf &v) const
233  { return v4uu(VM_CMPGE(vector, v.vector)); }
234  SYS_FORCE_INLINE v4uu operator <= (const v4uf &v) const
235  { return v4uu(VM_CMPLE(vector, v.vector)); }
236 
237  SYS_FORCE_INLINE v4uu operator == (float v) const { return *this == v4uf(v); }
238  SYS_FORCE_INLINE v4uu operator != (float v) const { return *this != v4uf(v); }
239  SYS_FORCE_INLINE v4uu operator > (float v) const { return *this > v4uf(v); }
240  SYS_FORCE_INLINE v4uu operator < (float v) const { return *this < v4uf(v); }
241  SYS_FORCE_INLINE v4uu operator >= (float v) const { return *this >= v4uf(v); }
242  SYS_FORCE_INLINE v4uu operator <= (float v) const { return *this <= v4uf(v); }
243 
244 
245  // Basic math
247  { return v4uf(VM_ADD(vector, r.vector)); }
249  { return v4uf(VM_SUB(vector, r.vector)); }
251  { return v4uf(VM_NEG(vector)); }
253  { return v4uf(VM_MUL(vector, r.vector)); }
255  { return v4uf(VM_DIV(vector, r.vector)); }
256 
257  SYS_FORCE_INLINE v4uf operator+=(const v4uf &r) { return (*this = *this + r); }
258  SYS_FORCE_INLINE v4uf operator-=(const v4uf &r) { return (*this = *this - r); }
259  SYS_FORCE_INLINE v4uf operator*=(const v4uf &r) { return (*this = *this * r); }
260  SYS_FORCE_INLINE v4uf operator/=(const v4uf &r) { return (*this = *this / r); }
261 
262  SYS_FORCE_INLINE v4uf operator+(float r) const { return *this + v4uf(r); }
263  SYS_FORCE_INLINE v4uf operator-(float r) const { return *this - v4uf(r); }
264  SYS_FORCE_INLINE v4uf operator*(float r) const { return *this * v4uf(r); }
265  SYS_FORCE_INLINE v4uf operator/(float r) const { return *this / v4uf(r); }
266  SYS_FORCE_INLINE v4uf operator+=(float r) { return (*this = *this + r); }
267  SYS_FORCE_INLINE v4uf operator-=(float r) { return (*this = *this - r); }
268  SYS_FORCE_INLINE v4uf operator*=(float r) { return (*this = *this * r); }
269  SYS_FORCE_INLINE v4uf operator/=(float r) { return (*this = *this / r); }
270 
271  // logical/bitwise
272 
273  SYS_FORCE_INLINE v4uf operator||(const v4uu &r) const
274  { return v4uf(V4SF(VM_OR(V4SI(vector), r.vector))); }
275  SYS_FORCE_INLINE v4uf operator&&(const v4uu &r) const
276  { return v4uf(V4SF(VM_AND(V4SI(vector), r.vector))); }
277  SYS_FORCE_INLINE v4uf operator^(const v4uu &r) const
278  { return v4uf(V4SF(VM_XOR(V4SI(vector), r.vector))); }
280  { return v4uf(V4SF((*this == v4uf(0.0F)).vector)); }
281 
283  { return v4uf(V4SF(VM_OR(V4SI(vector), V4SI(r.vector)))); }
285  { return v4uf(V4SF(VM_AND(V4SI(vector), V4SI(r.vector)))); }
287  { return v4uf(V4SF(VM_XOR(V4SI(vector), V4SI(r.vector)))); }
288 
289  SYS_FORCE_INLINE v4uf operator|(const v4uu &r) const { return *this || r; }
290  SYS_FORCE_INLINE v4uf operator&(const v4uu &r) const { return *this && r; }
292  { return *this ^ v4uu(0xFFFFFFFF); }
293 
294  SYS_FORCE_INLINE v4uf operator|(const v4uf &r) const { return *this || r; }
295  SYS_FORCE_INLINE v4uf operator&(const v4uf &r) const { return *this && r; }
296 
297  // component
298  SYS_FORCE_INLINE float operator[](int idx) const { return VM_EXTRACT(vector, idx); }
299  SYS_FORCE_INLINE void setComp(int idx, float v) { vector = VM_INSERT(vector, v, idx); }
300 
301  // more math
302  SYS_FORCE_INLINE v4uf abs() const { return v4uf(VM_ABS(vector)); }
303  SYS_FORCE_INLINE v4uf clamp(const v4uf &low, const v4uf &high) const
304  { return v4uf(
305  VM_MIN(VM_MAX(vector, low.vector), high.vector)); }
306  SYS_FORCE_INLINE v4uf clamp(float low, float high) const
307  { return v4uf(VM_MIN(VM_MAX(vector,
308  v4uf(low).vector), v4uf(high).vector)); }
310 
311  /// This is a lie, it is a signed int.
312  SYS_FORCE_INLINE v4uu toUnsignedInt() const { return VM_INT(vector); }
313  SYS_FORCE_INLINE v4uu toSignedInt() const { return VM_INT(vector); }
314 
315  v4uu floor() const
316  {
317  VM_P_FLOOR();
318  v4uu result = VM_FLOOR(vector);
319  VM_E_FLOOR();
320  return result;
321  }
322 
323  /// Returns the integer part of this float, this becomes the
324  /// 0..1 fractional component.
325  v4uu splitFloat()
326  {
327  v4uu base = toSignedInt();
328  *this -= base.toFloat();
329  return base;
330  }
331 
332  template <int A, int B, int C, int D>
334  {
335  return VM_SHUFFLE<A,B,C,D>(vector);
336  }
337 
339  {
340  // If the exponent is the maximum value, it's either infinite or NaN.
341  const v4si mask = VM_SPLATS(0x7F800000);
342  return ~v4uu(VM_ICMPEQ(VM_AND(V4SI(vector), mask), mask));
343  }
344 
345 public:
347 };
348 
351 {
352  return v4uf(VM_IFLOAT(vector));
353 }
355 v4uu::operator v4uf() const
356 {
357  return toFloat();
358 }
359 
360 static SYS_FORCE_INLINE v4uf
361 operator+(float r, const v4uf &v) noexcept
362 {
363  return v4uf(r) + v;
364 }
365 
366 static SYS_FORCE_INLINE v4uf
367 operator-(float r, const v4uf &v) noexcept
368 {
369  return v4uf(r) - v;
370 }
371 
372 static SYS_FORCE_INLINE v4uf
373 operator*(float r, const v4uf &v) noexcept
374 {
375  return v4uf(r) * v;
376 }
377 static SYS_FORCE_INLINE v4uf
378 operator/(float r, const v4uf &v) noexcept
379 {
380  return v4uf(r) / v;
381 }
382 
383 //
384 // Bitcast
385 //
386 static SYS_FORCE_INLINE v4uf
387 bitCastIntToFloat(const v4uu &v) { return V4SF(v.vector); }
388 
389 static SYS_FORCE_INLINE v4uu
390 bitCastFloatToInt(const v4uf &v) { return V4SI(v.vector); }
391 
392 //
393 // Custom vector operations
394 //
395 
396 static SYS_FORCE_INLINE v4uf
397 sqrt(const v4uf &a)
398 {
399  return v4uf(VM_SQRT(a.vector));
400 }
401 
402 static SYS_FORCE_INLINE v4uf
403 fabs(const v4uf &a)
404 {
405  return a.abs();
406 }
407 
408 // Use this operation to mask disabled values to 0
409 // rval = !a ? b : 0;
410 
411 static SYS_FORCE_INLINE v4uf
412 andn(const v4uu &a, const v4uf &b)
413 {
414  return v4uf(V4SF(VM_ANDNOT(a.vector, V4SI(b.vector))));
415 }
416 
417 static SYS_FORCE_INLINE v4uu
418 andn(const v4uu &a, const v4uu &b)
419 {
420  return v4uu(VM_ANDNOT(a.vector, b.vector));
421 }
422 
423 // rval = a ? b : c;
424 static SYS_FORCE_INLINE v4uf
425 ternary(const v4uu &a, const v4uf &b, const v4uf &c)
426 {
427  return (b & a) | andn(a, c);
428 }
429 
430 static SYS_FORCE_INLINE v4uu
431 ternary(const v4uu &a, const v4uu &b, const v4uu &c)
432 {
433  return (b & a) | andn(a, c);
434 }
435 
436 // rval = !(a && b)
437 static SYS_FORCE_INLINE v4uu
438 nand(const v4uu &a, const v4uu &b)
439 {
440  return !v4uu(VM_AND(a.vector, b.vector));
441 }
442 
443 static SYS_FORCE_INLINE v4uf
444 vmin(const v4uf &a, const v4uf &b)
445 {
446  return v4uf(VM_MIN(a.vector, b.vector));
447 }
448 
449 static SYS_FORCE_INLINE v4uf
450 vmax(const v4uf &a, const v4uf &b)
451 {
452  return v4uf(VM_MAX(a.vector, b.vector));
453 }
454 
455 static SYS_FORCE_INLINE v4uf
456 clamp(const v4uf &a, const v4uf &b, const v4uf &c)
457 {
458  return vmax(vmin(a, c), b);
459 }
460 
461 static SYS_FORCE_INLINE v4uf
462 clamp(const v4uf &a, float b, float c)
463 {
464  return vmax(vmin(a, v4uf(c)), v4uf(b));
465 }
466 
467 // Returns an integer with the lower 4 bits set
468 // if the corresponding sign bit in a is set.
469 // Useful after comparisons as comparisons will
470 // be -1 or 0; so no need for an allbits test.
471 // 1 is a[0], 2 is a[1], and 8 is a[3].
472 static SYS_FORCE_INLINE int
473 signbits(const v4uu &a)
474 {
475  return vm_signbits(a.vector);
476 }
477 
478 static SYS_FORCE_INLINE int
479 signbits(const v4uf &a)
480 {
481  return vm_signbits(a.vector);
482 }
483 
484 static SYS_FORCE_INLINE bool
485 allbits(const v4uu &a)
486 {
487  return vm_allbits(a.vector);
488 }
489 
490 static SYS_FORCE_INLINE bool
491 anybits(const v4uu &a)
492 {
493  return !allbits(~a);
494 }
495 
496 static SYS_FORCE_INLINE v4uf
497 madd(const v4uf &v, const v4uf &f, const v4uf &a)
498 {
499  return v4uf(VM_MADD(v.vector, f.vector, a.vector));
500 }
501 
502 static SYS_FORCE_INLINE v4uf
503 madd(const v4uf &v, float f, float a)
504 {
505  return v4uf(VM_MADD(v.vector, v4uf(f).vector, v4uf(a).vector));
506 }
507 
508 static SYS_FORCE_INLINE v4uf
509 madd(const v4uf &v, float f, const v4uf &a)
510 {
511  return v4uf(VM_MADD(v.vector, v4uf(f).vector, a.vector));
512 }
513 
514 static SYS_FORCE_INLINE v4uf
515 msub(const v4uf &v, const v4uf &f, const v4uf &s)
516 {
517  return madd(v, f, -s);
518 }
519 
520 static SYS_FORCE_INLINE v4uf
521 msub(const v4uf &v, float f, float s)
522 {
523  return madd(v, f, -s);
524 }
525 
526 static SYS_FORCE_INLINE v4uf
527 lerp(const v4uf &a, const v4uf &b, const v4uf &w)
528 {
529  v4uf w1 = v4uf(1.0F) - w;
530  return madd(a, w1, b*w);
531 }
532 
533 static SYS_FORCE_INLINE v4uf
534 luminance(const v4uf &r, const v4uf &g, const v4uf &b,
535  float rw, float gw, float bw)
536 {
537  return v4uf(madd(r, v4uf(rw), madd(g, v4uf(gw), b * bw)));
538 }
539 
540 static SYS_FORCE_INLINE float
541 dot3(const v4uf &a, const v4uf &b)
542 {
543  v4uf res = a*b;
544  return res[0] + res[1] + res[2];
545 }
546 
547 static SYS_FORCE_INLINE float
548 dot4(const v4uf &a, const v4uf &b)
549 {
550  v4uf res = a*b;
551  return res[0] + res[1] + res[2] + res[3];
552 }
553 
554 static SYS_FORCE_INLINE float
555 length(const v4uf &a)
556 {
557  return SYSsqrt(dot3(a, a));
558 }
559 
560 static SYS_FORCE_INLINE v4uf
561 normalize(const v4uf &a)
562 {
563  return a / length(a);
564 }
565 
566 static SYS_FORCE_INLINE v4uf
567 cross(const v4uf &a, const v4uf &b)
568 {
569  return v4uf(a[1]*b[2] - a[2]*b[1],
570  a[2]*b[0] - a[0]*b[2],
571  a[0]*b[1] - a[1]*b[0], 0);
572 }
573 
574 // Convert 4 fpreal32 to 4 fpreal16's, returned as an int64
575 #if defined(AMD64) && (defined(__SSE4_1__) || defined(_MSC_VER))
576 #include <smmintrin.h> // SSE 4.1
577 static SYS_FORCE_INLINE int64
578 VMconvert4F32ToF16(v4si input)
579 {
580  // Separate sign bit and the rest
581  __m128i sign_mask = _mm_set1_epi32(0x80000000);
582  __m128i sign = _mm_and_si128(sign_mask, input);
583  __m128i positive = _mm_andnot_si128(sign_mask, input); // order matters here
584 
585  // Move the sign bit to its new location.
586  sign = _mm_srli_epi32(sign,16);
587 
588  // Clamp the value to avoid problems below.
589  __m128i min_value = _mm_set1_epi32((127-15)<<23);
590  __m128i max_value = _mm_set1_epi32((127+16)<<23);
591  positive = _mm_max_epi32(positive, min_value); // SSE4.1
592  positive = _mm_min_epi32(positive, max_value); // SSE4.1
593 
594  // Isolate the bit that's going to determine whether we round up or down.
595  __m128i bit0_mask = _mm_set1_epi32(1);
596  __m128i round_bit = _mm_srli_epi32(positive, (23-10-1));
597  round_bit = _mm_and_si128(round_bit, bit0_mask);
598 
599  // Isolate the exponent, change it from excess-127 to excess-15,
600  // then shift it into its new location.
601  __m128i exponent_diff = _mm_set1_epi32(127-15);
602  __m128i exponent = _mm_srli_epi32(positive, 23);
603  exponent = _mm_sub_epi32(exponent, exponent_diff);
604  exponent = _mm_slli_epi32(exponent, 10);
605 
606  // Isolate the mantissa bits that we'll be keeping.
607  __m128i ten_bits_mask = _mm_set1_epi32(0x3FF);
608  positive = _mm_srli_epi32(positive, 23-10);
609  positive = _mm_and_si128(positive, ten_bits_mask);
610 
611  // Combine the exponent, mantissa, and sign
612  __m128i f16s = _mm_or_si128(exponent, positive);
613  f16s = _mm_or_si128(f16s, sign);
614 
615  // Add the rounding bit
616  f16s = _mm_add_epi32(f16s, round_bit);
617 
618  // Pack the 4 low 16 bits for each 32-bit integer into
619  // first 4 16-bit integers, (and last 4 16-bit integers,
620  // but we don't care about those.)
621  f16s = _mm_packus_epi32(f16s,f16s); // SSE4.1
622 
623  // Just extract out the first 4 16-bit integers.
624  return _mm_cvtsi128_si64(f16s);
625 }
626 #else
627 static SYS_FORCE_INLINE int64
628 VMconvert4F32ToF16(v4si input)
629 {
630  int64 result;
631  const fpreal32 * src = reinterpret_cast<const fpreal32 *>(&input);
632  fpreal16 * dst = reinterpret_cast<fpreal16 *>(&result);
633 
634  for (int i = 0; i < 4; ++i)
635  dst[i] = fpreal16(src[i]);
636 
637  return result;
638 }
639 #endif
640 static SYS_FORCE_INLINE int64
641 VMconvert4F32ToF16(v4sf input)
642 {
643  return VMconvert4F32ToF16(V4SI(input));
644 }
645 
646 // SYS version of everything
647 
648 static SYS_FORCE_INLINE v4uu
649 SYSmin(const v4uu &a, const v4uu &b)
650 {
651  return ternary(a < b, a, b);
652 }
653 static SYS_FORCE_INLINE v4uu
654 SYSmax(const v4uu &a, const v4uu &b)
655 {
656  return ternary(a > b, a, b);
657 }
658 static SYS_FORCE_INLINE v4uu
659 SYSclamp(const v4uu &a, const v4uu &b, const v4uu &c)
660 {
661  return SYSmax(SYSmin(a, c), b);
662 }
663 static SYS_FORCE_INLINE v4uu
664 SYSclamp(const v4uu &a, int b, int c)
665 {
666  return SYSmax(SYSmin(a, v4uu(c)), v4uu(b));
667 }
668 
669 static SYS_FORCE_INLINE v4uf
670 SYSmin(const v4uf &a, const v4uf &b)
671 {
672  return v4uf(VM_MIN(a.vector, b.vector));
673 }
674 
675 static SYS_FORCE_INLINE v4uf
676 SYSmax(const v4uf &a, const v4uf &b)
677 {
678  return v4uf(VM_MAX(a.vector, b.vector));
679 }
680 
681 static SYS_FORCE_INLINE v4uf
682 SYSlerp(const v4uf &a, const v4uf &b, const v4uf &t)
683 {
684  v4uf diff = b-a;
685  return madd(diff, t, a);
686 }
687 
688 static SYS_FORCE_INLINE v4uf
689 SYSlerp(const v4uf &a, const v4uf &b, const float t)
690 {
691  v4uf diff = b-a;
692  return madd(diff, t, a);
693 }
694 static SYS_FORCE_INLINE v4uf
695 SYSclamp(const v4uf &a, const v4uf &b, const v4uf &c)
696 {
697  return vmax(vmin(a, c), b);
698 }
699 
700 static SYS_FORCE_INLINE v4uf
701 SYSclamp(const v4uf &a, float b, float c)
702 {
703  return vmax(vmin(a, v4uf(c)), v4uf(b));
704 }
705 
706 static SYS_FORCE_INLINE v4uf
707 sin(const v4uf &x)
708 {
709  return (v4uf)VM_SIN(x.vector);
710 }
711 
712 static SYS_FORCE_INLINE v4uf
713 cos(const v4uf &x)
714 {
715  return (v4uf)VM_COS(x.vector);
716 }
717 
718 static SYS_FORCE_INLINE v4uf
719 tan(const v4uf &x)
720 {
721  return (v4uf)VM_TAN(x.vector);
722 }
723 
724 static SYS_FORCE_INLINE void
725 sincos(const v4uf &x, v4uf *s, v4uf *c)
726 {
727  VM_SINCOS(x.vector, &(s->vector), &(c->vector));
728 }
729 
730 static SYS_FORCE_INLINE v4uu
731 SYSfastFloor(const v4uf &a)
732 {
733  // The following are two versions of floor.
734  //
735  // 1.
736  // This floor is a bit problematic around 0. For example if x is a
737  // very small (in magnitude) denormal number, then floor(x) = -1
738  // and x - floor(x) = 1, which could be unexpected.
739  return ternary(a < v4uf(0.f), a.toSignedInt() - 1, a.toSignedInt());
740  //
741  // 2.
742  //
743  // This version is broken on some platforms. On thoth,
744  // SYSfastFloor(v4uf(-0.716626)) == v4ui(0)
745  //
746  //return a.floor();
747 
748 }
749 static SYS_FORCE_INLINE v4uu
750 SYSfloor(const v4uf &a)
751 {
752  return a.floor();
753 }
754 
755 // Currently there is no specific support for signed integers
756 typedef v4uu v4ui;
757 
758 // Assuming that ptr is an array of elements of type STYPE, this operation
759 // will return the index of the first element that is aligned to (1<<ASIZE)
760 // bytes.
761 #define VM_ALIGN(ptr, ASIZE, STYPE) \
762  ((((1<<ASIZE)-(intptr_t)ptr)&((1<<ASIZE)-1))/sizeof(STYPE))
763 
764 #endif
GLdouble s
Definition: glew.h:1390
SYS_FORCE_INLINE v4uf operator/(float r) const
Definition: VM_SIMD.h:265
SYS_FORCE_INLINE v4uu operator=(const v4uu &v)
Definition: VM_SIMD.h:62
#define SYSmax(a, b)
Definition: SYS_Math.h:1521
SYS_FORCE_INLINE v4uf operator+=(float r)
Definition: VM_SIMD.h:266
Mat3< typename promote< S, T >::type > operator*(S scalar, const Mat3< T > &m)
Multiply each element of the given matrix by scalar and return the result.
Definition: Mat3.h:582
#define VM_IADD
Definition: VM_BasicFunc.h:403
SYS_API double cos(double x)
Definition: SYS_FPUMath.h:69
GLenum GLenum GLenum input
Definition: glew.h:13879
SYS_FORCE_INLINE v4uf operator&&(const v4uf &r) const
Definition: VM_SIMD.h:284
v4uu v4ui
Definition: VM_SIMD.h:756
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
#define VM_IMUL
Definition: VM_BasicFunc.h:405
SYS_FORCE_INLINE v4uu operator>=(const v4uu &v) const
Definition: VM_SIMD.h:93
SYS_FORCE_INLINE v4uu operator=(v4si v)
Definition: VM_SIMD.h:78
#define VM_STORE
Definition: VM_BasicFunc.h:390
#define VM_SIN
Definition: VM_BasicFunc.h:441
SYS_FORCE_INLINE v4uf operator^(const v4uu &r) const
Definition: VM_SIMD.h:277
SYS_FORCE_INLINE v4uf(const v4uf &v) noexcept
Definition: VM_SIMD.h:200
#define SYS_STATIC_ASSERT_MSG(expr, msg)
SYS_FORCE_INLINE v4uu operator||(const v4uu &r) const
Definition: VM_SIMD.h:157
SYS_FORCE_INLINE v4uf operator-() const
Definition: VM_SIMD.h:250
#define VM_DIV
Definition: VM_BasicFunc.h:410
#define VM_SHIFTRIGHT(A, C)
Definition: VM_BasicFunc.h:448
SYS_FORCE_INLINE v4uu operator&&(const v4uu &r) const
Definition: VM_SIMD.h:159
GLuint const GLfloat * val
Definition: glew.h:2794
Mat3< typename promote< T0, T1 >::type > operator+(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Add corresponding elements of m0 and m1 and return the result.
Definition: Mat3.h:598
SYS_FORCE_INLINE v4uu operator-(const v4uu &r) const
Definition: VM_SIMD.h:112
SYS_FORCE_INLINE v4uu operator*(int32 r) const
Definition: VM_SIMD.h:131
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
virtual bool lerp(GA_AttributeOperand &d, GA_AttributeOperand &a, GA_AttributeOperand &b, GA_AttributeOperand &t) const
d = SYSlerp(a, b, t);
SYS_FORCE_INLINE v4uu toUnsignedInt() const
This is a lie, it is a signed int.
Definition: VM_SIMD.h:312
vfloat4 sqrt(const vfloat4 &a)
Definition: simd.h:7231
SYS_FORCE_INLINE v4uu(const int32 v[4])
Definition: VM_SIMD.h:66
SYS_FORCE_INLINE v4uu operator%=(const v4uu &r)
Definition: VM_SIMD.h:151
SYS_FORCE_INLINE v4uf operator=(v4sf v) noexcept
Definition: VM_SIMD.h:217
#define VM_CMPEQ
Definition: VM_BasicFunc.h:396
OIIO_HOSTDEVICE void sincos(float x, float *sine, float *cosine)
Definition: fmath.h:534
SYS_FORCE_INLINE v4uu operator*=(int32 r)
Definition: VM_SIMD.h:134
SYS_FORCE_INLINE v4uu operator+(const v4uu &r) const
Definition: VM_SIMD.h:110
#define VM_INSERT
Definition: VM_BasicFunc.h:387
SYS_FORCE_INLINE v4uf operator=(float v)
Definition: VM_SIMD.h:215
SYS_FORCE_INLINE v4uu operator==(const v4uu &v) const
Definition: VM_SIMD.h:85
SYS_FORCE_INLINE v4uu operator<(const v4uu &v) const
Definition: VM_SIMD.h:91
SYS_FORCE_INLINE v4uu(int32 v)
Definition: VM_SIMD.h:65
#define VM_ICMPGT
Definition: VM_BasicFunc.h:400
#define VM_FLOOR
Definition: VM_BasicFunc.h:434
SYS_FORCE_INLINE v4uu operator%(const v4uu &r) const
Definition: VM_SIMD.h:137
SYS_FORCE_INLINE void operator|=(const v4uu &r)
Definition: VM_SIMD.h:170
const GLdouble * v
Definition: glew.h:1391
SYS_FORCE_INLINE void condAssign(const v4uu &val, const v4uu &c)
Definition: VM_SIMD.h:81
GLenum GLint GLuint mask
Definition: glew.h:1845
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
Definition: UT_Matrix2.h:604
#define VM_ICMPEQ
Definition: VM_BasicFunc.h:401
#define VM_AND
Definition: VM_BasicFunc.h:424
SYS_FORCE_INLINE v4uu operator!() const
Definition: VM_SIMD.h:163
#define VM_MAX
Definition: VM_BasicFunc.h:422
float fpreal32
Definition: SYS_Types.h:200
SYS_FORCE_INLINE v4uf operator-(float r) const
Definition: VM_SIMD.h:263
SYS_FORCE_INLINE v4uu operator+=(int32 r)
Definition: VM_SIMD.h:132
#define VM_MIN
Definition: VM_BasicFunc.h:421
float dot3(const vfloat4 &a, const vfloat4 &b)
Return the float 3-component dot (inner) product of a and b.
Definition: simd.h:7067
SYS_FORCE_INLINE v4uf abs() const
Definition: VM_SIMD.h:302
OIIO_HOSTDEVICE float madd(float a, float b, float c)
Fused multiply and add: (a*b + c)
Definition: fmath.h:267
v4uu floor() const
Definition: VM_SIMD.h:315
SYS_FORCE_INLINE v4uf operator|(const v4uf &r) const
Definition: VM_SIMD.h:294
#define VM_EXTRACT
Definition: VM_BasicFunc.h:386
OIIO_HOSTDEVICE float msub(float a, float b, float c)
Fused multiply and subtract: -(a*b - c)
Definition: fmath.h:281
SYS_FORCE_INLINE v4uf operator*=(float r)
Definition: VM_SIMD.h:268
SYS_FORCE_INLINE void store(float v[4]) const
Definition: VM_SIMD.h:211
#define VM_CMPNE
Definition: VM_BasicFunc.h:397
#define VM_XOR
Definition: VM_BasicFunc.h:427
SYS_FORCE_INLINE v4uf operator/(const v4uf &r) const
Definition: VM_SIMD.h:254
SYS_FORCE_INLINE v4uf(float a, float b, float c, float d)
Definition: VM_SIMD.h:207
GLclampf f
Definition: glew.h:3499
GLint GLint GLint GLint GLint x
Definition: glew.h:1252
GLenum clamp
Definition: glew.h:2166
SYS_FORCE_INLINE v4uf recip() const
Definition: VM_SIMD.h:309
SYS_FORCE_INLINE v4uu operator&(const v4uu &r) const
Definition: VM_SIMD.h:167
Mat3< typename promote< T0, T1 >::type > operator-(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Subtract corresponding elements of m0 and m1 and return the result.
Definition: Mat3.h:608
SYS_FORCE_INLINE v4uu operator+=(const v4uu &r)
Definition: VM_SIMD.h:126
SYS_FORCE_INLINE v4uu operator^(const v4uu &r) const
Definition: VM_SIMD.h:161
SYS_FORCE_INLINE v4uu operator=(int32 v)
Definition: VM_SIMD.h:76
#define VM_ADD
Definition: VM_BasicFunc.h:407
SYS_FORCE_INLINE v4uf() noexcept=default
SYS_FORCE_INLINE v4uu(const v4si &v)
Definition: VM_SIMD.h:60
Definition: VM_SIMD.h:46
SYS_FORCE_INLINE v4uu toSignedInt() const
Definition: VM_SIMD.h:313
SYS_FORCE_INLINE v4uf operator&(const v4uf &r) const
Definition: VM_SIMD.h:295
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
SYS_FORCE_INLINE v4uu operator<=(const v4uf &v) const
Definition: VM_SIMD.h:234
SYS_FORCE_INLINE v4uf operator=(const v4uf &v) noexcept
Definition: VM_SIMD.h:201
SYS_FORCE_INLINE v4uf operator!() const
Definition: VM_SIMD.h:279
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
Definition: UT_Vector3.h:836
SYS_FORCE_INLINE v4uf operator||(const v4uf &r) const
Definition: VM_SIMD.h:282
Definition: VM_SIMD.h:186
#define VM_INT
Definition: VM_BasicFunc.h:437
SYS_FORCE_INLINE v4uu operator>(const v4uf &v) const
Definition: VM_SIMD.h:228
const GLfloat * c
Definition: glew.h:16296
GLuint GLsizei GLsizei * length
Definition: glew.h:1825
GLenum GLenum dst
Definition: glew.h:2410
SYS_FORCE_INLINE void setComp(int idx, float v)
Definition: VM_SIMD.h:299
SYS_FORCE_INLINE void store(int32 v[4]) const
Definition: VM_SIMD.h:72
SYS_FORCE_INLINE v4uf(const float v[4])
Definition: VM_SIMD.h:205
SYS_FORCE_INLINE v4uf clamp(float low, float high) const
Definition: VM_SIMD.h:306
#define VM_NEG
Definition: VM_BasicFunc.h:412
SYS_FORCE_INLINE v4uu operator==(const v4uf &v) const
Definition: VM_SIMD.h:224
long long int64
Definition: SYS_Types.h:116
SYS_FORCE_INLINE v4uu operator*(const v4uu &r) const
Definition: VM_SIMD.h:115
SYS_FORCE_INLINE v4uu operator%(int r) const
Definition: VM_SIMD.h:144
Quat< T > operator/(const Quat< T > &q1, const Quat< T > &q2)
Definition: ImathQuat.h:887
SYS_FORCE_INLINE v4uu operator-=(int32 r)
Definition: VM_SIMD.h:133
SYS_API fpreal32 SYSfloor(fpreal32 val)
#define VM_SUB
Definition: VM_BasicFunc.h:408
SYS_FORCE_INLINE v4uf operator^(const v4uf &r) const
Definition: VM_SIMD.h:286
SYS_FORCE_INLINE v4uu operator-(int32 r) const
Definition: VM_SIMD.h:130
SYS_FORCE_INLINE float operator[](int idx) const
Definition: VM_SIMD.h:298
int sign(T a)
Definition: ImathFun.h:63
SYS_FORCE_INLINE void operator^=(const v4uu &r)
Definition: VM_SIMD.h:172
SYS_FORCE_INLINE v4uu()
Definition: VM_SIMD.h:59
SYS_FORCE_INLINE void condAssign(const v4uf &val, const v4uu &c)
Definition: VM_SIMD.h:220
GridType::Ptr normalize(const GridType &grid, bool threaded, InterruptT *interrupt)
Normalize the vectors of the given vector-valued grid.
SYS_FORCE_INLINE v4uu operator<(const v4uf &v) const
Definition: VM_SIMD.h:230
SYS_FORCE_INLINE v4uu operator!=(const v4uu &v) const
Definition: VM_SIMD.h:87
#define VM_ANDNOT
Definition: VM_BasicFunc.h:425
SYS_FORCE_INLINE v4uf operator*(float r) const
Definition: VM_SIMD.h:264
SYS_FORCE_INLINE v4uu operator>=(const v4uf &v) const
Definition: VM_SIMD.h:232
SYS_FORCE_INLINE v4uu operator|(const v4uu &r) const
Definition: VM_SIMD.h:166
#define VM_CMPLE
Definition: VM_BasicFunc.h:393
SYS_FORCE_INLINE v4uf operator*(const v4uf &r) const
Definition: VM_SIMD.h:252
SYS_FORCE_INLINE v4uf operator-(const v4uf &r) const
Definition: VM_SIMD.h:248
SYS_FORCE_INLINE void setComp(int idx, int32 v)
Definition: VM_SIMD.h:176
#define VM_CMPGT
Definition: VM_BasicFunc.h:394
SYS_FORCE_INLINE v4uf operator&(const v4uu &r) const
Definition: VM_SIMD.h:290
#define VM_SHIFTLEFT(A, C)
Definition: VM_BasicFunc.h:447
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
SYS_API double tan(double x)
Definition: SYS_FPUMath.h:75
SYS_FORCE_INLINE v4uu operator%=(int r)
Definition: VM_SIMD.h:152
SYS_FORCE_INLINE v4uu operator-=(const v4uu &r)
Definition: VM_SIMD.h:127
SYS_FORCE_INLINE v4uu operator<=(const v4uu &v) const
Definition: VM_SIMD.h:95
SYS_FORCE_INLINE v4uu operator>(const v4uu &v) const
Definition: VM_SIMD.h:89
#define VM_ABS
Definition: VM_BasicFunc.h:416
SYS_FORCE_INLINE v4uf operator&&(const v4uu &r) const
Definition: VM_SIMD.h:275
v4si vector
Definition: VM_SIMD.h:183
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
v4uu splitFloat()
Definition: VM_SIMD.h:325
SYS_FORCE_INLINE v4uf clamp(const v4uf &low, const v4uf &high) const
Definition: VM_SIMD.h:303
#define VM_SINCOS
Definition: VM_BasicFunc.h:444
#define VM_MUL
Definition: VM_BasicFunc.h:409
SYS_FORCE_INLINE v4uu(int32 a, int32 b, int32 c, int32 d)
Definition: VM_SIMD.h:68
#define VM_INVERT
Definition: VM_BasicFunc.h:419
#define VM_P_FLOOR()
Definition: VM_BasicFunc.h:433
SYS_FORCE_INLINE v4uf swizzle() const
Definition: VM_SIMD.h:333
GLuint64EXT * result
Definition: glew.h:14007
#define VM_E_FLOOR()
Definition: VM_BasicFunc.h:435
SYS_FORCE_INLINE v4uu operator<<(int32 c) const
Definition: VM_SIMD.h:106
SYS_FORCE_INLINE int32 operator[](int idx) const
Definition: VM_SIMD.h:175
SYS_FORCE_INLINE v4uu operator+(int32 r) const
Definition: VM_SIMD.h:129
SYS_FORCE_INLINE v4uf operator/=(float r)
Definition: VM_SIMD.h:269
SYS_FORCE_INLINE v4uf(float v)
Definition: VM_SIMD.h:204
SYS_FORCE_INLINE v4uu operator!=(const v4uf &v) const
Definition: VM_SIMD.h:226
#define V4SF(A)
Definition: VM_BasicFunc.h:68
SYS_FORCE_INLINE v4uf operator-=(const v4uf &r)
Definition: VM_SIMD.h:258
SYS_FORCE_INLINE v4uf operator~() const
Definition: VM_SIMD.h:291
#define VM_ISUB
Definition: VM_BasicFunc.h:404
#define VM_LOAD
Definition: VM_BasicFunc.h:389
#define VM_COS
Definition: VM_BasicFunc.h:442
#define VM_SPLATS
Definition: VM_BasicFunc.h:388
SYS_FORCE_INLINE void operator&=(const v4uu &r)
Definition: VM_SIMD.h:171
SYS_FORCE_INLINE v4uf operator||(const v4uu &r) const
Definition: VM_SIMD.h:273
SYS_FORCE_INLINE v4uf operator+(float r) const
Definition: VM_SIMD.h:262
#define VM_MADD
Definition: VM_BasicFunc.h:418
#define VM_OR
Definition: VM_BasicFunc.h:426
SYS_FORCE_INLINE v4uf operator*=(const v4uf &r)
Definition: VM_SIMD.h:259
SYS_FORCE_INLINE v4uf operator+=(const v4uf &r)
Definition: VM_SIMD.h:257
SYS_FORCE_INLINE v4uu operator>>(int32 c) const
Definition: VM_SIMD.h:107
#define SYSmin(a, b)
Definition: SYS_Math.h:1522
#define V4SI(A)
Definition: VM_BasicFunc.h:69
SYS_FORCE_INLINE v4uf operator/=(const v4uf &r)
Definition: VM_SIMD.h:260
#define VM_SQRT
Definition: VM_BasicFunc.h:413
SYS_FORCE_INLINE v4uf operator-=(float r)
Definition: VM_SIMD.h:267
SYS_FORCE_INLINE v4uu(const v4uu &v)
Definition: VM_SIMD.h:61
#define VM_TAN
Definition: VM_BasicFunc.h:443
SYS_FORCE_INLINE v4uf operator+(const v4uf &r) const
Definition: VM_SIMD.h:246
SYS_FORCE_INLINE v4uu operator~() const
Definition: VM_SIMD.h:168
SIM_DerVector3 cross(const SIM_DerVector3 &lhs, const SIM_DerVector3 &rhs)
GLdouble GLdouble t
Definition: glew.h:1398
SYS_FORCE_INLINE v4uf(const v4sf &v) noexcept
Definition: VM_SIMD.h:199
#define VM_IFLOAT
Definition: VM_BasicFunc.h:439
SYS_API double sin(double x)
Definition: SYS_FPUMath.h:71
#define VM_CMPLT
Definition: VM_BasicFunc.h:392
v4sf vector
Definition: VM_SIMD.h:346
v4uf toFloat() const
Definition: VM_SIMD.h:350
SYS_FORCE_INLINE v4uu isFinite() const
Definition: VM_SIMD.h:338
#define VM_CMPGE
Definition: VM_BasicFunc.h:395
#define VM_ICMPLT
Definition: VM_BasicFunc.h:399
GLuint res
Definition: glew.h:11507
GLboolean GLboolean g
Definition: glew.h:9477
SYS_FORCE_INLINE v4uf operator|(const v4uu &r) const
Definition: VM_SIMD.h:289
SYS_FORCE_INLINE v4uu operator*=(const v4uu &r)
Definition: VM_SIMD.h:128