[gcc]
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-shift-left.c
blob36f92b431a4a4b0d45c66fa88e0a50a94f52cb50
1 /* cross section of shift tests specific for shift-left.
2 * This is a counterpart to the fold-vec-shift-left-frwapv test. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-maltivec -O2" } */
8 #include <altivec.h>
10 vector signed char
11 testsl_signed_char (vector signed char x, vector unsigned char y)
13 return vec_sl (x, y);
16 vector unsigned char
17 testsl_unsigned_char (vector unsigned char x, vector unsigned char y)
19 return vec_sl (x, y);
22 vector signed short
23 testsl_signed_short (vector signed short x, vector unsigned short y)
25 return vec_sl (x, y);
28 vector unsigned short
29 testsl_unsigned_short (vector unsigned short x, vector unsigned short y)
31 return vec_sl (x, y);
34 vector signed int
35 testsl_signed_int (vector signed int x, vector unsigned int y)
37 return vec_sl (x, y);
40 vector unsigned int
41 testsl_unsigned_int (vector unsigned int x, vector unsigned int y)
43 return vec_sl (x, y);
46 /* { dg-final { scan-assembler-times "vslb" 2 } } */
47 /* { dg-final { scan-assembler-times "vslh" 2 } } */
48 /* { dg-final { scan-assembler-times "vslw" 2 } } */