PandaRoot
F32vec4 Class Reference

#include <P4_F32vec4.h>

Public Member Functions

float & operator[] (int i)
 
float operator[] (int i) const
 
 F32vec4 ()
 
 F32vec4 (const __m128 &a)
 
 F32vec4 (const float &a)
 
 F32vec4 (const float &f0, const float &f1, const float &f2, const float &f3)
 
 operator __m128 () const
 
 vec_arithmetic (F32vec4, float)
 
float & operator[] (int i)
 
float operator[] (int i) const
 
 F32vec4 ()
 
 F32vec4 (const F32vec4 &a)
 
 F32vec4 (const float &a)
 
 F32vec4 (const float &f0, const float &f1, const float &f2, const float &f3)
 
 vec_arithmetic (F32vec4, float)
 

Public Attributes

__m128 v
 
float v [4]
 

Friends

F32vec4 operator+ (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator- (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator* (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator/ (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 min (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 max (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 sqrt (const F32vec4 &a)
 
F32vec4 rsqrt (const F32vec4 &a)
 
F32vec4 rcp (const F32vec4 &a)
 
F32vec4 fabs (const F32vec4 &a)
 
F32vec4 sgn (const F32vec4 &a)
 
F32vec4 asgnb (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator & (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator| (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator^ (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator! (const F32vec4 &a)
 
F32vec4 operator< (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator<= (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator> (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator>= (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator== (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 bool2int (const F32vec4 &a)
 
F32vec4 exp (const F32vec4 &a)
 
F32vec4 log (const F32vec4 &a)
 
F32vec4 sin (const F32vec4 &a)
 
F32vec4 cos (const F32vec4 &a)
 
F32vec4 acos (const F32vec4 &a)
 
F32vec4 atan2 (const F32vec4 &y, const F32vec4 &x)
 
std::ostream & operator<< (std::ostream &strm, const F32vec4 &a)
 
std::istream & operator>> (std::istream &strm, F32vec4 &a)
 
F32vec4 operator+ (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator- (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator* (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator/ (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator< (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator<= (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator> (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator>= (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator & (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator| (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator|| (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 operator! (const F32vec4 &a)
 
F32vec4 if3 (const F32vec4 &a, const F32vec4 &b, const F32vec4 &c)
 
F32vec4 bool2int (const F32vec4 &a)
 
float min (float x, float y)
 
float max (float x, float y)
 
float asgnb (float x, float y)
 
float rsqrt (float x)
 
float rcp (float x)
 
float sgn (float x)
 
F32vec4 min (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 max (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 asgnb (const F32vec4 &a, const F32vec4 &b)
 
F32vec4 sqrt (const F32vec4 &a)
 
F32vec4 rsqrt (const F32vec4 &a)
 
F32vec4 rcp (const F32vec4 &a)
 
F32vec4 fabs (const F32vec4 &a)
 
F32vec4 sgn (const F32vec4 &a)
 
F32vec4 exp (const F32vec4 &a)
 
F32vec4 log (const F32vec4 &a)
 
F32vec4 sin (const F32vec4 &a)
 
F32vec4 cos (const F32vec4 &a)
 
ostream & operator<< (ostream &strm, const F32vec4 &a)
 
istream & operator>> (istream &strm, F32vec4 &a)
 

Detailed Description

Definition at line 50 of file P4_F32vec4.h.

Constructor & Destructor Documentation

◆ F32vec4() [1/8]

F32vec4::F32vec4 ( )
inline

Definition at line 57 of file P4_F32vec4.h.

57 : v(_mm_set_ps1(0)) {}
__m128 v
Definition: P4_F32vec4.h:52

◆ F32vec4() [2/8]

F32vec4::F32vec4 ( const __m128 &  a)
inline

Definition at line 58 of file P4_F32vec4.h.

58 : v(a) {}
__m128 v
Definition: P4_F32vec4.h:52

◆ F32vec4() [3/8]

F32vec4::F32vec4 ( const float &  a)
inline

Definition at line 59 of file P4_F32vec4.h.

59 : v(_mm_set_ps1(a)) {}
__m128 v
Definition: P4_F32vec4.h:52

◆ F32vec4() [4/8]

F32vec4::F32vec4 ( const float &  f0,
const float &  f1,
const float &  f2,
const float &  f3 
)
inline

Definition at line 61 of file P4_F32vec4.h.

61 : v(_mm_set_ps(f3, f2, f1, f0)) {}
__m128 v
Definition: P4_F32vec4.h:52

◆ F32vec4() [5/8]

F32vec4::F32vec4 ( )
inline

Definition at line 41 of file PSEUDO_F32vec4.h.

41 {}

◆ F32vec4() [6/8]

F32vec4::F32vec4 ( const F32vec4 a)
inline

Definition at line 42 of file PSEUDO_F32vec4.h.

References v.

43  {
44  v[0] = a.v[0];
45  v[1] = a.v[1];
46  v[2] = a.v[2];
47  v[3] = a.v[3];
48  }
__m128 v
Definition: P4_F32vec4.h:52

◆ F32vec4() [7/8]

F32vec4::F32vec4 ( const float &  a)
inline

Definition at line 49 of file PSEUDO_F32vec4.h.

50  {
51  v[0] = a;
52  v[1] = a;
53  v[2] = a;
54  v[3] = a;
55  }
__m128 v
Definition: P4_F32vec4.h:52

◆ F32vec4() [8/8]

F32vec4::F32vec4 ( const float &  f0,
const float &  f1,
const float &  f2,
const float &  f3 
)
inline

Definition at line 57 of file PSEUDO_F32vec4.h.

58  {
59  v[0] = f0;
60  v[1] = f1;
61  v[2] = f2;
62  v[3] = f3;
63  }
__m128 v
Definition: P4_F32vec4.h:52

Member Function Documentation

◆ operator __m128()

F32vec4::operator __m128 ( ) const
inline

Definition at line 64 of file P4_F32vec4.h.

References v.

64 { return v; } /* Convert to __m128 */
__m128 v
Definition: P4_F32vec4.h:52

◆ operator[]() [1/4]

float& F32vec4::operator[] ( int  i)
inline

Definition at line 38 of file PSEUDO_F32vec4.h.

References i.

38 { return ((float *)&v)[i]; }
unsigned int i
Definition: P4_F32vec4.h:33
__m128 v
Definition: P4_F32vec4.h:52

◆ operator[]() [2/4]

float F32vec4::operator[] ( int  i) const
inline

Definition at line 39 of file PSEUDO_F32vec4.h.

39 { return ((float *)&v)[i]; }
unsigned int i
Definition: P4_F32vec4.h:33
__m128 v
Definition: P4_F32vec4.h:52

◆ operator[]() [3/4]

float& F32vec4::operator[] ( int  i)
inline

Definition at line 54 of file P4_F32vec4.h.

References i.

54 { return (reinterpret_cast<float *>(&v))[i]; }
unsigned int i
Definition: P4_F32vec4.h:33
__m128 v
Definition: P4_F32vec4.h:52

◆ operator[]() [4/4]

float F32vec4::operator[] ( int  i) const
inline

Definition at line 55 of file P4_F32vec4.h.

References i.

55 { return (reinterpret_cast<const float *>(&v))[i]; }
unsigned int i
Definition: P4_F32vec4.h:33
__m128 v
Definition: P4_F32vec4.h:52

◆ vec_arithmetic() [1/2]

F32vec4::vec_arithmetic ( F32vec4  ,
float   
)

◆ vec_arithmetic() [2/2]

F32vec4::vec_arithmetic ( F32vec4  ,
float   
)

Friends And Related Function Documentation

◆ acos

F32vec4 acos ( const F32vec4 a)
friend

Definition at line 169 of file P4_F32vec4.h.

169 { return _f1(a, acos); }
friend F32vec4 acos(const F32vec4 &a)
Definition: P4_F32vec4.h:169
#define _f1(A, F)
Definition: P4_F32vec4.h:126

◆ asgnb [1/3]

F32vec4 asgnb ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 99 of file P4_F32vec4.h.

Referenced by rsqrt().

99 { return _mm_or_ps(_mm_and_ps(b, _f32vec4_sgn_mask), a); }
#define _f32vec4_sgn_mask
Definition: P4_F32vec4.h:44

◆ asgnb [2/3]

float asgnb ( float  x,
float  y 
)
friend

Definition at line 138 of file PSEUDO_F32vec4.h.

138 { return y >= 0 ? fabs(x) : -fabs(x); }
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:95

◆ asgnb [3/3]

F32vec4 asgnb ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 145 of file PSEUDO_F32vec4.h.

145 { _f2(a, b, asgnb) }
#define _f2(A, B, F)
friend F32vec4 asgnb(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:99

◆ atan2

F32vec4 atan2 ( const F32vec4 y,
const F32vec4 x 
)
friend

Definition at line 173 of file P4_F32vec4.h.

174  {
175  const F32vec4 pi(3.1415926535897932);
176  const F32vec4 pi_2 = pi / 2;
177  const F32vec4 zero(0);
178 
179  const F32vec4 &xZero = F32vec4(x == zero);
180  const F32vec4 &yZero = F32vec4(y == zero);
181  const F32vec4 &xNeg = F32vec4(x < zero);
182  const F32vec4 &yNeg = F32vec4(y < zero);
183 
184  const F32vec4 &absX = fabs(x);
185  const F32vec4 &absY = fabs(y);
186 
187  F32vec4 a = absY / absX;
188  const F32vec4 pi_4 = pi / 4;
189  const F32vec4 &gt_tan_3pi_8 = F32vec4(a > F32vec4(2.414213562373095));
190  const F32vec4 &gt_tan_pi_8 = F32vec4(a > F32vec4(0.4142135623730950)) & F32vec4(!gt_tan_3pi_8);
191  const F32vec4 minusOne(-1);
192  F32vec4 b(zero);
193  b = (pi_2 & gt_tan_3pi_8) + (F32vec4(!gt_tan_3pi_8) & b);
194  b = (pi_4 & gt_tan_pi_8) + (F32vec4(!gt_tan_pi_8) & b);
195  a = (gt_tan_3pi_8 & (minusOne / a)) + (F32vec4(!gt_tan_3pi_8) & a);
196  a = (gt_tan_pi_8 & ((absY - absX) / (absY + absX))) + (F32vec4(!gt_tan_pi_8) & a);
197  const F32vec4 &a2 = a * a;
198  b += (((8.05374449538e-2 * a2 - 1.38776856032E-1) * a2 + 1.99777106478E-1) * a2 - 3.33329491539E-1) * a2 * a + a;
199  F32vec4 xyNeg = F32vec4(xNeg ^ yNeg);
200  b = (xyNeg & (-b)) + (F32vec4(!xyNeg) & b);
201  xyNeg = F32vec4(xNeg & !yNeg);
202  b = (xyNeg & (b + pi)) + (F32vec4(!xyNeg) & b);
203  xyNeg = F32vec4(xNeg & yNeg);
204  b = (xyNeg & (b - pi)) + (F32vec4(!xyNeg) & b);
205  xyNeg = F32vec4(xZero & yZero);
206  b = (xyNeg & zero) + (F32vec4(!xyNeg) & b);
207  xyNeg = F32vec4(xZero & yNeg);
208  b = (xyNeg & (-pi_2)) + (F32vec4(!xyNeg) & b);
209  return b;
210  }
double pi
Definition: f_Init.h:53
F32vec4()
Definition: P4_F32vec4.h:57
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:95

◆ bool2int [1/2]

F32vec4 bool2int ( const F32vec4 a)
friend

Definition at line 130 of file PSEUDO_F32vec4.h.

131  { // mask returned
132  return if3(a, 1, 0);
133  }
friend F32vec4 if3(const F32vec4 &a, const F32vec4 &b, const F32vec4 &c)

◆ bool2int [2/2]

F32vec4 bool2int ( const F32vec4 a)
friend

Definition at line 152 of file P4_F32vec4.h.

153  { // mask returned
154  return if3(a, 1, 0);
155  }
friend F32vec4 if3(const F32vec4 &a, const F32vec4 &b, const F32vec4 &c)

◆ cos [1/2]

F32vec4 cos ( const F32vec4 a)
friend

Definition at line 154 of file PSEUDO_F32vec4.h.

154 { _f1(a, cos) }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:168
#define _f1(A, F)

◆ cos [2/2]

F32vec4 cos ( const F32vec4 a)
friend

Definition at line 168 of file P4_F32vec4.h.

168 { return _f1(a, cos); }
#define _f1(A, F)
Definition: P4_F32vec4.h:126
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:168

◆ exp [1/2]

F32vec4 exp ( const F32vec4 a)
friend

Definition at line 151 of file PSEUDO_F32vec4.h.

151 { _f1(a, exp) }
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:165
#define _f1(A, F)

◆ exp [2/2]

F32vec4 exp ( const F32vec4 a)
friend

Definition at line 165 of file P4_F32vec4.h.

Referenced by sin().

165 { return _f1(a, exp); }
#define _f1(A, F)
Definition: P4_F32vec4.h:126
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:165

◆ fabs [1/2]

F32vec4 fabs ( const F32vec4 a)
friend

Definition at line 95 of file P4_F32vec4.h.

Referenced by exp(), and rcp().

95 { return _mm_and_ps(a, _f32vec4_abs_mask); }
#define _f32vec4_abs_mask
Definition: P4_F32vec4.h:43

◆ fabs [2/2]

F32vec4 fabs ( const F32vec4 a)
friend

Definition at line 149 of file PSEUDO_F32vec4.h.

149 { _f1(a, fabs) }
#define _f1(A, F)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:95

◆ if3

F32vec4 if3 ( const F32vec4 a,
const F32vec4 b,
const F32vec4 c 
)
friend

Definition at line 115 of file PSEUDO_F32vec4.h.

116  {
117  F32vec4 z;
118  z[0] = (a[0]) ? b[0] : c[0];
119  z[1] = (a[1]) ? b[1] : c[1];
120  z[2] = (a[2]) ? b[2] : c[2];
121  z[3] = (a[3]) ? b[3] : c[3];
122 
123  return z;
124  }

◆ log [1/2]

F32vec4 log ( const F32vec4 a)
friend

Definition at line 152 of file PSEUDO_F32vec4.h.

152 { _f1(a, log) }
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:166
#define _f1(A, F)

◆ log [2/2]

F32vec4 log ( const F32vec4 a)
friend

Definition at line 166 of file P4_F32vec4.h.

Referenced by cos().

166 { return _f1(a, log); }
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:166
#define _f1(A, F)
Definition: P4_F32vec4.h:126

◆ max [1/3]

F32vec4 max ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 74 of file P4_F32vec4.h.

Referenced by sqrt().

74 { return _mm_max_ps(a, b); }

◆ max [2/3]

float max ( float  x,
float  y 
)
friend

Definition at line 137 of file PSEUDO_F32vec4.h.

137 { return x < y ? y : x; }

◆ max [3/3]

F32vec4 max ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 144 of file PSEUDO_F32vec4.h.

144 { _f2(a, b, max) }
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:74
#define _f2(A, B, F)

◆ min [1/3]

F32vec4 min ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 73 of file P4_F32vec4.h.

Referenced by asgnb().

73 { return _mm_min_ps(a, b); }

◆ min [2/3]

float min ( float  x,
float  y 
)
friend

Definition at line 136 of file PSEUDO_F32vec4.h.

136 { return x < y ? x : y; }

◆ min [3/3]

F32vec4 min ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 143 of file PSEUDO_F32vec4.h.

143 { _f2(a, b, min) }
#define _f2(A, B, F)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:73

◆ operator & [1/2]

F32vec4 operator& ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 100 of file PSEUDO_F32vec4.h.

100 { _op(a, b, &&) }
#define _op(A, B, O)

◆ operator & [2/2]

F32vec4 operator& ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 103 of file P4_F32vec4.h.

104  { // mask returned
105  return _mm_and_ps(a, b);
106  }

◆ operator! [1/2]

F32vec4 operator! ( const F32vec4 a)
friend

Definition at line 104 of file PSEUDO_F32vec4.h.

105  {
106  F32vec4 z;
107  z[0] = !a[0];
108  z[1] = !a[1];
109  z[2] = !a[2];
110  z[3] = !a[3];
111 
112  return z;
113  }

◆ operator! [2/2]

F32vec4 operator! ( const F32vec4 a)
friend

Definition at line 115 of file P4_F32vec4.h.

116  { // mask returned
117  return _mm_xor_ps(a, _f32vec4_true);
118  }
#define _f32vec4_true
Definition: P4_F32vec4.h:47

◆ operator* [1/2]

F32vec4 operator* ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 69 of file P4_F32vec4.h.

69 { return _mm_mul_ps(a, b); }

◆ operator* [2/2]

F32vec4 operator* ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 90 of file PSEUDO_F32vec4.h.

90 { _op(a, b, *) }
#define _op(A, B, O)

◆ operator+ [1/2]

F32vec4 operator+ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 67 of file P4_F32vec4.h.

67 { return _mm_add_ps(a, b); }

◆ operator+ [2/2]

F32vec4 operator+ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 88 of file PSEUDO_F32vec4.h.

88 { _op(a, b, +) }
#define _op(A, B, O)

◆ operator- [1/2]

F32vec4 operator- ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 68 of file P4_F32vec4.h.

68 { return _mm_sub_ps(a, b); }

◆ operator- [2/2]

F32vec4 operator- ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 89 of file PSEUDO_F32vec4.h.

89 { _op(a, b, -) }
#define _op(A, B, O)

◆ operator/ [1/2]

F32vec4 operator/ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 70 of file P4_F32vec4.h.

70 { return _mm_div_ps(a, b); }

◆ operator/ [2/2]

F32vec4 operator/ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 91 of file PSEUDO_F32vec4.h.

91 { _op(a, b, /) }
#define _op(A, B, O)

◆ operator< [1/2]

F32vec4 operator< ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 94 of file PSEUDO_F32vec4.h.

94 { _op(a, b, <) }
#define _op(A, B, O)

◆ operator< [2/2]

F32vec4 operator< ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 125 of file P4_F32vec4.h.

126  { // mask returned
127  return _mm_cmplt_ps(a, b);
128  }

◆ operator<< [1/2]

ostream& operator<< ( ostream &  strm,
const F32vec4 a 
)
friend

Definition at line 163 of file PSEUDO_F32vec4.h.

164  {
165  strm << a[0] << " " << a[1] << " " << a[2] << " " << a[3];
166  return strm;
167  }

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  strm,
const F32vec4 a 
)
friend

Definition at line 212 of file P4_F32vec4.h.

213  {
214  strm << "[" << a[0] << " " << a[1] << " " << a[2] << " " << a[3] << "]";
215  return strm;
216  }

◆ operator<= [1/2]

F32vec4 operator<= ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 95 of file PSEUDO_F32vec4.h.

95 { _op(a, b, <=) }
#define _op(A, B, O)

◆ operator<= [2/2]

F32vec4 operator<= ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 129 of file P4_F32vec4.h.

130  { // mask returned
131  return _mm_cmple_ps(a, b);
132  }

◆ operator==

F32vec4 operator== ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 141 of file P4_F32vec4.h.

142  { // mask returned
143  return _mm_cmpeq_ps(a, b);
144  }

◆ operator> [1/2]

F32vec4 operator> ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 96 of file PSEUDO_F32vec4.h.

96 { _op(a, b, >) }
#define _op(A, B, O)

◆ operator> [2/2]

F32vec4 operator> ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 133 of file P4_F32vec4.h.

134  { // mask returned
135  return _mm_cmpgt_ps(a, b);
136  }

◆ operator>= [1/2]

F32vec4 operator>= ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 97 of file PSEUDO_F32vec4.h.

97 { _op(a, b, >=) }
#define _op(A, B, O)

◆ operator>= [2/2]

F32vec4 operator>= ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 137 of file P4_F32vec4.h.

138  { // mask returned
139  return _mm_cmpge_ps(a, b);
140  }

◆ operator>> [1/2]

istream& operator>> ( istream &  strm,
F32vec4 a 
)
friend

Definition at line 169 of file PSEUDO_F32vec4.h.

170  {
171  float tmp;
172  strm >> tmp;
173  a = tmp;
174  return strm;
175  }

◆ operator>> [2/2]

std::istream& operator>> ( std::istream &  strm,
F32vec4 a 
)
friend

Definition at line 218 of file P4_F32vec4.h.

219  {
220  float tmp;
221  strm >> tmp;
222  a = tmp;
223  return strm;
224  }

◆ operator^

F32vec4 operator^ ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 111 of file P4_F32vec4.h.

112  { // mask returned
113  return _mm_xor_ps(a, b);
114  }

◆ operator| [1/2]

F32vec4 operator| ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 101 of file PSEUDO_F32vec4.h.

101 { _op(a, b, ||) }
#define _op(A, B, O)

◆ operator| [2/2]

F32vec4 operator| ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 107 of file P4_F32vec4.h.

108  { // mask returned
109  return _mm_or_ps(a, b);
110  }

◆ operator||

F32vec4 operator|| ( const F32vec4 a,
const F32vec4 b 
)
friend

Definition at line 102 of file PSEUDO_F32vec4.h.

102 { _op(a, b, ||) }
#define _op(A, B, O)

◆ rcp [1/3]

F32vec4 rcp ( const F32vec4 a)
friend

Definition at line 88 of file P4_F32vec4.h.

Referenced by sgn().

89  {
90  F32vec4 Ra0 = _mm_rcp_ps(a);
91  return _mm_sub_ps(_mm_add_ps(Ra0, Ra0), _mm_mul_ps(_mm_mul_ps(Ra0, a), Ra0));
92  }

◆ rcp [2/3]

float rcp ( float  x)
friend

Definition at line 140 of file PSEUDO_F32vec4.h.

140 { return 1. / x; }

◆ rcp [3/3]

F32vec4 rcp ( const F32vec4 a)
friend

Definition at line 148 of file PSEUDO_F32vec4.h.

148 { _f1(a, rcp) }
friend F32vec4 rcp(const F32vec4 &a)
Definition: P4_F32vec4.h:88
#define _f1(A, F)

◆ rsqrt [1/3]

F32vec4 rsqrt ( const F32vec4 a)
friend

Definition at line 80 of file P4_F32vec4.h.

Referenced by fabs().

80 { return _mm_rsqrt_ps(a); }

◆ rsqrt [2/3]

float rsqrt ( float  x)
friend

Definition at line 139 of file PSEUDO_F32vec4.h.

139 { return 1. / sqrt(x); }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:77

◆ rsqrt [3/3]

F32vec4 rsqrt ( const F32vec4 a)
friend

Definition at line 147 of file PSEUDO_F32vec4.h.

147 { _f1(a, rsqrt) }
friend F32vec4 rsqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:80
#define _f1(A, F)

◆ sgn [1/3]

F32vec4 sgn ( const F32vec4 a)
friend

Definition at line 98 of file P4_F32vec4.h.

Referenced by log().

98 { return _mm_or_ps(_mm_and_ps(a, _f32vec4_sgn_mask), _f32vec4_one); }
#define _f32vec4_one
Definition: P4_F32vec4.h:46
#define _f32vec4_sgn_mask
Definition: P4_F32vec4.h:44

◆ sgn [2/3]

float sgn ( float  x)
friend

Definition at line 141 of file PSEUDO_F32vec4.h.

141 { return x >= 0 ? 1 : -1; }

◆ sgn [3/3]

F32vec4 sgn ( const F32vec4 a)
friend

Definition at line 150 of file PSEUDO_F32vec4.h.

150 { _f1(a, sgn) }
#define _f1(A, F)
friend F32vec4 sgn(const F32vec4 &a)
Definition: P4_F32vec4.h:98

◆ sin [1/2]

F32vec4 sin ( const F32vec4 a)
friend

Definition at line 153 of file PSEUDO_F32vec4.h.

153 { _f1(a, sin) }
#define _f1(A, F)
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:167

◆ sin [2/2]

F32vec4 sin ( const F32vec4 a)
friend

Definition at line 167 of file P4_F32vec4.h.

167 { return _f1(a, sin); }
#define _f1(A, F)
Definition: P4_F32vec4.h:126
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:167

◆ sqrt [1/2]

F32vec4 sqrt ( const F32vec4 a)
friend

Definition at line 77 of file P4_F32vec4.h.

Referenced by rcp(), and sgn().

77 { return _mm_sqrt_ps(a); }

◆ sqrt [2/2]

F32vec4 sqrt ( const F32vec4 a)
friend

Definition at line 146 of file PSEUDO_F32vec4.h.

146 { _f1(a, sqrt) }
#define _f1(A, F)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:77

Member Data Documentation

◆ v [1/2]

float F32vec4::v[4]

Definition at line 36 of file PSEUDO_F32vec4.h.

◆ v [2/2]

__m128 F32vec4::v

Definition at line 52 of file P4_F32vec4.h.

Referenced by F32vec4(), and operator __m128().


The documentation for this class was generated from the following files: