Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-splat-2.c
blobec0cb92002e3e104e02f1559409c5479c18db9d8
1 /* { dg-do compile } */
2 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O2" } */
3 /* { dg-require-effective-target powerpc_vsx } */
5 #include <altivec.h>
7 vector float
8 foo_r (float a)
10 return (vector float) { a, a, a, a }; /* xscvdpspn/xxspltw */
13 vector float
14 foo_r2 (float a)
16 return vec_splats (a); /* xscvdpspn/xxspltw */
19 vector float
20 foo_g (float *a)
22 float f = *a;
24 __asm__ (" # %0" : "+r" (f));
25 return (vector float) { f, f, f, f }; /* mtvsrws */
28 vector float
29 foo_p (float *a)
31 return (vector float) { *a, *a, *a, *a }; /* lxvwsx */
34 /* { dg-final { scan-assembler-times "xscvdpspn" 2 } } */
35 /* { dg-final { scan-assembler-times "xxspltw" 2 } } */
36 /* { dg-final { scan-assembler-times "mtvsrws" 1 } } */
37 /* { dg-final { scan-assembler-times "lxvwsx" 1 } } */