simd_vec4.hpp
Go to the documentation of this file.
1 
38 #pragma once
39 
40 // Dependency:
41 #include "../glm.hpp"
42 
43 #if(GLM_ARCH != GLM_ARCH_PURE)
44 
45 #if(GLM_ARCH & GLM_ARCH_SSE2)
46 # include "../detail/intrinsic_common.hpp"
47 # include "../detail/intrinsic_geometric.hpp"
48 # include "../detail/intrinsic_integer.hpp"
49 #else
50 # error "GLM: GLM_GTX_simd_vec4 requires compiler support of SSE2 through intrinsics"
51 #endif
52 
53 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
54 # pragma message("GLM: GLM_GTX_simd_vec4 extension included")
55 #endif
56 
57 
58 // Warning silencer for nameless struct/union.
59 #if (GLM_COMPILER & GLM_COMPILER_VC)
60 # pragma warning(push)
61 # pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union
62 #endif
63 
64 namespace glm
65 {
66  enum comp
67  {
68  X = 0,
69  R = 0,
70  S = 0,
71  Y = 1,
72  G = 1,
73  T = 1,
74  Z = 2,
75  B = 2,
76  P = 2,
77  W = 3,
78  A = 3,
79  Q = 3
80  };
81 
82 }//namespace glm
83 
84 namespace glm{
85 namespace detail
86 {
89  GLM_ALIGNED_STRUCT(16) fvec4SIMD
90  {
91  enum ctor{null};
92  typedef __m128 value_type;
93  typedef std::size_t size_type;
94  static size_type value_size();
95 
96  typedef fvec4SIMD type;
97  typedef tvec4<bool, highp> bool_type;
98 
99 #ifdef GLM_SIMD_ENABLE_XYZW_UNION
100  union
101  {
102  __m128 Data;
103  struct {float x, y, z, w;};
104  };
105 #else
106  __m128 Data;
107 #endif
108 
110  // Implicit basic constructors
111 
112  fvec4SIMD();
113  fvec4SIMD(__m128 const & Data);
114  fvec4SIMD(fvec4SIMD const & v);
115 
117  // Explicit basic constructors
118 
119  explicit fvec4SIMD(
120  ctor);
121  explicit fvec4SIMD(
122  float const & s);
123  explicit fvec4SIMD(
124  float const & x,
125  float const & y,
126  float const & z,
127  float const & w);
128  explicit fvec4SIMD(
129  vec4 const & v);
130 
133 
134  fvec4SIMD(vec2 const & v, float const & s1, float const & s2);
135  fvec4SIMD(float const & s1, vec2 const & v, float const & s2);
136  fvec4SIMD(float const & s1, float const & s2, vec2 const & v);
137  fvec4SIMD(vec3 const & v, float const & s);
138  fvec4SIMD(float const & s, vec3 const & v);
139  fvec4SIMD(vec2 const & v1, vec2 const & v2);
140  //fvec4SIMD(ivec4SIMD const & v);
141 
143  // Unary arithmetic operators
144 
145  fvec4SIMD& operator= (fvec4SIMD const & v);
146  fvec4SIMD& operator+=(fvec4SIMD const & v);
147  fvec4SIMD& operator-=(fvec4SIMD const & v);
148  fvec4SIMD& operator*=(fvec4SIMD const & v);
149  fvec4SIMD& operator/=(fvec4SIMD const & v);
150 
151  fvec4SIMD& operator+=(float const & s);
152  fvec4SIMD& operator-=(float const & s);
153  fvec4SIMD& operator*=(float const & s);
154  fvec4SIMD& operator/=(float const & s);
155 
156  fvec4SIMD& operator++();
157  fvec4SIMD& operator--();
158 
160  // Swizzle operators
161 
162  template <comp X, comp Y, comp Z, comp W>
163  fvec4SIMD& swizzle();
164  template <comp X, comp Y, comp Z, comp W>
165  fvec4SIMD swizzle() const;
166  template <comp X, comp Y, comp Z>
167  fvec4SIMD swizzle() const;
168  template <comp X, comp Y>
169  fvec4SIMD swizzle() const;
170  template <comp X>
171  fvec4SIMD swizzle() const;
172  };
173 }//namespace detail
174 
175  typedef glm::detail::fvec4SIMD simdVec4;
176 
179 
182  vec4 vec4_cast(
183  detail::fvec4SIMD const & x);
184 
187  detail::fvec4SIMD abs(detail::fvec4SIMD const & x);
188 
191  detail::fvec4SIMD sign(detail::fvec4SIMD const & x);
192 
195  detail::fvec4SIMD floor(detail::fvec4SIMD const & x);
196 
200  detail::fvec4SIMD trunc(detail::fvec4SIMD const & x);
201 
209  detail::fvec4SIMD round(detail::fvec4SIMD const & x);
210 
216  //detail::fvec4SIMD roundEven(detail::fvec4SIMD const & x);
217 
221  detail::fvec4SIMD ceil(detail::fvec4SIMD const & x);
222 
226  detail::fvec4SIMD fract(detail::fvec4SIMD const & x);
227 
232  detail::fvec4SIMD mod(
233  detail::fvec4SIMD const & x,
234  detail::fvec4SIMD const & y);
235 
240  detail::fvec4SIMD mod(
241  detail::fvec4SIMD const & x,
242  float const & y);
243 
249  //detail::fvec4SIMD modf(
250  // detail::fvec4SIMD const & x,
251  // detail::fvec4SIMD & i);
252 
256  detail::fvec4SIMD min(
257  detail::fvec4SIMD const & x,
258  detail::fvec4SIMD const & y);
259 
260  detail::fvec4SIMD min(
261  detail::fvec4SIMD const & x,
262  float const & y);
263 
267  detail::fvec4SIMD max(
268  detail::fvec4SIMD const & x,
269  detail::fvec4SIMD const & y);
270 
271  detail::fvec4SIMD max(
272  detail::fvec4SIMD const & x,
273  float const & y);
274 
279  detail::fvec4SIMD clamp(
280  detail::fvec4SIMD const & x,
281  detail::fvec4SIMD const & minVal,
282  detail::fvec4SIMD const & maxVal);
283 
284  detail::fvec4SIMD clamp(
285  detail::fvec4SIMD const & x,
286  float const & minVal,
287  float const & maxVal);
288 
315  detail::fvec4SIMD mix(
316  detail::fvec4SIMD const & x,
317  detail::fvec4SIMD const & y,
318  detail::fvec4SIMD const & a);
319 
323  detail::fvec4SIMD step(
324  detail::fvec4SIMD const & edge,
325  detail::fvec4SIMD const & x);
326 
327  detail::fvec4SIMD step(
328  float const & edge,
329  detail::fvec4SIMD const & x);
330 
342  detail::fvec4SIMD smoothstep(
343  detail::fvec4SIMD const & edge0,
344  detail::fvec4SIMD const & edge1,
345  detail::fvec4SIMD const & x);
346 
347  detail::fvec4SIMD smoothstep(
348  float const & edge0,
349  float const & edge1,
350  detail::fvec4SIMD const & x);
351 
359  //bvec4 isnan(detail::fvec4SIMD const & x);
360 
368  //bvec4 isinf(detail::fvec4SIMD const & x);
369 
375  //detail::ivec4SIMD floatBitsToInt(detail::fvec4SIMD const & value);
376 
384  //detail::fvec4SIMD intBitsToFloat(detail::ivec4SIMD const & value);
385 
389  detail::fvec4SIMD fma(
390  detail::fvec4SIMD const & a,
391  detail::fvec4SIMD const & b,
392  detail::fvec4SIMD const & c);
393 
404  //detail::fvec4SIMD frexp(detail::fvec4SIMD const & x, detail::ivec4SIMD & exp);
405 
413  //detail::fvec4SIMD ldexp(detail::fvec4SIMD const & x, detail::ivec4SIMD const & exp);
414 
418  float length(
419  detail::fvec4SIMD const & x);
420 
425  float fastLength(
426  detail::fvec4SIMD const & x);
427 
432  float niceLength(
433  detail::fvec4SIMD const & x);
434 
438  detail::fvec4SIMD length4(
439  detail::fvec4SIMD const & x);
440 
445  detail::fvec4SIMD fastLength4(
446  detail::fvec4SIMD const & x);
447 
452  detail::fvec4SIMD niceLength4(
453  detail::fvec4SIMD const & x);
454 
458  float distance(
459  detail::fvec4SIMD const & p0,
460  detail::fvec4SIMD const & p1);
461 
465  detail::fvec4SIMD distance4(
466  detail::fvec4SIMD const & p0,
467  detail::fvec4SIMD const & p1);
468 
472  float simdDot(
473  detail::fvec4SIMD const & x,
474  detail::fvec4SIMD const & y);
475 
479  detail::fvec4SIMD dot4(
480  detail::fvec4SIMD const & x,
481  detail::fvec4SIMD const & y);
482 
486  detail::fvec4SIMD cross(
487  detail::fvec4SIMD const & x,
488  detail::fvec4SIMD const & y);
489 
493  detail::fvec4SIMD normalize(
494  detail::fvec4SIMD const & x);
495 
500  detail::fvec4SIMD fastNormalize(
501  detail::fvec4SIMD const & x);
502 
506  detail::fvec4SIMD simdFaceforward(
507  detail::fvec4SIMD const & N,
508  detail::fvec4SIMD const & I,
509  detail::fvec4SIMD const & Nref);
510 
515  detail::fvec4SIMD reflect(
516  detail::fvec4SIMD const & I,
517  detail::fvec4SIMD const & N);
518 
524  detail::fvec4SIMD refract(
525  detail::fvec4SIMD const & I,
526  detail::fvec4SIMD const & N,
527  float const & eta);
528 
532  detail::fvec4SIMD sqrt(
533  detail::fvec4SIMD const & x);
534 
539  detail::fvec4SIMD niceSqrt(
540  detail::fvec4SIMD const & x);
541 
546  detail::fvec4SIMD fastSqrt(
547  detail::fvec4SIMD const & x);
548 
552  detail::fvec4SIMD inversesqrt(
553  detail::fvec4SIMD const & x);
554 
559  detail::fvec4SIMD fastInversesqrt(
560  detail::fvec4SIMD const & x);
561 
563 }//namespace glm
564 
565 #include "simd_vec4.inl"
566 
567 #if (GLM_COMPILER & GLM_COMPILER_VC)
568 # pragma warning(pop)
569 #endif
570 
571 #endif//(GLM_ARCH != GLM_ARCH_PURE)
w
RowVector3d w
glm::min
GLM_FUNC_DECL genType min(genType const &x, genType const &y)
glm::vec2
highp_vec2 vec2
Definition: type_vec.hpp:387
glm::fastSqrt
GLM_FUNC_DECL genType fastSqrt(genType const &x)
glm::length
GLM_FUNC_DECL genType::value_type length(genType const &x)
Y
const char Y
glm::sign
GLM_FUNC_DECL genType sign(genType const &x)
B
type
Z
const char Z
detail
glm::vec3
highp_vec3 vec3
Definition: type_vec.hpp:392
y
Matrix3f y
operator*=
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 & operator*=(bfloat16 &a, const bfloat16 &b)
glm::normalize
GLM_FUNC_DECL genType normalize(genType const &x)
glm::reflect
GLM_FUNC_DECL genType reflect(genType const &I, genType const &N)
GLM_ALIGNED_STRUCT
#define GLM_ALIGNED_STRUCT(x)
Definition: setup.hpp:793
glm::distance
GLM_FUNC_DECL genType::value_type distance(genType const &p0, genType const &p1)
glm::floor
GLM_FUNC_DECL genType floor(genType const &x)
glm::round
GLM_FUNC_DECL genType round(genType const &x)
glm::refract
GLM_FUNC_DECL vecType< T, P > refract(vecType< T, P > const &I, vecType< T, P > const &N, T const &eta)
X
const char X
glm::smoothstep
GLM_FUNC_DECL genType smoothstep(genType const &edge0, genType const &edge1, genType const &x)
A
glm::sqrt
GLM_FUNC_DECL vecType< T, P > sqrt(vecType< T, P > const &x)
glm::fastLength
GLM_FUNC_DECL genType::value_type fastLength(genType const &x)
glm::ceil
GLM_FUNC_DECL genType ceil(genType const &x)
glm::max
GLM_FUNC_DECL genType max(genType const &x, genType const &y)
glm::vec4
highp_vec4 vec4
Definition: type_vec.hpp:397
glm
Definition: _literals.hpp:31
operator-=
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 & operator-=(bfloat16 &a, const bfloat16 &b)
glm::mix
GLM_FUNC_DECL vecType< T, P > mix(vecType< T, P > const &x, vecType< T, P > const &y, vecType< U, P > const &a)
z
z
x
x
Eigen::Triplet
glm::step
GLM_FUNC_DECL genType step(genType const &edge, genType const &x)
glm::cross
GLM_FUNC_DECL detail::tvec3< T, P > cross(detail::tvec3< T, P > const &x, detail::tvec3< T, P > const &y)
operator++
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator++(bfloat16 &a)
glm::fract
GLM_FUNC_DECL genType fract(genType const &x)
Eigen::Quaternion
glm::fma
GLM_FUNC_DECL genType fma(genType const &a, genType const &b, genType const &c)
glm::clamp
GLM_FUNC_DECL genType clamp(genType const &x, genType const &minVal, genType const &maxVal)
W
Key W(std::uint64_t j)
operator--
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator--(bfloat16 &a)
PointMatcherSupport::Parametrizable
glm::trunc
GLM_FUNC_DECL genType trunc(genType const &x)
glm::abs
GLM_FUNC_DECL genType abs(genType const &x)
G
JacobiRotation< float > G
glm::inversesqrt
GLM_FUNC_DECL genType inversesqrt(genType const &x)
glm::fastNormalize
GLM_FUNC_DECL genType fastNormalize(genType const &x)
operator/=
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 & operator/=(bfloat16 &a, const bfloat16 &b)
glm::mod
GLM_FUNC_DECL genType mod(genType const &x, genType const &y)
operator+=
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 & operator+=(bfloat16 &a, const bfloat16 &b)
S
S
R
R


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:16