1#ifndef L1Algo_F64vec2P4_H
2#define L1Algo_F64vec2P4_H
37#define _f64vec2_abs_mask (static_cast<F64vec2>(__f64vec2_abs_mask_cheat.m))
38#define _f64vec2_sgn_mask (static_cast<F64vec2>(__f64vec2_sgn_mask_cheat.m))
39#define _f64vec2_zero (static_cast<F64vec2>(__f64vec2_zero_cheat.m))
40#define _f64vec2_one (static_cast<F64vec2>(__f64vec2_one_cheat.m))
41#define _f64vec2_true (static_cast<F64vec2>(__f64vec2_true_cheat.m))
42#define _f64vec2_false (static_cast<F64vec2>(__f64vec2_false_cheat.m))
50 double &
operator[](
int i ){
return (
reinterpret_cast<double*
>(&
v))[
i]; }
51 double operator[](
int i )
const {
return (
reinterpret_cast<const double*
>(&
v))[
i]; }
55 F64vec2(
const double &a ):
v(_mm_set_pd1(a)) {}
57 F64vec2(
const double &f0,
const double &f1 ):
v(_mm_set_pd(f1,f0)) {}
60 operator __m128d()
const {
return v; }
99 return _mm_and_pd(a, b);
102 return _mm_or_pd(a, b);
105 return _mm_xor_pd(a, b);
117 return _mm_cmplt_pd(a, b);
120 return _mm_cmple_pd(a, b);
123 return _mm_cmpgt_pd(a, b);
126 return _mm_cmpge_pd(a, b);
129 return _mm_cmpeq_pd(a, b);
132 #define if3(a, b, c) ((a)&(b)) | ((!(a))&(c))
134 #define NotEmpty(a) bool((a)[0])|bool((a)[1])|bool((a)[2])|bool((a)[3])
135 #define Empty(a) !(bool((a)[0])|bool((a)[1])|bool((a)[2])|bool((a)[3]))
148#define _f1(A,F) F64vec2( F(A[0]), F(A[1]) )
177 b = (pi_2 & gt_tan_3pi_8) + (
F64vec2(!gt_tan_3pi_8) & b);
178 b = (pi_4 & gt_tan_pi_8) + (
F64vec2(!gt_tan_pi_8) & b);
179 a = (gt_tan_3pi_8 & (minusOne / a)) + (
F64vec2(!gt_tan_3pi_8) & a);
180 a = (gt_tan_pi_8 & ((absY - absX) / (absY + absX))) + (
F64vec2(!gt_tan_pi_8) & a) ;
182 b += (((8.05374449538e-2 * a2
183 - 1.38776856032E-1) * a2
184 + 1.99777106478E-1) * a2
185 - 3.33329491539E-1) * a2 * a
188 b = (xyNeg & (-b) ) + (
F64vec2(!xyNeg) & b);
190 b = (xyNeg & (b+pi)) + (
F64vec2(!xyNeg) & b);
192 b = (xyNeg & (b-pi)) + (
F64vec2(!xyNeg) & b);
193 xyNeg =
F64vec2(xZero & yZero);
194 b = (xyNeg & zero) + (
F64vec2(!xyNeg) & b);
196 b = (xyNeg & (-pi_2)) + (
F64vec2(!xyNeg) & b);
201 strm<<
"["<<a[0]<<
" "<<a[1]<<
" "<<a[2]<<
" "<<a[3]<<
"]";
220#define _fvecalignment __attribute__ ((aligned(16)))
const union @19 __f64vec2_one_cheat
const union @19 __f64vec2_zero_cheat
#define _f64vec2_sgn_mask
const union @19 __f64vec2_sgn_mask_cheat
const union @19 __f64vec2_false_cheat
#define _f64vec2_abs_mask
const union @19 __f64vec2_abs_mask_cheat
const union @19 __f64vec2_true_cheat
friend F64vec2 operator!(const F64vec2 &a)
friend F64vec2 operator<(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 operator>(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 operator*(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 asgnb(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 log(const F64vec2 &a)
friend F64vec2 operator==(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 operator>=(const F64vec2 &a, const F64vec2 &b)
vec_arithmetic(F64vec2, double)
double & operator[](int i)
friend F64vec2 cos(const F64vec2 &a)
friend F64vec2 operator/(const F64vec2 &a, const F64vec2 &b)
F64vec2(const double &f0, const double &f1)
friend F64vec2 min(const F64vec2 &a, const F64vec2 &b)
friend std::istream & operator>>(std::istream &strm, F64vec2 &a)
friend F64vec2 operator-(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 max(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 operator<=(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 fabs(const F64vec2 &a)
friend F64vec2 operator&(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 atan2(const F64vec2 &y, const F64vec2 &x)
friend F64vec2 rsqrt(const F64vec2 &a)
friend F64vec2 bool2int(const F64vec2 &a)
friend F64vec2 sqrt(const F64vec2 &a)
friend F64vec2 operator+(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 exp(const F64vec2 &a)
friend F64vec2 sin(const F64vec2 &a)
friend F64vec2 operator|(const F64vec2 &a, const F64vec2 &b)
friend F64vec2 rcp(const F64vec2 &a)
friend std::ostream & operator<<(std::ostream &strm, const F64vec2 &a)
F64vec2(const __m128d &a)
friend F64vec2 operator^(const F64vec2 &a, const F64vec2 &b)
double operator[](int i) const
friend F64vec2 acos(const F64vec2 &a)
friend F64vec2 sgn(const F64vec2 &a)