[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-mergehl-char.c
blob1762603ec7fe43a7d292d1678134ec27dc087dd2
1 /* Verify that overloaded built-ins for vec_merge* with char
2 inputs produce the right code. */
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 test_misc () {
12 vector signed char vsc1c = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
13 vector signed char vsc2c = {9,10,11,12,13,14,15,16,0,1,2,3,4,5,6,7};
14 return vec_mergel (vsc1c, vsc2c);
17 vector bool char
18 testbc_l (vector bool char vbc2, vector bool char vbc3)
20 return vec_mergel (vbc2, vbc3);
23 vector signed char
24 testsc_l (vector signed char vsc2, vector signed char vsc3)
26 return vec_mergel (vsc2, vsc3);
29 vector unsigned char
30 testuc_l (vector unsigned char vuc2, vector unsigned char vuc3)
32 return vec_mergel (vuc2, vuc3);
35 vector bool char
36 testbc_h (vector bool char vbc2, vector bool char vbc3)
38 return vec_mergeh (vbc2, vbc3);
41 vector signed char
42 testsc_h (vector signed char vsc2, vector signed char vsc3)
44 return vec_mergeh (vsc2, vsc3);
47 vector unsigned char
48 testuc_h (vector unsigned char vuc2, vector unsigned char vuc3)
50 return vec_mergeh (vuc2, vuc3);
53 /* { dg-final { scan-assembler-times "vmrghb" 3 } } */
54 /* { dg-final { scan-assembler-times "vmrglb" 3 } } */