1 #ifndef DataFormat_Math_AVXVec_H 2 #define DataFormat_Math_AVXVec_H 15 Vec4(__m256d ivec) : vec(ivec) {}
19 Vec4() { vec = _mm256_setzero_pd(); }
25 Vec4(
double f1,
double f2,
double f3,
double f4 = 0) {
35 vec = _mm256_insertf128_pd(vec, ivec0.vec, 0);
41 vec = _mm256_setzero_pd();
42 vec = _mm256_insertf128_pd(vec, ivec0.vec, 0);
46 void setMask(
unsigned int m1,
unsigned int m2,
unsigned int m3,
unsigned int m4) {
47 Mask4<double>
mask(m1,
m2, m3, m4);
51 void set(
double f1,
double f2,
double f3,
double f4 = 0) { vec = _mm256_set_pd(f4, f3,
f2,
f1); }
53 void set1(
double f1) { vec = _mm256_set1_pd(
f1); }
57 return _mm256_set1_pd(arr[
N]);
76 return _mm256_movemask_pd(_mm256_cmp_pd(
a.vec,
b.vec, _CMP_EQ_OS)) == 0xf;
80 return _mm256_cmp_pd(
a.vec,
b.vec, _CMP_EQ_OS);
84 return _mm256_cmp_pd(
a.vec,
b.vec, _CMP_GT_OS);
88 return _mm256_hadd_pd(
a.vec,
b.vec);
92 const __m256d neg = _mm256_set_pd(-0.0, -0.0, -0.0, -0.0);
93 return _mm256_xor_pd(
a.vec, neg);
97 return _mm256_and_pd(
a.vec,
b.vec);
100 return _mm256_or_pd(
a.vec,
b.vec);
103 return _mm256_xor_pd(
a.vec,
b.vec);
106 return _mm256_andnot_pd(
a.vec,
b.vec);
110 return _mm256_add_pd(
a.vec,
b.vec);
114 return _mm256_sub_pd(
a.vec,
b.vec);
118 return _mm256_mul_pd(
a.vec,
b.vec);
122 return _mm256_div_pd(
a.vec,
b.vec);
126 return _mm256_mul_pd(_mm256_set1_pd(
a),
b.vec);
130 return _mm256_mul_pd(_mm256_set1_pd(
a),
b.vec);
134 return _mm256_div_pd(
b.vec, _mm256_set1_pd(
a));
139 using mathSSE::_mm256_dot_pd;
141 ret.vec = _mm256_dot_pd(
a.vec,
b.vec);
147 using mathSSE::_mm256_cross_pd;
148 return _mm256_cross_pd(
a.vec,
b.vec);
154 mul =
hadd(mul, mul);
mathSSE::Vec4< double > andnot(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
mathSSE::Vec4< double > operator &(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
mathSSE::Vec4< double > operator|(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
bool operator==(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
ret
prodAgent to be discontinued
Vec2< double > xy() const
mathSSE::Vec4< double > cmpgt(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
Vec2< double > zw() const
mathSSE::Vec4< double > operator/(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
mathSSE::Vec4< double > operator-(mathSSE::Vec4< double > a)
mathSSE::Vec4< double > operator*(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
double operator[](unsigned int n) const
mathSSE::Vec4< double > operator+(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
Vec4(double f1, double f2, double f3, double f4=0)
double __attribute__((always_inline)) __attribute__((pure)) dot(mathSSE
Vec4(Vec2< double > ivec0, Vec2< double > ivec1)
Vec4(OldVec< double > const &ivec)
mathSSE::Vec4< double > operator^(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
Vec4(Vec2< double > ivec0, double f3, double f4=0)
Vec4(Vec2< double > ivec0)
void setMask(unsigned int m1, unsigned int m2, unsigned int m3, unsigned int m4)
mathSSE::Vec4< double > hadd(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
mathSSE::Vec4< double > cmpeq(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
double & operator[](unsigned int n)
T __attribute__((aligned(16))) arr[4]