1 /* { dg-do compile { target { powerpc64le-*-* } } } */
2 /* { dg-options "-mdejagnu-cpu=power9 -O2" } */
3 /* { dg-require-effective-target powerpc_p9vector_ok } */
4
5 #include <altivec.h>
6
7 vector int
foo_r(int a)8 foo_r (int a)
9 {
10 return (vector int) { a, a, a, a }; /* mtvsrws */
11 }
12
13 vector int
foo_r2(int a)14 foo_r2 (int a)
15 {
16 return vec_splats (a); /* mtvsrws */
17 }
18
19 vector int
foo_p(int * a)20 foo_p (int *a)
21 {
22 return (vector int) { *a, *a, *a, *a }; /* lxvwsx */
23 }
24
25 /* { dg-final { scan-assembler-times "mtvsrws" 2 } } */
26 /* { dg-final { scan-assembler-times "lxvwsx" 1 } } */
27