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 38 of file P4_F32vec4.h.

Constructor & Destructor Documentation

◆ F32vec4() [1/8]

F32vec4::F32vec4 ( )
inline

Definition at line 45 of file P4_F32vec4.h.

45 : v(_mm_set_ps1(0)) {}
__m128 v
Definition: P4_F32vec4.h:40

◆ F32vec4() [2/8]

F32vec4::F32vec4 ( const __m128 &  a)
inline

Definition at line 46 of file P4_F32vec4.h.

46 : v(a) {}
__m128 v
Definition: P4_F32vec4.h:40

◆ F32vec4() [3/8]

F32vec4::F32vec4 ( const float &  a)
inline

Definition at line 47 of file P4_F32vec4.h.

47 : v(_mm_set_ps1(a)) {}
__m128 v
Definition: P4_F32vec4.h:40

◆ F32vec4() [4/8]

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

Definition at line 49 of file P4_F32vec4.h.

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

◆ F32vec4() [5/8]

F32vec4::F32vec4 ( )
inline

Definition at line 29 of file PSEUDO_F32vec4.h.

29 {}

◆ F32vec4() [6/8]

F32vec4::F32vec4 ( const F32vec4 a)
inline

Definition at line 30 of file PSEUDO_F32vec4.h.

References v.

31  {
32  v[0] = a.v[0];
33  v[1] = a.v[1];
34  v[2] = a.v[2];
35  v[3] = a.v[3];
36  }
__m128 v
Definition: P4_F32vec4.h:40

◆ F32vec4() [7/8]

F32vec4::F32vec4 ( const float &  a)
inline

Definition at line 37 of file PSEUDO_F32vec4.h.

38  {
39  v[0] = a;
40  v[1] = a;
41  v[2] = a;
42  v[3] = a;
43  }
__m128 v
Definition: P4_F32vec4.h:40

◆ F32vec4() [8/8]

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

Definition at line 45 of file PSEUDO_F32vec4.h.

46  {
47  v[0] = f0;
48  v[1] = f1;
49  v[2] = f2;
50  v[3] = f3;
51  }
__m128 v
Definition: P4_F32vec4.h:40

Member Function Documentation

◆ operator __m128()

F32vec4::operator __m128 ( ) const
inline

Definition at line 52 of file P4_F32vec4.h.

References v.

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

◆ operator[]() [1/4]

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

Definition at line 26 of file PSEUDO_F32vec4.h.

References i.

26 { return ((float *)&v)[i]; }
unsigned int i
Definition: P4_F32vec4.h:21
__m128 v
Definition: P4_F32vec4.h:40

◆ operator[]() [2/4]

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

Definition at line 27 of file PSEUDO_F32vec4.h.

27 { return ((float *)&v)[i]; }
unsigned int i
Definition: P4_F32vec4.h:21
__m128 v
Definition: P4_F32vec4.h:40

◆ operator[]() [3/4]

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

Definition at line 42 of file P4_F32vec4.h.

References i.

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

◆ operator[]() [4/4]

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

Definition at line 43 of file P4_F32vec4.h.

References i.

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

◆ 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 157 of file P4_F32vec4.h.

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

◆ asgnb [1/3]

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

Definition at line 87 of file P4_F32vec4.h.

Referenced by rsqrt().

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

◆ asgnb [2/3]

float asgnb ( float  x,
float  y 
)
friend

Definition at line 126 of file PSEUDO_F32vec4.h.

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

◆ asgnb [3/3]

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

Definition at line 133 of file PSEUDO_F32vec4.h.

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

◆ atan2

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

Definition at line 161 of file P4_F32vec4.h.

