1 /* { dg-do compile { target { le } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-options "-mdejagnu-cpu=power8 -O2 -mno-fold-gimple" } */
5 /* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } */
6 
7 /* Verify fix for problem where vec_xl and vec_xst are not recognized
8    for the vector char and vector short cases on P8 only.  */
9 
10 #include <altivec.h>
11 
12 vector unsigned char
foo(unsigned char * address)13 foo (unsigned char * address)
14 {
15   return __builtin_vec_xl (0, address);
16 }
17 
18 void
bar(vector unsigned char x,unsigned char * address)19 bar (vector unsigned char x, unsigned char * address)
20 {
21   __builtin_vec_xst (x, 0, address);
22 }
23 
24 vector unsigned short
foot(unsigned short * address)25 foot (unsigned short * address)
26 {
27   return __builtin_vec_xl (0, address);
28 }
29 
30 void
bart(vector unsigned short x,unsigned short * address)31 bart (vector unsigned short x, unsigned short * address)
32 {
33   __builtin_vec_xst (x, 0, address);
34 }
35 
36 vector unsigned char
fool(unsigned char * address)37 fool (unsigned char * address)
38 {
39   return vec_xl (0, address);
40 }
41 
42 void
barl(vector unsigned char x,unsigned char * address)43 barl (vector unsigned char x, unsigned char * address)
44 {
45   vec_xst (x, 0, address);
46 }
47 
48 vector unsigned short
footle(unsigned short * address)49 footle (unsigned short * address)
50 {
51   return vec_xl (0, address);
52 }
53 
54 void
bartle(vector unsigned short x,unsigned short * address)55 bartle (vector unsigned short x, unsigned short * address)
56 {
57   vec_xst (x, 0, address);
58 }
59 
60 /* { dg-final { scan-assembler-times "lxvd2x"   4 } } */
61 /* { dg-final { scan-assembler-times "stxvd2x"  4 } } */
62 /* { dg-final { scan-assembler-times "xxpermdi" 8 } } */
63