[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p8-vec-xl-xst.c
blob46d5d6f6fe9a9aeb79e802f322b7d2a82d94efc0
1 /* { dg-do compile { target { le } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2" } */
6 /* Verify fix for problem where vec_xl and vec_xst are not recognized
7 for the vector char and vector short cases on P8 only. */
9 #include <altivec.h>
11 vector unsigned char
12 foo (unsigned char * address)
14 return __builtin_vec_xl (0, address);
17 void
18 bar (vector unsigned char x, unsigned char * address)
20 __builtin_vec_xst (x, 0, address);
23 vector unsigned short
24 foot (unsigned short * address)
26 return __builtin_vec_xl (0, address);
29 void
30 bart (vector unsigned short x, unsigned short * address)
32 __builtin_vec_xst (x, 0, address);
35 vector unsigned char
36 fool (unsigned char * address)
38 return vec_xl (0, address);
41 void
42 barl (vector unsigned char x, unsigned char * address)
44 vec_xst (x, 0, address);
47 vector unsigned short
48 footle (unsigned short * address)
50 return vec_xl (0, address);
53 void
54 bartle (vector unsigned short x, unsigned short * address)
56 vec_xst (x, 0, address);
59 /* { dg-final { scan-assembler-times "lxvd2x" 4 } } */
60 /* { dg-final { scan-assembler-times "stxvd2x" 4 } } */
61 /* { dg-final { scan-assembler-times "xxpermdi" 8 } } */