1 /* Verify that overloaded built-ins for vec_perm with char
2 inputs produce the right code. */
3
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-maltivec -O2" } */
7
8 #include <altivec.h>
9
10 vector bool char
testbc(vector bool char vbc2,vector bool char vbc3,vector unsigned char vuc)11 testbc (vector bool char vbc2, vector bool char vbc3,
12 vector unsigned char vuc)
13 {
14 return vec_perm (vbc2, vbc3, vuc);
15 }
16
17 vector signed char
testsc(vector signed char vsc2,vector signed char vsc3,vector unsigned char vuc)18 testsc (vector signed char vsc2, vector signed char vsc3,
19 vector unsigned char vuc)
20 {
21 return vec_perm (vsc2, vsc3, vuc);
22 }
23
24 vector unsigned char
testuc(vector unsigned char vuc2,vector unsigned char vuc3,vector unsigned char vuc)25 testuc (vector unsigned char vuc2, vector unsigned char vuc3,
26 vector unsigned char vuc)
27 {
28 return vec_perm (vuc2, vuc3, vuc);
29 }
30
31 /* { dg-final { scan-assembler-times "vperm" 3 } } */
32