QDP++
generic_blas_vaypx3_g5.h
Go to the documentation of this file.
1// $Id: generic_blas_vaypx3_g5.h,v 1.2 2007-06-10 14:32:10 edwards Exp $
2
7
8#ifndef QDP_GENERIC_BLAS_VAYPX3_G5
9#define QDP_GENERIC_BLAS_VAYPX3_G5
10
11namespace QDP {
12
13// (Vector) out = (Vector) Add + (Scalar) (*scalep) * (Vector) P{+} InScale
14inline
15void xpayz_g5ProjPlus(REAL *Out,REAL *scalep,REAL *Add, REAL *InScale,int n_4vec)
16{
17 double a;
18 double x0r;
19 double x0i;
20
21 double x1r;
22 double x1i;
23
24 double x2r;
25 double x2i;
26
27 double y0r;
28 double y0i;
29
30 double y1r;
31 double y1i;
32
33 double y2r;
34 double y2i;
35
36 double z0r;
37 double z0i;
38
39 double z1r;
40 double z1i;
41
42 double z2r;
43 double z2i;
44
45 a = *scalep;
46
47 int index_x = 0;
48 int index_y = 0;
49 int index_z = 0;
50
51 int counter;
52
53 for( counter = 0; counter < n_4vec; counter++) {
54 // Spin Component 0 (AYPX)
55 x0r = (double)Add[index_x++];
56 y0r = (double)InScale[index_y++];
57 z0r = x0r + a*y0r;
58 Out[index_z++] =(REAL) z0r;
59
60 x0i = (double)Add[index_x++];
61 y0i = (double)InScale[index_y++];
62 z0i = x0i + a*y0i;
63 Out[index_z++] =(REAL) z0i;
64
65 x1r = (double)Add[index_x++];
66 y1r = (double)InScale[index_y++];
67 z1r = x1r + a*y1r;
68 Out[index_z++] = (REAL)z1r;
69
70 x1i = (double)Add[index_x++];
71 y1i = (double)InScale[index_y++];
72 z1i = x1i + a*y1i;
73 Out[index_z++] = (REAL)z1i;
74
75 x2r = (double)Add[index_x++];
76 y2r = (double)InScale[index_y++];
77 z2r = x2r + a*y2r;
78 Out[index_z++] = (REAL)z2r;
79
80 x2i = (double)Add[index_x++];
81 y2i = (double)InScale[index_y++];
82 z2i = x2i + a*y2i;
83 Out[index_z++] = (REAL)z2i;
84
85 // Spin Component 1 (AYPX)
86 x0r = (double)Add[index_x++];
87 y0r = (double)InScale[index_y++];
88 z0r = x0r + a*y0r;
89 Out[index_z++] =(REAL) z0r;
90
91 x0i = (double)Add[index_x++];
92 y0i = (double)InScale[index_y++];
93 z0i = x0i + a*y0i;
94 Out[index_z++] =(REAL) z0i;
95
96 x1r = (double)Add[index_x++];
97 y1r = (double)InScale[index_y++];
98 z1r = x1r + a*y1r;
99 Out[index_z++] = (REAL)z1r;
100
101 x1i = (double)Add[index_x++];
102 y1i = (double)InScale[index_y++];
103 z1i = x1i + a*y1i;
104 Out[index_z++] = (REAL)z1i;
105
106 x2r = (double)Add[index_x++];
107 y2r = (double)InScale[index_y++];
108 z2r = x2r + a*y2r;
109 Out[index_z++] = (REAL)z2r;
110
111 x2i = (double)Add[index_x++];
112 y2i = (double)InScale[index_y++];
113 z2i = x2i + a*y2i;
114 Out[index_z++] = (REAL)z2i;
115
116 index_y +=12; // Skip 2 color vecs (3x2x2=12)
117
118 // 2 spin components: Copy...
119
120 x0r = (double)Add[index_x++];
121 x0i = (double)Add[index_x++];
122 x1r = (double)Add[index_x++];
123 Out[index_z++] =(REAL) x0r;
124 x1i = (double)Add[index_x++];
125 Out[index_z++] =(REAL) x0i;
126 x2r = (double)Add[index_x++];
127 Out[index_z++] =(REAL) x1r;
128 x2i = (double)Add[index_x++];
129 Out[index_z++] =(REAL) x1i;
130 x0r = (double)Add[index_x++];
131 Out[index_z++] =(REAL) x2r;
132 x0i = (double)Add[index_x++];
133 Out[index_z++] =(REAL) x2i;
134 x1r = (double)Add[index_x++];
135 Out[index_z++] =(REAL) x0r;
136 x1i = (double)Add[index_x++];
137 Out[index_z++] =(REAL) x0i;
138 x2r = (double)Add[index_x++];
139 Out[index_z++] =(REAL) x1r;
140 x2i = (double)Add[index_x++];
141 Out[index_z++] =(REAL) x1i;
142
143 // Cache pulls
144 x0r = (double)Add[index_x];
145 Out[index_z++] =(REAL) x2r;
146 x0i = (double)Add[index_x+1];
147 Out[index_z++] =(REAL) x2i;
148
149
150 }
151}
152
153inline
154void xpayz_g5ProjMinus(REAL *Out,REAL *scalep,REAL *Add, REAL *InScale,int n_4vec)
155{
156 double a;
157 double x0r;
158 double x0i;
159
160 double x1r;
161 double x1i;
162
163 double x2r;
164 double x2i;
165
166 double y0r;
167 double y0i;
168
169 double y1r;
170 double y1i;
171
172 double y2r;
173 double y2i;
174
175 double z0r;
176 double z0i;
177
178 double z1r;
179 double z1i;
180
181 double z2r;
182 double z2i;
183
184 a = *scalep;
185
186 int index_x = 0;
187 int index_y = 0;
188 int index_z = 0;
189
190 int counter;
191
192 for( counter = 0; counter < n_4vec; counter++) {
193 index_y += 12;
194
195 // 2 spin components: Copy...
196 x0r = (double)Add[index_x++];
197 x0i = (double)Add[index_x++];
198 x1r = (double)Add[index_x++];
199 Out[index_z++] =(REAL) x0r;
200 x1i = (double)Add[index_x++];
201 Out[index_z++] =(REAL) x0i;
202 x2r = (double)Add[index_x++];
203 Out[index_z++] =(REAL) x1r;
204 x2i = (double)Add[index_x++];
205 Out[index_z++] =(REAL) x1i;
206 x0r = (double)Add[index_x++];
207 Out[index_z++] =(REAL) x2r;
208 x0i = (double)Add[index_x++];
209 Out[index_z++] =(REAL) x2i;
210 x1r = (double)Add[index_x++];
211 Out[index_z++] =(REAL) x0r;
212 x1i = (double)Add[index_x++];
213 Out[index_z++] =(REAL) x0i;
214 x2r = (double)Add[index_x++];
215 Out[index_z++] =(REAL) x1r;
216 x2i = (double)Add[index_x++];
217 Out[index_z++] =(REAL) x1i;
218
219 // Prefetch
220 x0r = (double)Add[index_x++];
221 Out[index_z++] =(REAL) x2r;
222 x0i = (double)Add[index_x++];
223 Out[index_z++] =(REAL) x2i;
224
225 // Spin Component 0 (AYPX)
226 y0r = (double)InScale[index_y++];
227 z0r = x0r + a*y0r;
228 Out[index_z++] =(REAL) z0r;
229
230 y0i = (double)InScale[index_y++];
231 z0i = x0i + a*y0i;
232 Out[index_z++] =(REAL) z0i;
233
234 x1r = (double)Add[index_x++];
235 y1r = (double)InScale[index_y++];
236 z1r = x1r + a*y1r;
237 Out[index_z++] = (REAL)z1r;
238
239 x1i = (double)Add[index_x++];
240 y1i = (double)InScale[index_y++];
241 z1i = x1i + a*y1i;
242 Out[index_z++] = (REAL)z1i;
243
244 x2r = (double)Add[index_x++];
245 y2r = (double)InScale[index_y++];
246 z2r = x2r + a*y2r;
247 Out[index_z++] = (REAL)z2r;
248
249 x2i = (double)Add[index_x++];
250 y2i = (double)InScale[index_y++];
251 z2i = x2i + a*y2i;
252 Out[index_z++] = (REAL)z2i;
253
254 // Spin Component 1 (AYPX)
255 x0r = (double)Add[index_x++];
256 y0r = (double)InScale[index_y++];
257 z0r = x0r + a*y0r;
258 Out[index_z++] =(REAL) z0r;
259
260 x0i = (double)Add[index_x++];
261 y0i = (double)InScale[index_y++];
262 z0i = x0i + a*y0i;
263 Out[index_z++] =(REAL) z0i;
264
265 x1r = (double)Add[index_x++];
266 y1r = (double)InScale[index_y++];
267 z1r = x1r + a*y1r;
268 Out[index_z++] = (REAL)z1r;
269
270 x1i = (double)Add[index_x++];
271 y1i = (double)InScale[index_y++];
272 z1i = x1i + a*y1i;
273 Out[index_z++] = (REAL)z1i;
274
275 x2r = (double)Add[index_x++];
276 y2r = (double)InScale[index_y++];
277 z2r = x2r + a*y2r;
278 Out[index_z++] = (REAL)z2r;
279
280 x2i = (double)Add[index_x++];
281 y2i = (double)InScale[index_y++];
282 z2i = x2i + a*y2i;
283 Out[index_z++] = (REAL)z2i;
284
285
286 }
287}
288
289
290// (Vector) out = (Vector) Add + (Scalar) (*scalep) * (Vector) P{+} InScale
291inline
292void xmayz_g5ProjPlus(REAL *Out,REAL *scalep,REAL *Add, REAL *InScale,int n_4vec)
293{
294 double a;
295 double x0r;
296 double x0i;
297
298 double x1r;
299 double x1i;
300
301 double x2r;
302 double x2i;
303
304 double y0r;
305 double y0i;
306
307 double y1r;
308 double y1i;
309
310 double y2r;
311 double y2i;
312
313 double z0r;
314 double z0i;
315
316 double z1r;
317 double z1i;
318
319 double z2r;
320 double z2i;
321
322 a = *scalep;
323
324 int index_x = 0;
325 int index_y = 0;
326 int index_z = 0;
327
328 int counter;
329
330 for( counter = 0; counter < n_4vec; counter++) {
331 // Spin Component 0 (AYPX)
332 x0r = (double)Add[index_x++];
333 y0r = (double)InScale[index_y++];
334 z0r = x0r - a*y0r;
335 Out[index_z++] =(REAL) z0r;
336
337 x0i = (double)Add[index_x++];
338 y0i = (double)InScale[index_y++];
339 z0i = x0i - a*y0i;
340 Out[index_z++] =(REAL) z0i;
341
342 x1r = (double)Add[index_x++];
343 y1r = (double)InScale[index_y++];
344 z1r = x1r - a*y1r;
345 Out[index_z++] = (REAL)z1r;
346
347 x1i = (double)Add[index_x++];
348 y1i = (double)InScale[index_y++];
349 z1i = x1i - a*y1i;
350 Out[index_z++] = (REAL)z1i;
351
352 x2r = (double)Add[index_x++];
353 y2r = (double)InScale[index_y++];
354 z2r = x2r - a*y2r;
355 Out[index_z++] = (REAL)z2r;
356
357 x2i = (double)Add[index_x++];
358 y2i = (double)InScale[index_y++];
359 z2i = x2i - a*y2i;
360 Out[index_z++] = (REAL)z2i;
361
362 // Spin Component 1 (AYPX)
363 x0r = (double)Add[index_x++];
364 y0r = (double)InScale[index_y++];
365 z0r = x0r - a*y0r;
366 Out[index_z++] =(REAL) z0r;
367
368 x0i = (double)Add[index_x++];
369 y0i = (double)InScale[index_y++];
370 z0i = x0i - a*y0i;
371 Out[index_z++] =(REAL) z0i;
372
373 x1r = (double)Add[index_x++];
374 y1r = (double)InScale[index_y++];
375 z1r = x1r - a*y1r;
376 Out[index_z++] = (REAL)z1r;
377
378 x1i = (double)Add[index_x++];
379 y1i = (double)InScale[index_y++];
380 z1i = x1i - a*y1i;
381 Out[index_z++] = (REAL)z1i;
382
383 x2r = (double)Add[index_x++];
384 y2r = (double)InScale[index_y++];
385 z2r = x2r - a*y2r;
386 Out[index_z++] = (REAL)z2r;
387
388 x2i = (double)Add[index_x++];
389 y2i = (double)InScale[index_y++];
390 z2i = x2i - a*y2i;
391 Out[index_z++] = (REAL)z2i;
392
393 index_y +=12; // Skip 2 color vecs (3x2x2=12)
394
395 // 2 spin components: Copy...
396
397 x0r = (double)Add[index_x++];
398 x0i = (double)Add[index_x++];
399 x1r = (double)Add[index_x++];
400 Out[index_z++] =(REAL) x0r;
401 x1i = (double)Add[index_x++];
402 Out[index_z++] =(REAL) x0i;
403 x2r = (double)Add[index_x++];
404 Out[index_z++] =(REAL) x1r;
405 x2i = (double)Add[index_x++];
406 Out[index_z++] =(REAL) x1i;
407 x0r = (double)Add[index_x++];
408 Out[index_z++] =(REAL) x2r;
409 x0i = (double)Add[index_x++];
410 Out[index_z++] =(REAL) x2i;
411 x1r = (double)Add[index_x++];
412 Out[index_z++] =(REAL) x0r;
413 x1i = (double)Add[index_x++];
414 Out[index_z++] =(REAL) x0i;
415 x2r = (double)Add[index_x++];
416 Out[index_z++] =(REAL) x1r;
417 x2i = (double)Add[index_x++];
418 Out[index_z++] =(REAL) x1i;
419
420 // Cache pulls
421 x0r = (double)Add[index_x];
422 Out[index_z++] =(REAL) x2r;
423 x0i = (double)Add[index_x+1];
424 Out[index_z++] =(REAL) x2i;
425
426
427 }
428}
429
430inline
431void xmayz_g5ProjMinus(REAL *Out,REAL *scalep,REAL *Add, REAL *InScale,int n_4vec)
432{
433 double a;
434 double x0r;
435 double x0i;
436
437 double x1r;
438 double x1i;
439
440 double x2r;
441 double x2i;
442
443 double y0r;
444 double y0i;
445
446 double y1r;
447 double y1i;
448
449 double y2r;
450 double y2i;
451
452 double z0r;
453 double z0i;
454
455 double z1r;
456 double z1i;
457
458 double z2r;
459 double z2i;
460
461 a = *scalep;
462
463 int index_x = 0;
464 int index_y = 0;
465 int index_z = 0;
466
467 int counter;
468
469 for( counter = 0; counter < n_4vec; counter++) {
470 index_y += 12;
471
472 // 2 spin components: Copy...
473 x0r = (double)Add[index_x++];
474 x0i = (double)Add[index_x++];
475 x1r = (double)Add[index_x++];
476 Out[index_z++] =(REAL) x0r;
477 x1i = (double)Add[index_x++];
478 Out[index_z++] =(REAL) x0i;
479 x2r = (double)Add[index_x++];
480 Out[index_z++] =(REAL) x1r;
481 x2i = (double)Add[index_x++];
482 Out[index_z++] =(REAL) x1i;
483 x0r = (double)Add[index_x++];
484 Out[index_z++] =(REAL) x2r;
485 x0i = (double)Add[index_x++];
486 Out[index_z++] =(REAL) x2i;
487 x1r = (double)Add[index_x++];
488 Out[index_z++] =(REAL) x0r;
489 x1i = (double)Add[index_x++];
490 Out[index_z++] =(REAL) x0i;
491 x2r = (double)Add[index_x++];
492 Out[index_z++] =(REAL) x1r;
493 x2i = (double)Add[index_x++];
494 Out[index_z++] =(REAL) x1i;
495
496 // Prefetch
497 x0r = (double)Add[index_x++];
498 Out[index_z++] =(REAL) x2r;
499 x0i = (double)Add[index_x++];
500 Out[index_z++] =(REAL) x2i;
501
502 // Spin Component 0 (AYPX)
503 y0r = (double)InScale[index_y++];
504 z0r = x0r - a*y0r;
505 Out[index_z++] =(REAL) z0r;
506
507 y0i = (double)InScale[index_y++];
508 z0i = x0i - a*y0i;
509 Out[index_z++] =(REAL) z0i;
510
511 x1r = (double)Add[index_x++];
512 y1r = (double)InScale[index_y++];
513 z1r = x1r - a*y1r;
514 Out[index_z++] = (REAL)z1r;
515
516 x1i = (double)Add[index_x++];
517 y1i = (double)InScale[index_y++];
518 z1i = x1i - a*y1i;
519 Out[index_z++] = (REAL)z1i;
520
521 x2r = (double)Add[index_x++];
522 y2r = (double)InScale[index_y++];
523 z2r = x2r - a*y2r;
524 Out[index_z++] = (REAL)z2r;
525
526 x2i = (double)Add[index_x++];
527 y2i = (double)InScale[index_y++];
528 z2i = x2i - a*y2i;
529 Out[index_z++] = (REAL)z2i;
530
531 // Spin Component 1 (AYPX)
532 x0r = (double)Add[index_x++];
533 y0r = (double)InScale[index_y++];
534 z0r = x0r - a*y0r;
535 Out[index_z++] =(REAL) z0r;
536
537 x0i = (double)Add[index_x++];
538 y0i = (double)InScale[index_y++];
539 z0i = x0i - a*y0i;
540 Out[index_z++] =(REAL) z0i;
541
542 x1r = (double)Add[index_x++];
543 y1r = (double)InScale[index_y++];
544 z1r = x1r - a*y1r;
545 Out[index_z++] = (REAL)z1r;
546
547 x1i = (double)Add[index_x++];
548 y1i = (double)InScale[index_y++];
549 z1i = x1i - a*y1i;
550 Out[index_z++] = (REAL)z1i;
551
552 x2r = (double)Add[index_x++];
553 y2r = (double)InScale[index_y++];
554 z2r = x2r - a*y2r;
555 Out[index_z++] = (REAL)z2r;
556
557 x2i = (double)Add[index_x++];
558 y2i = (double)InScale[index_y++];
559 z2i = x2i - a*y2i;
560 Out[index_z++] = (REAL)z2i;
561
562
563 }
564}
565
566
567
568
569} // namespace QDP;
570
571#endif // guard
REAL32 REAL
Yet another random number generator.
void xmayz_g5ProjPlus(REAL *Out, REAL *scalep, REAL *Add, REAL *InScale, int n_4vec)
void xpayz_g5ProjMinus(REAL *Out, REAL *scalep, REAL *Add, REAL *InScale, int n_4vec)
void xmayz_g5ProjMinus(REAL *Out, REAL *scalep, REAL *Add, REAL *InScale, int n_4vec)
void xpayz_g5ProjPlus(REAL *Out, REAL *scalep, REAL *Add, REAL *InScale, int n_4vec)