1#ifndef L1Algo_F32vec4P4_H
2#define L1Algo_F32vec4P4_H
29 __f32vec4_sgn_mask_cheat = {{
static_cast<int>(0x80000000),
static_cast<int>(0x80000000),
static_cast<int>(0x80000000),
30 static_cast<int>(0x80000000)}},
32 __f32vec4_true_cheat = {{
static_cast<int>(0xFFFFFFFF),
static_cast<int>(0xFFFFFFFF),
static_cast<int>(0xFFFFFFFF),
33 static_cast<int>(0xFFFFFFFF)}},
36#define _f32vec4_abs_mask (static_cast<F32vec4>(__f32vec4_abs_mask_cheat.m))
37#define _f32vec4_sgn_mask (static_cast<F32vec4>(__f32vec4_sgn_mask_cheat.m))
38#define _f32vec4_zero (static_cast<F32vec4>(__f32vec4_zero_cheat.m))
39#define _f32vec4_one (static_cast<F32vec4>(__f32vec4_one_cheat.m))
40#define _f32vec4_true (static_cast<F32vec4>(__f32vec4_true_cheat.m))
41#define _f32vec4_false (static_cast<F32vec4>(__f32vec4_false_cheat.m))
49 float operator[](
int i)
const {
return (
reinterpret_cast<const float*
>(&
v))[
i]; }
61 F32vec4(
const float& f0,
const float& f1,
const float& f2,
const float& f3)
62 :
v(_mm_set_ps(f3, f2, f1, f0))
66 operator __m128()
const {
return v; }
93 return _mm_sub_ps(_mm_add_ps(Ra0, Ra0), _mm_mul_ps(_mm_mul_ps(Ra0, a), Ra0));
107 return _mm_and_ps(a, b);
111 return _mm_or_ps(a, b);
115 return _mm_xor_ps(a, b);
129 return _mm_cmplt_ps(a, b);
133 return _mm_cmple_ps(a, b);
137 return _mm_cmpgt_ps(a, b);
141 return _mm_cmpge_ps(a, b);
145 return _mm_cmpeq_ps(a, b);
148#define if3(a, b, c) ((a) & (b)) | ((!(a)) & (c))
150#define Vec4NotEmpty(a) bool((a)[0]) | bool((a)[1]) | bool((a)[2]) | bool((a)[3])
151#define Vec4Empty(a) !(bool((a)[0]) | bool((a)[1]) | bool((a)[2]) | bool((a)[3]))
165#define _f1(A, F) F32vec4(F(A[0]), F(A[1]), F(A[2]), F(A[3]))
177 const F32vec4 pi(3.1415926535897932);
195 b = (pi_2 & gt_tan_3pi_8) + (
F32vec4(!gt_tan_3pi_8) & b);
196 b = (pi_4 & gt_tan_pi_8) + (
F32vec4(!gt_tan_pi_8) & b);
197 a = (gt_tan_3pi_8 & (minusOne / a)) + (
F32vec4(!gt_tan_3pi_8) & a);
198 a = (gt_tan_pi_8 & ((absY - absX) / (absY + absX))) + (
F32vec4(!gt_tan_pi_8) & a);
201 (((8.05374449538e-2 * a2 - 1.38776856032E-1) * a2 + 1.99777106478E-1) * a2 - 3.33329491539E-1) * a2 * a + a;
203 b = (xyNeg & (-b)) + (
F32vec4(!xyNeg) & b);
205 b = (xyNeg & (b + pi)) + (
F32vec4(!xyNeg) & b);
207 b = (xyNeg & (b - pi)) + (
F32vec4(!xyNeg) & b);
208 xyNeg =
F32vec4(xZero & yZero);
209 b = (xyNeg & zero) + (
F32vec4(!xyNeg) & b);
211 b = (xyNeg & (-pi_2)) + (
F32vec4(!xyNeg) & b);
217 strm <<
"[" << a[0] <<
" " << a[1] <<
" " << a[2] <<
" " << a[3] <<
"]";
236#define _fvecalignment __attribute__((aligned(16)))
const union @17 __f32vec4_false_cheat
const union @17 __f32vec4_zero_cheat
const union @17 __f32vec4_one_cheat
const union @17 __f32vec4_sgn_mask_cheat
#define _f32vec4_sgn_mask
#define _f32vec4_abs_mask
const union @17 __f32vec4_abs_mask_cheat
const union @17 __f32vec4_true_cheat
friend F32vec4 operator>(const F32vec4 &a, const F32vec4 &b)
float & operator[](int i)
friend F32vec4 acos(const F32vec4 &a)
friend F32vec4 sgn(const F32vec4 &a)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator|(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 rcp(const F32vec4 &a)
float operator[](int i) const
friend F32vec4 sin(const F32vec4 &a)
friend F32vec4 if3(const F32vec4 &a, const F32vec4 &b, const F32vec4 &c)
friend F32vec4 operator-(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 fabs(const F32vec4 &a)
friend F32vec4 bool2int(const F32vec4 &a)
friend F32vec4 rsqrt(const F32vec4 &a)
friend F32vec4 asgnb(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator<=(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator&(const F32vec4 &a, const F32vec4 &b)
friend std::istream & operator>>(std::istream &strm, F32vec4 &a)
F32vec4(const float &f0, const float &f1, const float &f2, const float &f3)
friend F32vec4 operator<(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
friend F32vec4 operator>=(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator*(const F32vec4 &a, const F32vec4 &b)
friend std::ostream & operator<<(std::ostream &strm, const F32vec4 &a)
friend F32vec4 exp(const F32vec4 &a)
friend F32vec4 operator+(const F32vec4 &a, const F32vec4 &b)
vec_arithmetic(F32vec4, float)
friend F32vec4 operator/(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 log(const F32vec4 &a)
friend F32vec4 operator!(const F32vec4 &a)
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 operator^(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 operator==(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)