1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-require-effective-target powerpc_altivec_ok } */
3 /* { dg-options "-mdejagnu-cpu=power6 -maltivec" } */
4
5 vector unsigned char
6 foo_char (void)
7 {
8 return (vector unsigned char) {
9 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
10 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
11 };
12 }
13
14 vector unsigned short
15 foo_short (void)
16 {
17 return (vector unsigned short) {
18 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000
19 };
20 }
21
22 vector unsigned int
23 foo_int (void)
24 {
25 return (vector unsigned int) {
26 0x80000000u, 0x80000000u, 0x80000000u, 0x80000000u,
27 };
28 }
29
30 /* { dg-final { scan-assembler-times "vspltisw" 3 } } */
31 /* { dg-final { scan-assembler-times "vslb" 1 } } */
32 /* { dg-final { scan-assembler-times "vslh" 1 } } */
33 /* { dg-final { scan-assembler-times "vslw" 1 } } */