[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr101384-1.c
blob41cf84bf8bcf478e1550c5ab17880655578c8a83
1 /* PR target/101384 */
2 /* { dg-do compile { target le } } */
3 /* { dg-options "-O2 -maltivec" } */
4 /* { dg-require-effective-target powerpc_altivec_ok } */
5 /* { dg-final { scan-assembler-times {\mvspltis[whb] [^\n\r]*,-1\M|\mxxspltib[^\n\r]*,255\M} 9 } } */
6 /* { dg-final { scan-assembler-times {\mvslw\M} 3 } } */
7 /* { dg-final { scan-assembler-times {\mvslh\M} 3 } } */
8 /* { dg-final { scan-assembler-times {\mvslb\M} 3 } } */
10 typedef unsigned char __attribute__((__vector_size__ (16))) U;
11 typedef unsigned short __attribute__((__vector_size__ (16))) V;
12 typedef unsigned int __attribute__((__vector_size__ (16))) W;
14 U u;
15 V v;
16 W w;
19 f1 (void)
21 U y = (U) { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 } + u;
22 return y;
26 f2 (void)
28 U y = (U) { 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80, 0, 0x80 } + u;
29 return y;
33 f3 (void)
35 U y = (U) { 0, 0, 0, 0x80, 0, 0, 0, 0x80, 0, 0, 0, 0x80, 0, 0, 0, 0x80 } + u;
36 return y;
40 f4 (void)
42 V y = (V) { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 } + v;
43 return y;
47 f5 (void)
49 V y = (V) { 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000 } + v;
50 return y;
54 f6 (void)
56 V y = (V) { 0, 0x8000, 0, 0x8000, 0, 0x8000, 0, 0x8000 } + v;
57 return y;
61 f7 (void)
63 W y = (W) { 0x80808080, 0x80808080, 0x80808080, 0x80808080 } + w;
64 return y;
68 f8 (void)
70 W y = (W) { 0x80008000, 0x80008000, 0x80008000, 0x80008000 } + w;
71 return y;
75 f9 (void)
77 W y = (W) { 0x80000000, 0x80000000, 0x80000000, 0x80000000 } + w;
78 return y;