21 #ifndef _libint2_src_lib_libint_vectorppc_h_ 22 #define _libint2_src_lib_libint_vectorppc_h_ 24 #include <libint2/util/type_traits.h> 27 #if defined(__clang__) && defined(__bgq__) 28 # include <qpxintrin.h> 31 #ifdef __VECTOR4DOUBLE__ 33 namespace libint2 {
namespace simd {
67 T a[4]; a[0] = a0; a[1] = a1; a[2] = a2; a[3] = a3;
86 operator double()
const {
87 double d0 = vec_extract(d, 0);
91 void convert(
double(&a)[4])
const {
98 inline VectorQPXDouble
operator*(
double a, VectorQPXDouble b) {
100 VectorQPXDouble _a(a);
101 c.d = vec_mul(_a.d, b.d);
105 inline VectorQPXDouble
operator*(VectorQPXDouble a,
double b) {
107 VectorQPXDouble _b(b);
108 c.d = vec_mul(a.d, _b.d);
112 inline VectorQPXDouble
operator*(
int a, VectorQPXDouble b) {
117 VectorQPXDouble _a((
double)a);
118 c.d = vec_mul(_a.d, b.d);
123 inline VectorQPXDouble
operator*(VectorQPXDouble a,
int b) {
128 VectorQPXDouble _b((
double)b);
129 c.d = vec_mul(a.d, _b.d);
134 inline VectorQPXDouble
operator*(VectorQPXDouble a, VectorQPXDouble b) {
136 c.d = vec_mul(a.d, b.d);
140 inline VectorQPXDouble operator+(VectorQPXDouble a, VectorQPXDouble b) {
142 c.d = vec_add(a.d, b.d);
146 inline VectorQPXDouble operator-(VectorQPXDouble a, VectorQPXDouble b) {
148 c.d = vec_sub(a.d, b.d);
152 inline VectorQPXDouble operator/(VectorQPXDouble a, VectorQPXDouble b) {
154 c.d = vec_swdiv(a.d, b.d);
158 inline VectorQPXDouble
fma_plus(VectorQPXDouble a, VectorQPXDouble b, VectorQPXDouble c) {
160 d.d = vec_madd(a.d, b.d, c.d);
163 inline VectorQPXDouble
fma_minus(VectorQPXDouble a, VectorQPXDouble b, VectorQPXDouble c) {
165 d.d = vec_msub(a.d, b.d, c.d);
179 static const bool value =
true;
184 typedef double scalar_type;
185 static const size_t extent = 4;
195 #if (defined(__xlC__) || defined(__clang__)) && (defined(__bgp__) || defined(__blrts__)) 198 # include <builtins.h> 200 #if defined(__clang__) 201 # include <fp2intrin.h> 204 namespace libint2 {
namespace simd {
224 T a01[2]; a01[0] = a; a01[1] = a;
239 T a[2]; a[0] = a0; a[1] = a1;
244 T a01[2]; a01[0] = a; a01[1] = a;
259 operator double()
const {
260 double d0 = __creal(d);
264 void convert(
double(&a)[2])
const {
270 inline VectorFP2Double
operator*(
double a, VectorFP2Double b) {
272 c.d = __fxpmul(b.d, a);
276 inline VectorFP2Double
operator*(VectorFP2Double a,
double b) {
278 c.d = __fxpmul(a.d, b);
282 inline VectorFP2Double
operator*(
int a, VectorFP2Double b) {
287 c.d = __fxpmul(b.d, (
double)a);
292 inline VectorFP2Double
operator*(VectorFP2Double a,
int b) {
297 c.d = __fxpmul(a.d, (
double)b);
302 inline VectorFP2Double
operator*(VectorFP2Double a, VectorFP2Double b) {
304 c.d = __fpmul(a.d, b.d);
308 inline VectorFP2Double operator+(VectorFP2Double a, VectorFP2Double b) {
310 c.d = __fpadd(a.d, b.d);
314 inline VectorFP2Double operator-(VectorFP2Double a, VectorFP2Double b) {
316 c.d = __fpsub(a.d, b.d);
326 inline VectorFP2Double
fma_plus(VectorFP2Double a, VectorFP2Double b, VectorFP2Double c) {
328 d.d = __fpmadd(a.d, b.d, c.d);
331 inline VectorFP2Double
fma_minus(VectorFP2Double a, VectorFP2Double b, VectorFP2Double c) {
333 d.d = __fpmsub(a.d, b.d, c.d);
347 static const bool value =
true;
352 typedef double scalar_type;
353 static const size_t extent = 2;
362 #endif // header guard VectorFP2Double(T(&a)[2])
creates a vector of values initialized by an ordinary static-sized array
Definition: vector_ppc.h:231
Definition: type_traits.h:34
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
VectorQPXDouble(T a)
Initializes all elements to the same value.
Definition: vector_ppc.h:52
SafePtr< CTimeEntity< typename ProductType< T, U >::result > > operator*(const SafePtr< CTimeEntity< T > > &A, const SafePtr< CTimeEntity< U > > &B)
Creates product A*B.
Definition: entity.h:280
VectorFP2Double()
creates a vector of default-initialized values.
Definition: vector_ppc.h:218
auto fma_plus(X x, Y y, Z z) -> decltype(x *y+z)
Definition: intrinsic_operations.h:36
VectorQPXDouble(T a0, T a1, T a2, T a3)
creates a vector of values initialized by an ordinary static-sized array
Definition: vector_ppc.h:66
VectorQPXDouble(T(&a)[4])
creates a vector of values initialized by an ordinary static-sized array
Definition: vector_ppc.h:59
SIMD vector of 4 double-precision floating-point real numbers, operations on which use QPX instructio...
Definition: vector_ppc.h:39
VectorQPXDouble()
creates a vector of default-initialized values.
Definition: vector_ppc.h:47
SIMD vector of 2 double-precision floating-point real numbers, operations on which use FP2 (Double Hu...
Definition: vector_ppc.h:210
Definition: type_traits.h:29
VectorFP2Double(T a)
Initializes all elements to the same value.
Definition: vector_ppc.h:223
VectorFP2Double(T a0, T a1)
creates a vector of values initialized by an ordinary static-sized array
Definition: vector_ppc.h:238
auto fma_minus(X x, Y y, Z z) -> decltype(x *y-z)
Definition: intrinsic_operations.h:42