12 #ifndef MFEM_SIMD_VSX128_HPP
13 #define MFEM_SIMD_VSX128_HPP
17 #include "../../config/tconfig.hpp"
27 template <
typename,
int,
int>
struct AutoSIMD;
29 template <>
struct AutoSIMD<double,2,16>
32 static constexpr
int size = 2;
50 inline MFEM_ALWAYS_INLINE
const double &
operator[](
int i)
const
69 vd = vec_add(vd,v.vd);
75 vd = vec_add(vd,vec_splats(e));
81 vd = vec_sub(vd,v.vd);
87 vd = vec_sub(vd,vec_splats(e));
93 vd = vec_mul(vd,v.vd);
99 vd = vec_mul(vd,vec_splats(e));
105 vd = vec_div(vd,v.vd);
111 vd = vec_div(vd,vec_splats(e));
121 r.vd = vec_splats(0.0) - vd;
134 r.vd = vec_add(vd,v.vd);
141 r.vd = vec_add(vd, vec_splats(e));
148 r.vd = vec_sub(vd,v.vd);
155 r.vd = vec_sub(vd, vec_splats(e));
162 r.vd = vec_mul(vd,v.vd);
169 r.vd = vec_mul(vd, vec_splats(e));
176 r.vd = vec_div(vd,v.vd);
183 r.vd = vec_div(vd, vec_splats(e));
189 vd = vec_madd(w.vd,vd,v.vd);
195 vd = vec_madd(v.vd,vec_splats(e),vd);
201 vd = vec_madd(vec_splats(e),v.vd,vd);
207 vd = vec_mul(v.vd,w.vd);
213 vd = vec_mul(v.vd,vec_splats(e));
219 vd = vec_mul(vec_splats(e),v.vd);
224 inline MFEM_ALWAYS_INLINE
225 AutoSIMD<double,2,16>
operator+(
const double &e,
226 const AutoSIMD<double,2,16> &v)
228 AutoSIMD<double,2,16> r;
229 r.vd = vec_add(vec_splats(e),v.vd);
233 inline MFEM_ALWAYS_INLINE
234 AutoSIMD<double,2,16>
operator-(
const double &e,
235 const AutoSIMD<double,2,16> &v)
237 AutoSIMD<double,2,16> r;
238 r.vd = vec_sub(vec_splats(e),v.vd);
242 inline MFEM_ALWAYS_INLINE
243 AutoSIMD<double,2,16>
operator*(
const double &e,
244 const AutoSIMD<double,2,16> &v)
246 AutoSIMD<double,2,16> r;
247 r.vd = vec_mul(vec_splats(e),v.vd);
251 inline MFEM_ALWAYS_INLINE
252 AutoSIMD<double,2,16>
operator/(
const double &e,
253 const AutoSIMD<double,2,16> &v)
255 AutoSIMD<double,2,16> r;
256 r.vd = vec_div(vec_splats(e),v.vd);
264 #endif // MFEM_SIMD_VSX128_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