162  {
163  const F32vec4 pi(3.1415926535897932);
164  const F32vec4 pi_2 = pi / 2;
165  const F32vec4 zero(0);
166 
167  const F32vec4 &xZero = F32vec4(x == zero);
168  const F32vec4 &yZero = F32vec4(y == zero);
169  const F32vec4 &xNeg = F32vec4(x < zero);
170  const F32vec4 &yNeg = F32vec4(y < zero);
171 
172  const F32vec4 &absX = fabs(x);
173  const F32vec4 &absY = fabs(y);
174 
175  F32vec4 a = absY / absX;
176  const F32vec4 pi_4 = pi / 4;
177  const F32vec4 &gt_tan_3pi_8 = F32vec4(a > F32vec4(2.414213562373095));
178  const F32vec4 &gt_tan_pi_8 = F32vec4(a > F32vec4(0.4142135623730950)) & F32vec4(!gt_tan_3pi_8);
179  const F32vec4 minusOne(-1);
180  F32vec4 b(zero);
181  b = (pi_2 & gt_tan_3pi_8) + (F32vec4(!gt_tan_3pi_8) & b);
182  b = (pi_4 & gt_tan_pi_8) + (F32vec4(!gt_tan_pi_8) & b);
183  a = (gt_tan_3pi_8 & (minusOne / a)) + (F32vec4(!gt_tan_3pi_8) & a);
184  a = (gt_tan_pi_8 & ((absY - absX) / (absY + absX))) + (F32vec4(!gt_tan_pi_8) & a);
185  const F32vec4 &a2 = a * a;
186  b += (((8.05374449538e-2 * a2 - 1.38776856032E-1) * a2 + 1.99777106478E-1) * a2 - 3.33329491539E-1) * a2 * a + a;
187  F32vec4 xyNeg = F32vec4(xNeg ^ yNeg);
188  b = (xyNeg & (-b)) + (F32vec4(!xyNeg) & b);
189  xyNeg = F32vec4(xNeg & !yNeg);
190  b = (xyNeg & (b + pi)) + (F32vec4(!xyNeg) & b);
191  xyNeg = F32vec4(xNeg & yNeg);
192  b = (xyNeg & (b - pi)) + (F32vec4(!xyNeg) & b);
193  xyNeg = F32vec4(xZero & yZero);
194  b = (xyNeg & zero) + (F32vec4(!xyNeg) & b);
195  xyNeg = F32vec4(xZero & yNeg);
196  b = (xyNeg & (-pi_2)) + (F32vec4(!xyNeg) & b);
197  return b;
198  }
double pi
Definition: f_Init.h:29
F32vec4()
Definition: P4_F32vec4.h:45
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:83

◆ bool2int [1/2]

F32vec4 bool2int ( const F32vec4 a)
friend

Definition at line 118 of file PSEUDO_F32vec4.h.

119  { // mask returned
120  return if3(a, 1, 0);
121  }
friend F32vec4 if3(const F32vec4 &a, const F32vec4 &b, const F32vec4 &c)

◆ bool2int [2/2]

F32vec4 bool2int ( const F32vec4 a)
friend

Definition at line 140 of file P4_F32vec4.h.

141  { // mask returned
142  return if3(a, 1, 0);
143  }
friend F32vec4 if3(const F32vec4 &a, const F32vec4 &b, const F32vec4 &c)

◆ cos [1/2]

F32vec4 cos ( const F32vec4 a)
friend

Definition at line 142 of file PSEUDO_F32vec4.h.

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

◆ cos [2/2]

F32vec4 cos ( const F32vec4 a)
friend

Definition at line 156 of file P4_F32vec4.h.

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

◆ exp [1/2]

F32vec4 exp ( const F32vec4 a)
friend

Definition at line 139 of file PSEUDO_F32vec4.h.

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

◆ exp [2/2]

F32vec4 exp ( const F32vec4 a)
friend

Definition at line 153 of file P4_F32vec4.h.

Referenced by sin().

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

◆ fabs [1/2]

F32vec4 fabs ( const F32vec4 a)
friend

Definition at line 83 of file P4_F32vec4.h.

Referenced by exp(), and rcp().

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

◆ fabs [2/2]

F32vec4 fabs ( const F32vec4 a)
friend

Definition at line 137 of file PSEUDO_F32vec4.h.

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

◆ if3

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

Definition at line 103 of file PSEUDO_F32vec4.h.

104  {
105  F32vec4 z;
106  z[0] = (a[0]) ? b[0] : c[0];
107  z[1] = (a[1]) ? b[1] : c[1];
108  z[2] = (a[2]) ? b[2] : c[2];
109  z[3] = (a[3]) ? b[3] : c[3];
110 
111  return z;
112  }

