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) {
33 vec = _mm256_insertf128_pd(vec, ivec0.vec, 0);
34 vec = _mm256_insertf128_pd(vec, ivec1.vec, 1);
38 vec = _mm256_insertf128_pd(vec, ivec0.vec, 0);
44 vec = _mm256_setzero_pd();
45 vec = _mm256_insertf128_pd(vec, ivec0.vec, 0);
49 void setMask(
unsigned int m1,
unsigned int m2,
unsigned int m3,
unsigned int m4) {
50 Mask4<double> mask(m1, m2, m3, m4);
54 void set(
double f1,
double f2,
double f3,
double f4 = 0) { vec = _mm256_set_pd(f4, f3, f2, f1); }
56 void set1(
double f1) { vec = _mm256_set1_pd(f1); }
60 return _mm256_set1_pd(arr[
N]);
79 return _mm256_movemask_pd(_mm256_cmp_pd(a.
vec, b.
vec, _CMP_EQ_OS)) == 0xf;
83 return _mm256_cmp_pd(a.
vec, b.
vec, _CMP_EQ_OS);
87 return _mm256_cmp_pd(a.
vec, b.
vec, _CMP_GT_OS);
91 return _mm256_hadd_pd(a.
vec, b.
vec);
95 const __m256d neg = _mm256_set_pd(-0.0, -0.0, -0.0, -0.0);
96 return _mm256_xor_pd(a.
vec, neg);
100 return _mm256_and_pd(a.
vec, b.
vec);
103 return _mm256_or_pd(a.
vec, b.
vec);
106 return _mm256_xor_pd(a.
vec, b.
vec);
109 return _mm256_andnot_pd(a.
vec, b.
vec);
113 return _mm256_add_pd(a.
vec, b.
vec);
117 return _mm256_sub_pd(a.
vec, b.
vec);
121 return _mm256_mul_pd(a.
vec, b.
vec);
125 return _mm256_div_pd(a.
vec, b.
vec);
129 return _mm256_mul_pd(_mm256_set1_pd(a), b.
vec);
133 return _mm256_mul_pd(_mm256_set1_pd(a), b.
vec);
137 return _mm256_div_pd(b.
vec, _mm256_set1_pd(a));
142 using mathSSE::_mm256_dot_pd;
144 ret.
vec = _mm256_dot_pd(a.vec, b.vec);
150 using mathSSE::_mm256_cross_pd;
151 return _mm256_cross_pd(a.vec, b.vec);
155 dotxy(mathSSE::
Vec4<
double>
a, mathSSE::
Vec4<
double>
b) {
157 mul =
hadd(mul, mul);
tuple ret
prodAgent to be discontinued
mathSSE::Vec4< double > andnot(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
mathSSE::Vec4< double > operator|(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
Vec2< double > xy() const
double operator[](unsigned int n) const
MatrixMeschach operator+(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
mathSSE::Vec4< double > operator&(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
MatrixMeschach operator-(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
mathSSE::Vec4< double > cmpgt(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
void set(double f1, double f2, double f3, double f4=0)
Vec2< double > zw() const
float __attribute__((vector_size(8))) cms_float32x2_t
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
Vec4(double f1, double f2, double f3, double f4=0)
T1 operator/(const Phi< T1, Range > &a, const Phi< T1, Range > &b)
Division.
Vec4(Vec2< double > ivec0, Vec2< double > ivec1)
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
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)
MatrixMeschach operator*(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
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]
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.