[committed][RISC-V][PR target/114139] Verify we have a CONST_INT before extracting...
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-shift-longlong.c
blobfb626331be789d4f3a67daa2016fcf0235c1bcd3
1 /* Verify that overloaded built-ins for vec_sl with long long
2 inputs produce the right results. */
4 /* { dg-do compile } */
5 /* { dg-options "-mvsx -O2" } */
6 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
7 /* { dg-require-effective-target powerpc_vsx } */
9 #include <altivec.h>
11 vector signed long long
12 testsl_signed (vector signed long long x, vector unsigned long long y)
14 return vec_sl (x, y);
17 vector unsigned long long
18 testsl_unsigned (vector unsigned long long x, vector unsigned long long y)
20 return vec_sl (x, y);
23 vector signed long long
24 testsr_signed (vector signed long long x, vector unsigned long long y)
26 return vec_sr (x, y);
29 vector unsigned long long
30 testsr_unsigned (vector unsigned long long x, vector unsigned long long y)
32 return vec_sr (x, y);
35 vector signed long long
36 testsra_signed (vector signed long long x, vector unsigned long long y)
38 return vec_sra (x, y);
41 /* watch for PR 79544 here (vsrd / vsrad issue) */
42 vector unsigned long long
43 testsra_unsigned (vector unsigned long long x, vector unsigned long long y)
45 return vec_sra (x, y);
48 vector signed long long
49 testrl_signed (vector signed long long x, vector unsigned long long y)
51 return vec_rl (x, y);
54 vector unsigned long long
55 testrl_unsigned (vector unsigned long long x, vector unsigned long long y)
57 return vec_rl (x, y);
60 /* { dg-final { scan-assembler-times "vsld" 2 } } */
61 /* { dg-final { scan-assembler-times "vsrd" 2 } } */
62 /* { dg-final { scan-assembler-times "vsrad" 2 } } */
63 /* { dg-final { scan-assembler-times "vrld" 2 } } */