[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p8-vec-xl-xst-v2.c
blob7a624297ae9e9f717929f5ad7224a32d2599f93e
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.
8 This test duplicates p8-vec-xl-xst.c , except that it allows gimple-folding,
9 which changes the expected codegen. */
11 #include <altivec.h>
13 vector unsigned char
14 foo (unsigned char * address)
16 return __builtin_vec_xl (0, address);
19 void
20 bar (vector unsigned char x, unsigned char * address)
22 __builtin_vec_xst (x, 0, address);
25 vector unsigned short
26 foot (unsigned short * address)
28 return __builtin_vec_xl (0, address);
31 void
32 bart (vector unsigned short x, unsigned short * address)
34 __builtin_vec_xst (x, 0, address);
37 vector unsigned char
38 fool (unsigned char * address)
40 return vec_xl (0, address);
43 void
44 barl (vector unsigned char x, unsigned char * address)
46 vec_xst (x, 0, address);
49 vector unsigned short
50 footle (unsigned short * address)
52 return vec_xl (0, address);
55 void
56 bartle (vector unsigned short x, unsigned short * address)
58 vec_xst (x, 0, address);
61 /* { dg-final { scan-assembler-times {\mlxvd2x\M} 4 } } */
62 /* { dg-final { scan-assembler-times {\mstxvd2x\M} 4 } } */