1 /* Verify that overloaded built-ins for vec_perm with short
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 short
testbs(vector bool short vbs2,vector bool short vbs3,vector unsigned char vuc)11 testbs (vector bool short vbs2, vector bool short vbs3,
12 	vector unsigned char vuc)
13 {
14   return vec_perm (vbs2, vbs3, vuc);
15 }
16 
17 vector signed short
testss(vector signed short vss2,vector signed short vss3,vector unsigned char vuc)18 testss (vector signed short vss2, vector signed short vss3, vector unsigned char vuc)
19 {
20   return vec_perm (vss2, vss3, vuc);
21 }
22 
23 vector unsigned short
testus(vector unsigned short vus2,vector unsigned short vus3,vector unsigned char vuc)24 testus (vector unsigned short vus2, vector unsigned short vus3, vector unsigned char vuc)
25 {
26   return vec_perm (vus2, vus3, vuc);
27 }
28 
29 /* { dg-final { scan-assembler-times "vperm" 3 } } */
30