◆ log [1/2]

F32vec4 log ( const F32vec4 a)
friend

Definition at line 140 of file PSEUDO_F32vec4.h.

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

◆ log [2/2]

F32vec4 log ( const F32vec4 a)
friend

Definition at line 154 of file P4_F32vec4.h.

Referenced by cos().

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

◆ max [1/3]

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

Definition at line 62 of file P4_F32vec4.h.

Referenced by sqrt().

62 { return _mm_max_ps(a, b); }

◆ max [2/3]

float max ( float  x,
float  y 
)
friend

Definition at line 125 of file PSEUDO_F32vec4.h.

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

◆ max [3/3]

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

Definition at line 132 of file PSEUDO_F32vec4.h.

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

◆ min [1/3]

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

Definition at line 61 of file P4_F32vec4.h.

Referenced by asgnb().

61 { return _mm_min_ps(a, b); }

◆ min [2/3]

float min ( float  x,
float  y 
)
friend

Definition at line 124 of file PSEUDO_F32vec4.h.

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

◆ min [3/3]

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

Definition at line 131 of file PSEUDO_F32vec4.h.

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

◆ operator & [1/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 & [2/2]

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

Definition at line 91 of file P4_F32vec4.h.

92  { // mask returned
93  return _mm_and_ps(a, b);
94  }

◆ operator! [1/2]

F32vec4 operator! ( const F32vec4 a)
friend

Definition at line 92 of file PSEUDO_F32vec4.h.

93  {
94  F32vec4 z;
95  z[0] = !a[0];
96  z[1] = !a[1];
97  z[2] = !a[2];
98  z[3] = !a[3];
99 
100  return z;
101  }

◆ operator! [2/2]

F32vec4 operator! ( const F32vec4 a)
friend

Definition at line 103 of file P4_F32vec4.h.

104  { // mask returned
105  return _mm_xor_ps(a, _f32vec4_true);
106  }
#define _f32vec4_true
Definition: P4_F32vec4.h:35

◆ operator* [1/2]

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

Definition at line 57 of file P4_F32vec4.h.

57 { return _mm_mul_ps(a, b); }

◆ operator* [2/2]

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

Definition at line 78 of file PSEUDO_F32vec4.h.

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

◆ operator+ [1/2]

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

Definition at line 55 of file P4_F32vec4.h.

55 { return _mm_add_ps(a, b); }

◆ operator+ [2/2]

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

Definition at line 76 of file PSEUDO_F32vec4.h.

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

◆ operator- [1/2]

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

Definition at line 56 of file P4_F32vec4.h.

56 { return _mm_sub_ps(a, b); }

◆ operator- [2/2]

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

Definition at line 77 of file PSEUDO_F32vec4.h.

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

◆ operator/ [1/2]

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

Definition at line 58 of file P4_F32vec4.h.

58 { return _mm_div_ps(a, b); }

◆ operator/ [2/2]

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

Definition at line 79 of file PSEUDO_F32vec4.h.

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

◆ operator< [1/2]

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

Definition at line 82 of file PSEUDO_F32vec4.h.

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

◆ operator< [2/2]

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

Definition at line 113 of file P4_F32vec4.h.

114  { // mask returned
115  return _mm_cmplt_ps(a, b);
116  }

◆ operator<< [1/2]

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

Definition at line 151 of file PSEUDO_F32vec4.h.

152  {
153  strm << a[0] << " " << a[1] << " " << a[2] << " " << a[3];
154  return strm;
155  }

◆ operator<< [2/2]

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

Definition at line 200 of file P4_F32vec4.h.

201  {
202  strm << "[" << a[0] << " " << a[1] << " " << a[2] << " " << a[3] << "]";
203  return strm;
204  }

◆ operator<= [1/2]

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

Definition at line 83 of file PSEUDO_F32vec4.h.

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

◆ operator<= [2/2]

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

Definition at line 117 of file P4_F32vec4.h.

118  { // mask returned
119  return _mm_cmple_ps(a, b);
120  }

◆ operator==

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

Definition at line 129 of file P4_F32vec4.h.

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

◆ operator> [1/2]

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

Definition at line 84 of file PSEUDO_F32vec4.h.

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

◆ operator> [2/2]

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

Definition at line 121 of file P4_F32vec4.h.

122  { // mask returned
123  return _mm_cmpgt_ps(a, b);
124  }

◆ operator>= [1/2]

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

Definition at line 85 of file PSEUDO_F32vec4.h.

85 { _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_cmpge_ps(a, b);
128  }

◆ operator>> [1/2]

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

Definition at line 157 of file PSEUDO_F32vec4.h.

158  {
159  float tmp;
160  strm >> tmp;
161  a = tmp;
162  return strm;
163  }

◆ operator>> [2/2]

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

Definition at line 206 of file P4_F32vec4.h.

207  {
208  float tmp;
209  strm >> tmp;
210  a = tmp;
211  return strm;
212  }

◆ operator^

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

Definition at line 99 of file P4_F32vec4.h.

100  { // mask returned
101  return _mm_xor_ps(a, b);
102  }

◆ operator| [1/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| [2/2]

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

Definition at line 95 of file P4_F32vec4.h.

96  { // mask returned
97  return _mm_or_ps(a, b);
98  }

◆ operator||

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)

◆ rcp [1/3]

F32vec4 rcp ( const F32vec4 a)
friend

Definition at line 76 of file P4_F32vec4.h.

Referenced by sgn().

77  {
78  F32vec4 Ra0 = _mm_rcp_ps(a);
79  return _mm_sub_ps(_mm_add_ps(Ra0, Ra0), _mm_mul_ps(_mm_mul_ps(Ra0, a), Ra0));
80  }

◆ rcp [2/3]

float rcp ( float  x)
friend

Definition at line 128 of file PSEUDO_F32vec4.h.

128 { return 1. / x; }

◆ rcp [3/3]

F32vec4 rcp ( const F32vec4 a)
friend

Definition at line 136 of file PSEUDO_F32vec4.h.

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

◆ rsqrt [1/3]

F32vec4 rsqrt ( const F32vec4 a)
friend

Definition at line 68 of file P4_F32vec4.h.

Referenced by fabs().

68 { return _mm_rsqrt_ps(a); }

◆ rsqrt [2/3]

float rsqrt ( float  x)
friend

Definition at line 127 of file PSEUDO_F32vec4.h.

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

◆ rsqrt [3/3]

F32vec4 rsqrt ( const F32vec4 a)
friend

Definition at line 135 of file PSEUDO_F32vec4.h.

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

◆ sgn [1/3]

F32vec4 sgn ( const F32vec4 a)
friend

Definition at line 86 of file P4_F32vec4.h.

Referenced by log().

86 { return _mm_or_ps(_mm_and_ps(a, _f32vec4_sgn_mask), _f32vec4_one); }
#define _f32vec4_one
Definition: P4_F32vec4.h:34
#define _f32vec4_sgn_mask
Definition: P4_F32vec4.h:32

◆ sgn [2/3]

float sgn ( float  x)
friend

Definition at line 129 of file PSEUDO_F32vec4.h.

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

◆ sgn [3/3]

F32vec4 sgn ( const F32vec4 a)
friend

Definition at line 138 of file PSEUDO_F32vec4.h.

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

◆ sin [1/2]

F32vec4 sin ( const F32vec4 a)
friend

Definition at line 141 of file PSEUDO_F32vec4.h.

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

◆ sin [2/2]

F32vec4 sin ( const F32vec4 a)
friend

Definition at line 155 of file P4_F32vec4.h.

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

◆ sqrt [1/2]

F32vec4 sqrt ( const F32vec4 a)
friend

Definition at line 65 of file P4_F32vec4.h.

Referenced by rcp(), and sgn().

65 { return _mm_sqrt_ps(a); }

◆ sqrt [2/2]

F32vec4 sqrt ( const F32vec4 a)
friend

Definition at line 134 of file PSEUDO_F32vec4.h.

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

Member Data Documentation

◆ v [1/2]

float F32vec4::v[4]

Definition at line 24 of file PSEUDO_F32vec4.h.

◆ v [2/2]

__m128 F32vec4::v

Definition at line 40 of file P4_F32vec4.h.

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


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