Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p8-vec-xl-xst-v2.c
blobcc68ceb87ca3e872acc970569e3d02ed29f83a8c
1 /* { dg-do compile { target { le } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_p8vector_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
5 /* { dg-options "-mcpu=power8 -O2" } */
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 This test duplicates p8-vec-xl-xst.c , except that it allows gimple-folding,
10 which changes the expected codegen. */
12 #include <altivec.h>
14 vector unsigned char
15 foo (unsigned char * address)
17 return __builtin_vec_xl (0, address);
20 void
21 bar (vector unsigned char x, unsigned char * address)
23 __builtin_vec_xst (x, 0, address);
26 vector unsigned short
27 foot (unsigned short * address)
29 return __builtin_vec_xl (0, address);
32 void
33 bart (vector unsigned short x, unsigned short * address)
35 __builtin_vec_xst (x, 0, address);
38 vector unsigned char
39 fool (unsigned char * address)
41 return vec_xl (0, address);
44 void
45 barl (vector unsigned char x, unsigned char * address)
47 vec_xst (x, 0, address);
50 vector unsigned short
51 footle (unsigned short * address)
53 return vec_xl (0, address);
56 void
57 bartle (vector unsigned short x, unsigned short * address)
59 vec_xst (x, 0, address);
62 /* { dg-final { scan-assembler-times "lvx" 4 } } */
63 /* { dg-final { scan-assembler-times "stvx" 4 } } */
64 /* { dg-final { scan-assembler-times "xxpermdi" 0 } } */