1 #ifndef DataFormat_Math_AVXVec_H
2 #define DataFormat_Math_AVXVec_H
15 Vec4(__m256d ivec) : vec(ivec) {}
20 vec = _mm256_setzero_pd();
25 vec = _mm256_cvtps_pd(ivec.vec);
33 arr[0] =
f1; arr[1] =
f2; arr[2] =
f3; arr[3]=
f4;
38 vec = _mm256_insertf128_pd(vec,ivec0.vec,0);
39 vec = _mm256_insertf128_pd(vec,ivec1.vec,1);
44 vec = _mm256_insertf128_pd(vec,ivec0.vec,0);
45 arr[2] =
f3; arr[3] =
f4;
49 vec = _mm256_setzero_pd();
50 vec = _mm256_insertf128_pd(vec,ivec0.vec,0);
55 void setMask(
unsigned int m1,
unsigned int m2,
unsigned int m3,
unsigned int m4) {
56 Mask4<double> mask(m1,m2,m3,m4); vec=mask.vec;
60 vec = _mm256_set_pd(
f4, f3, f2, f1);
64 vec = _mm256_set1_pd(f1);
69 return _mm256_set1_pd(arr[
N]);
90 vec = _mm256_cvtpd_ps(ivec.vec);
97 return _mm256_movemask_pd(_mm256_cmp_pd(a.
vec,b.
vec,_CMP_EQ_OS))==0xf;
101 return _mm256_cmp_pd(a.
vec,b.
vec,_CMP_EQ_OS);
105 return _mm256_cmp_pd(a.
vec,b.
vec,_CMP_GT_OS);
109 return _mm256_hadd_pd(a.
vec,b.
vec);
115 const __m256d neg = _mm256_set_pd ( -0.0 , -0.0 , -0.0, -0.0);
116 return _mm256_xor_pd(a.
vec,neg);
120 return _mm256_and_pd(a.
vec,b.
vec);
123 return _mm256_or_pd(a.
vec,b.
vec);
126 return _mm256_xor_pd(a.
vec,b.
vec);
129 return _mm256_andnot_pd(a.
vec,b.
vec);
134 return _mm256_add_pd(a.
vec,b.
vec);
138 return _mm256_sub_pd(a.
vec,b.
vec);
142 return _mm256_mul_pd(a.
vec,b.
vec);
146 return _mm256_div_pd(a.
vec,b.
vec);
150 return _mm256_mul_pd(_mm256_set1_pd(a),b.
vec);
154 return _mm256_mul_pd(_mm256_set1_pd(a),b.
vec);
158 return _mm256_div_pd(b.
vec,_mm256_set1_pd(a));
165 using mathSSE::_mm256_dot_pd;
167 ret.
vec = _mm256_dot_pd(a.vec,b.vec);
174 using mathSSE::_mm256_cross_pd;
175 return _mm256_cross_pd(a.vec,b.vec);
180 dotxy(mathSSE::
Vec4<
double>
a, mathSSE::
Vec4<
double>
b) {
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)
bool operator==(const CaloTower &t1, const CaloTower &t2)
mathSSE::Vec4< double > cmpgt(mathSSE::Vec4< double > a, mathSSE::Vec4< double > b)
void set(double f1, double f2, double f3, double f4=0)
Basic3DVector< long double > operator/(const Basic3DVector< long double > &v, S s)
Vec2< double > zw() const
Vec4(double f1, double f2, double f3, double f4=0)
float __attribute__((vector_size(8))) float32x2_t
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.