12 #ifndef MFEM_SIMD_M256_HPP
13 #define MFEM_SIMD_M256_HPP
17 #include "../../config/tconfig.hpp"
18 #if defined(__x86_64__)
19 #include <x86intrin.h>
20 #else // assuming MSVC with _M_X64 or _M_IX86
27 template <
typename,
int,
int>
struct AutoSIMD;
32 static constexpr
int size = 4;
50 inline MFEM_ALWAYS_INLINE
const double &
operator[](
int i)
const
63 m256d = _mm256_set1_pd(e);
69 m256d = _mm256_add_pd(m256d,v.m256d);
75 m256d = _mm256_add_pd(m256d,_mm256_set1_pd(e));
81 m256d = _mm256_sub_pd(m256d,v.m256d);
87 m256d = _mm256_sub_pd(m256d,_mm256_set1_pd(e));
93 m256d = _mm256_mul_pd(m256d,v.m256d);
99 m256d = _mm256_mul_pd(m256d,_mm256_set1_pd(e));
105 m256d = _mm256_div_pd(m256d,v.m256d);
111 m256d = _mm256_div_pd(m256d,_mm256_set1_pd(e));
118 r.m256d = _mm256_xor_pd(_mm256_set1_pd(-0.0), m256d);
130 r.m256d = _mm256_add_pd(m256d,v.m256d);
137 r.m256d = _mm256_add_pd(m256d, _mm256_set1_pd(e));
144 r.m256d = _mm256_sub_pd(m256d,v.m256d);
151 r.m256d = _mm256_sub_pd(m256d, _mm256_set1_pd(e));
158 r.m256d = _mm256_mul_pd(m256d,v.m256d);
165 r.m256d = _mm256_mul_pd(m256d, _mm256_set1_pd(e));
172 r.m256d = _mm256_div_pd(m256d,v.m256d);
179 r.m256d = _mm256_div_pd(m256d, _mm256_set1_pd(e));
186 m256d = _mm256_add_pd(_mm256_mul_pd(w.m256d,v.m256d),m256d);
188 m256d = _mm256_fmadd_pd(w.m256d,v.m256d,m256d);
196 m256d = _mm256_add_pd(_mm256_mul_pd(_mm256_set1_pd(e),v.m256d),m256d);
198 m256d = _mm256_fmadd_pd(_mm256_set1_pd(e),v.m256d,m256d);
206 m256d = _mm256_add_pd(_mm256_mul_pd(v.m256d,_mm256_set1_pd(e)),m256d);
208 m256d = _mm256_fmadd_pd(v.m256d,_mm256_set1_pd(e),m256d);
215 m256d = _mm256_mul_pd(v.m256d,w.m256d);
221 m256d = _mm256_mul_pd(v.m256d,_mm256_set1_pd(e));
227 m256d = _mm256_mul_pd(_mm256_set1_pd(e),v.m256d);
232 inline MFEM_ALWAYS_INLINE
237 r.
m256d = _mm256_add_pd(_mm256_set1_pd(e),v.
m256d);
241 inline MFEM_ALWAYS_INLINE
246 r.
m256d = _mm256_sub_pd(_mm256_set1_pd(e),v.
m256d);
250 inline MFEM_ALWAYS_INLINE
255 r.
m256d = _mm256_mul_pd(_mm256_set1_pd(e),v.
m256d);
259 inline MFEM_ALWAYS_INLINE
264 r.
m256d = _mm256_div_pd(_mm256_set1_pd(e),v.
m256d);
272 #endif // MFEM_SIMD_M256_HPP
MFEM_ALWAYS_INLINE double & operator[](int i)
MFEM_ALWAYS_INLINE AutoSIMD operator-(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD operator/(const double &e) const
MFEM_ALWAYS_INLINE AutoSIMD & mul(const AutoSIMD &v, const double &e)
MFEM_ALWAYS_INLINE AutoSIMD & operator*=(const double &e)
MFEM_ALWAYS_INLINE AutoSIMD operator+(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD< scalar_t, S, A > operator/(const scalar_t &e, const AutoSIMD< scalar_t, S, A > &v)
MFEM_ALWAYS_INLINE AutoSIMD operator*(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD & operator*=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD & operator=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD operator+() const
MFEM_ALWAYS_INLINE AutoSIMD< scalar_t, S, A > operator+(const scalar_t &e, const AutoSIMD< scalar_t, S, A > &v)
MFEM_ALWAYS_INLINE AutoSIMD & operator/=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD & operator+=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD operator+(const double &e) const
MFEM_ALWAYS_INLINE AutoSIMD & fma(const AutoSIMD &v, const double &e)
MFEM_ALWAYS_INLINE AutoSIMD & operator+=(const double &e)
MFEM_ALWAYS_INLINE AutoSIMD & operator/=(const double &e)
static const int align_bytes
MFEM_ALWAYS_INLINE AutoSIMD & mul(const double &e, const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD operator-() const
MFEM_ALWAYS_INLINE AutoSIMD & fma(const AutoSIMD &v, const AutoSIMD &w)
MFEM_ALWAYS_INLINE AutoSIMD & mul(const AutoSIMD &v, const AutoSIMD &w)
MFEM_ALWAYS_INLINE AutoSIMD & operator-=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD & operator=(const double &e)
MFEM_ALWAYS_INLINE AutoSIMD & operator-=(const double &e)
MFEM_ALWAYS_INLINE AutoSIMD operator/(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD & fma(const double &e, const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD operator-(const double &e) const
MFEM_ALWAYS_INLINE AutoSIMD operator*(const double &e) const
MemoryClass operator*(MemoryClass mc1, MemoryClass mc2)
Return a suitable MemoryClass from a pair of MemoryClasses.
MFEM_ALWAYS_INLINE AutoSIMD< scalar_t, S, A > operator-(const scalar_t &e, const AutoSIMD< scalar_t, S, A > &v)
MFEM_ALWAYS_INLINE const double & operator[](int i) const