2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / direct-move-vector.c
blob1e8504ec66c1e86c4a6a8362e7b86f2387a5405a
1 /* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2 /* { dg-require-effective-target powerpc_p9vector_ok } */
3 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
4 /* { dg-options "-mcpu=power9 -O2" } */
6 /* Check code generation for direct move for long types. */
8 void
9 test (vector double *p)
11 vector double v1 = *p;
12 vector double v2;
13 vector double v3;
14 vector double v4;
16 /* Force memory -> FPR load. */
17 __asm__ (" # reg %x0" : "+d" (v1));
19 /* force VSX -> GPR direct move. */
20 v2 = v1;
21 __asm__ (" # reg %0" : "+r" (v2));
23 /* Force GPR -> Altivec direct move. */
24 v3 = v2;
25 __asm__ (" # reg %x0" : "+v" (v3));
26 *p = v3;
29 /* { dg-final { scan-assembler "mfvsrd" } } */
30 /* { dg-final { scan-assembler "mfvsrld" } } */
31 /* { dg-final { scan-assembler "mtvsrdd" } } */