QDP++
sse_blas_vaypx4_double.cc
Go to the documentation of this file.
1
6
8#include <xmmintrin.h>
9
10namespace QDP {
11
12
13void vaypx4(REAL64 *Out,REAL64 *scalep,REAL64 *InScale, int n_4spin)
14{
15 __m128d scalar;
16 __m128d tmp1;
17 __m128d tmp2;
18 __m128d tmp3;
19 __m128d in1;
20 __m128d add1;
21 __m128d in2;
22 __m128d add2;
23 __m128d in3;
24 __m128d add3;
25 __m128d in4;
26 __m128d add4;
27 __m128d out1;
28 __m128d out2;
29 __m128d out3;
30
31 // Load the scalar into low bytes of scalar
32 scalar = _mm_load_sd(scalep);
33
34 // cross components into tmp
35 // Zero tmp
36 tmp1 = _mm_setzero_pd();
37 tmp1 = _mm_shuffle_pd(scalar, scalar, 0x1);
38 scalar = _mm_add_pd(scalar, tmp1);
39
40 double *in_p=InScale;
41 double *out_p=Out;
42
43
44 // We are dealing with n_4 spin 4spinor.
45 // 4 spinors
46
47 for(int i=0; i < 4*3*2*n_4spin; i+=2) {
48 add1 = _mm_load_pd(out_p+i);
49 in1 = _mm_load_pd(in_p+i);
50 tmp1 = _mm_mul_pd(scalar, add1);
51 out1 = _mm_add_pd(tmp1,in1);
52 _mm_store_pd(out_p+i, out1);
53
54 }
55}
56
57
58
59
60} // namespace QDP;
61
double REAL64
Yet another random number generator.
void vaypx4(REAL64 *Out, REAL64 *scalep, REAL64 *InScale, int n_4spin)
Generic Scalar VAXPY routine.