Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-splat-2.c
blob2468e92dddbe1b56af2a77e8ecd3a04ae2fd4617
1 /* { dg-do compile { target { powerpc64le-*-* } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
3 /* { dg-options "-mcpu=power9 -O2" } */
4 /* { dg-require-effective-target powerpc_p9vector_ok } */
6 #include <altivec.h>
8 vector float
9 foo_r (float a)
11 return (vector float) { a, a, a, a }; /* xscvdpspn/xxspltw */
14 vector float
15 foo_r2 (float a)
17 return vec_splats (a); /* xscvdpspn/xxspltw */
20 vector float
21 foo_g (float *a)
23 float f = *a;
25 __asm__ (" # %0" : "+r" (f));
26 return (vector float) { f, f, f, f }; /* mtvsrws */
29 vector float
30 foo_p (float *a)
32 return (vector float) { *a, *a, *a, *a }; /* lxvwsx */
35 /* { dg-final { scan-assembler-times "xscvdpspn" 2 } } */
36 /* { dg-final { scan-assembler-times "xxspltw" 2 } } */
37 /* { dg-final { scan-assembler-times "mtvsrws" 1 } } */
38 /* { dg-final { scan-assembler-times "lxvwsx" 1 } } */