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. */
15 foo (unsigned char * address
)
17 return __builtin_vec_xl (0, address
);
21 bar (vector
unsigned char x
, unsigned char * address
)
23 __builtin_vec_xst (x
, 0, address
);
27 foot (unsigned short * address
)
29 return __builtin_vec_xl (0, address
);
33 bart (vector
unsigned short x
, unsigned short * address
)
35 __builtin_vec_xst (x
, 0, address
);
39 fool (unsigned char * address
)
41 return vec_xl (0, address
);
45 barl (vector
unsigned char x
, unsigned char * address
)
47 vec_xst (x
, 0, address
);
51 footle (unsigned short * address
)
53 return vec_xl (0, address
);
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 } } */