Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/p9-splat-1.c

raw
1 /* { dg-do compile { target lp64 } } */
2 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O2" } */
3 /* { dg-require-effective-target powerpc_vsx } */
4
5 #include <altivec.h>
6
7 vector int
8 foo_r (int a)
9 {
10 return (vector int) { a, a, a, a }; /* mtvsrws */
11 }
12
13 vector int
14 foo_r2 (int a)
15 {
16 return vec_splats (a); /* mtvsrws */
17 }
18
19 vector int
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 } } */