12 #ifndef MFEM_SIMD_M128_HPP
13 #define MFEM_SIMD_M128_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 = 2;
50 inline MFEM_ALWAYS_INLINE
const double &
operator[](
int i)
const
63 m128d = _mm_set1_pd(e);
69 m128d = _mm_add_pd(m128d,v.m128d);
75 m128d = _mm_add_pd(m128d,_mm_set1_pd(e));
81 m128d = _mm_sub_pd(m128d,v.m128d);
87 m128d = _mm_sub_pd(m128d,_mm_set1_pd(e));
93 m128d = _mm_mul_pd(m128d,v.m128d);
99 m128d = _mm_mul_pd(m128d,_mm_set1_pd(e));
105 m128d = _mm_div_pd(m128d,v.m128d);
111 m128d = _mm_div_pd(m128d,_mm_set1_pd(e));
118 r.m128d = _mm_xor_pd(_mm_set1_pd(-0.0), m128d);
130 r.m128d = _mm_add_pd(m128d,v.m128d);
138 r.m128d = _mm_add_pd(m128d, _mm_set1_pd(e));
145 r.m128d = _mm_sub_pd(m128d,v.m128d);
152 r.m128d = _mm_sub_pd(m128d, _mm_set1_pd(e));
159 r.m128d = _mm_mul_pd(m128d,v.m128d);
166 r.m128d = _mm_mul_pd(m128d, _mm_set1_pd(e));
173 r.m128d = _mm_div_pd(m128d,v.m128d);
180 r.m128d = _mm_div_pd(m128d, _mm_set1_pd(e));
187 m128d = _mm_add_pd(_mm_mul_pd(w.m128d,v.m128d),m128d);
193 m128d = _mm_add_pd(_mm_mul_pd(_mm_set1_pd(e),v.m128d),m128d);
199 m128d = _mm_add_pd(_mm_mul_pd(v.m128d,_mm_set1_pd(e)),m128d);
205 m128d = _mm_mul_pd(v.m128d,w.m128d);
211 m128d = _mm_mul_pd(v.m128d,_mm_set1_pd(e));
217 m128d = _mm_mul_pd(_mm_set1_pd(e),v.m128d);
222 inline MFEM_ALWAYS_INLINE
231 inline MFEM_ALWAYS_INLINE
240 inline MFEM_ALWAYS_INLINE
249 inline MFEM_ALWAYS_INLINE
262 #endif // MFEM_SIMD_M128_HPP
MFEM_ALWAYS_INLINE AutoSIMD & mul(const AutoSIMD &v, const AutoSIMD &w)
MFEM_ALWAYS_INLINE AutoSIMD & operator/=(const double &e)
MFEM_ALWAYS_INLINE AutoSIMD & operator/=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD operator+(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD & mul(const double &e, const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD< scalar_t, S, A > operator/(const scalar_t &e, const AutoSIMD< scalar_t, S, A > &v)
MFEM_ALWAYS_INLINE AutoSIMD & fma(const AutoSIMD &v, const AutoSIMD &w)
MFEM_ALWAYS_INLINE AutoSIMD operator-() const
MFEM_ALWAYS_INLINE const double & operator[](int i) const
MFEM_ALWAYS_INLINE AutoSIMD operator+() const
MFEM_ALWAYS_INLINE AutoSIMD operator/(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD operator+(const double &e) 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 double &e)
MFEM_ALWAYS_INLINE AutoSIMD operator-(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD operator*(const AutoSIMD &v) const
MFEM_ALWAYS_INLINE AutoSIMD & fma(const AutoSIMD &v, const double &e)
static const int align_bytes
MFEM_ALWAYS_INLINE AutoSIMD & fma(const double &e, const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD & operator*=(const double &e)
MFEM_ALWAYS_INLINE double & operator[](int i)
MFEM_ALWAYS_INLINE AutoSIMD & operator+=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD & operator*=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD & operator-=(const double &e)
MFEM_ALWAYS_INLINE AutoSIMD & operator=(const AutoSIMD &v)
MFEM_ALWAYS_INLINE AutoSIMD operator-(const double &e) const
MFEM_ALWAYS_INLINE AutoSIMD & operator-=(const AutoSIMD &v)
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 AutoSIMD & operator+=(const double &e)
MFEM_ALWAYS_INLINE AutoSIMD & mul(const AutoSIMD &v, const double &e)
MFEM_ALWAYS_INLINE AutoSIMD operator*(const double &e) const