[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-shift-short.c
blob4ca7c1802a1ef20e4c27f039f3991d2774fb6874
1 /* Verify that overloaded built-ins for vec_sl with short
2 inputs produce the right results. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-maltivec -O2" } */
8 #include <altivec.h>
10 vector signed short
11 testsl_signed (vector signed short x, vector unsigned short y)
13 return vec_sl (x, y);
16 vector unsigned short
17 testsl_unsigned (vector unsigned short x, vector unsigned short y)
19 return vec_sl (x, y);
22 vector signed short
23 testsr_signed (vector signed short x, vector unsigned short y)
25 return vec_sr (x, y);
28 vector unsigned short
29 testsr_unsigned (vector unsigned short x, vector unsigned short y)
31 return vec_sr (x, y);
34 vector signed short
35 testsra_signed (vector signed short x, vector unsigned short y)
37 return vec_sra (x, y);
40 vector unsigned short
41 testsra_unsigned (vector unsigned short x, vector unsigned short y)
43 return vec_sra (x, y);
46 vector signed short
47 testrl_signed (vector signed short x, vector unsigned short y)
49 return vec_rl (x, y);
52 vector unsigned short
53 testrl_unsigned (vector unsigned short x, vector unsigned short y)
55 return vec_rl (x, y);
58 /* { dg-final { scan-assembler-times "vslh" 2 } } */
59 /* { dg-final { scan-assembler-times "vsrh" 2 } } */
60 /* { dg-final { scan-assembler-times "vsrah" 2 } } */
61 /* { dg-final { scan-assembler-times "vrlh" 2 } } */