Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-splat-1.c
blob13b72872d74fd0b3ffd82875e331ccc391426741
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 int
9 foo_r (int a)
11 return (vector int) { a, a, a, a }; /* mtvsrws */
14 vector int
15 foo_r2 (int a)
17 return vec_splats (a); /* mtvsrws */
20 vector int
21 foo_p (int *a)
23 return (vector int) { *a, *a, *a, *a }; /* lxvwsx */
26 /* { dg-final { scan-assembler-times "mtvsrws" 2 } } */
27 /* { dg-final { scan-assembler-times "lxvwsx" 1 } } */