middle-end: also optimized `popcount(a) <= 1` [PR90693]
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-splat-1.c
blob9502384cce02beb5bef61b2f118be004443ae154
1 /* { dg-do compile { target lp64 } } */
2 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O2" } */
3 /* { dg-require-effective-target powerpc_vsx } */
5 #include <altivec.h>
7 vector int
8 foo_r (int a)
10 return (vector int) { a, a, a, a }; /* mtvsrws */
13 vector int
14 foo_r2 (int a)
16 return vec_splats (a); /* mtvsrws */
19 vector int
20 foo_p (int *a)
22 return (vector int) { *a, *a, *a, *a }; /* lxvwsx */
25 /* { dg-final { scan-assembler-times "mtvsrws" 2 } } */
26 /* { dg-final { scan-assembler-times "lxvwsx" 1 } } */