Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst-v2.c

raw
1 /* { dg-do compile { target { le } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2" } */
4 /* { dg-require-effective-target powerpc_vsx } */
5
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. */
10
11 #include <altivec.h>
12
13 vector unsigned char
14 foo (unsigned char * address)
15 {
16 return __builtin_vec_xl (0, address);
17 }
18
19 void
20 bar (vector unsigned char x, unsigned char * address)
21 {
22 __builtin_vec_xst (x, 0, address);
23 }
24
25 vector unsigned short
26 foot (unsigned short * address)
27 {
28 return __builtin_vec_xl (0, address);
29 }
30
31 void
32 bart (vector unsigned short x, unsigned short * address)
33 {
34 __builtin_vec_xst (x, 0, address);
35 }
36
37 vector unsigned char
38 fool (unsigned char * address)
39 {
40 return vec_xl (0, address);
41 }
42
43 void
44 barl (vector unsigned char x, unsigned char * address)
45 {
46 vec_xst (x, 0, address);
47 }
48
49 vector unsigned short
50 footle (unsigned short * address)
51 {
52 return vec_xl (0, address);
53 }
54
55 void
56 bartle (vector unsigned short x, unsigned short * address)
57 {
58 vec_xst (x, 0, address);
59 }
60
61 /* { dg-final { scan-assembler-times {\mlxvd2x\M} 4 } } */
62 /* { dg-final { scan-assembler-times {\mstxvd2x\M} 4 } } */