Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr67071-3.c
blob470afb787a4ed99b39dcc348a8090f90cf08b68b
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-require-effective-target powerpc_altivec_ok } */
3 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power6" } } */
4 /* { dg-options "-mcpu=power6 -maltivec" } */
7 vector unsigned char
8 foo_char (void)
10 return (vector unsigned char) {
11 #if __VEC_ELEMENT_REG_ORDER__ == __ORDER_BIG_ENDIAN__
12 0x80, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
13 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
14 #else
15 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
16 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x80
17 #endif
21 vector unsigned short
22 foo_short (void)
24 return (vector unsigned short) {
25 #if __VEC_ELEMENT_REG_ORDER__ == __ORDER_BIG_ENDIAN__
26 0x8000, 0x8000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
27 #else
28 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x8000, 0x8000
29 #endif
33 vector unsigned int
34 foo_int (void)
36 return (vector unsigned int) {
37 #if __VEC_ELEMENT_REG_ORDER__ == __ORDER_BIG_ENDIAN__
38 0x80000000u, 0x80000000u, 0xffffffffu, 0xffffffffu,
39 #else
40 0xffffffffu, 0xffffffffu, 0x80000000u, 0x80000000u,
41 #endif
45 /* { dg-final { scan-assembler-times "vslb" 1 } } */
46 /* { dg-final { scan-assembler-times "vslh" 1 } } */
47 /* { dg-final { scan-assembler-times "vslw" 1 } } */
48 /* { dg-final { scan-assembler-times "vsldoi" 3 } } */