Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/fold-vec-shift-left.c

raw
1 /* cross section of shift tests specific for shift-left.
2 * This is a counterpart to the fold-vec-shift-left-frwapv test. */
3
4 /* { dg-do compile } */
5 /* { dg-options "-maltivec -O2" } */
6 /* { dg-require-effective-target powerpc_altivec } */
7
8 #include <altivec.h>
9
10 vector signed char
11 testsl_signed_char (vector signed char x, vector unsigned char y)
12 {
13 return vec_sl (x, y);
14 }
15
16 vector unsigned char
17 testsl_unsigned_char (vector unsigned char x, vector unsigned char y)
18 {
19 return vec_sl (x, y);
20 }
21
22 vector signed short
23 testsl_signed_short (vector signed short x, vector unsigned short y)
24 {
25 return vec_sl (x, y);
26 }
27
28 vector unsigned short
29 testsl_unsigned_short (vector unsigned short x, vector unsigned short y)
30 {
31 return vec_sl (x, y);
32 }
33
34 vector signed int
35 testsl_signed_int (vector signed int x, vector unsigned int y)
36 {
37 return vec_sl (x, y);
38 }
39
40 vector unsigned int
41 testsl_unsigned_int (vector unsigned int x, vector unsigned int y)
42 {
43 return vec_sl (x, y);
44 }
45
46 /* { dg-final { scan-assembler-times "vslb" 2 } } */
47 /* { dg-final { scan-assembler-times "vslh" 2 } } */
48 /* { dg-final { scan-assembler-times "vslw" 2 } } */