1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
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 "-O2 -mcpu=power8" } */
10 add_short_0 (vector
short *p
)
12 return vec_extract (*p
, 0) + 1;
16 add_short_1 (vector
short *p
)
18 return vec_extract (*p
, 1) + 1;
22 add_short_2 (vector
short *p
)
24 return vec_extract (*p
, 2) + 1;
28 add_short_3 (vector
short *p
)
30 return vec_extract (*p
, 3) + 1;
34 add_short_4 (vector
short *p
)
36 return vec_extract (*p
, 4) + 1;
40 add_short_5 (vector
short *p
)
42 return vec_extract (*p
, 5) + 1;
46 add_short_6 (vector
short *p
)
48 return vec_extract (*p
, 6) + 1;
52 add_short_7 (vector
short *p
)
54 return vec_extract (*p
, 7) + 1;
58 add_short_n (vector
short *p
, int n
)
60 return vec_extract (*p
, n
) + 1;
63 /* { dg-final { scan-assembler-not "lxvd2x" } } */
64 /* { dg-final { scan-assembler-not "lxvw4x" } } */
65 /* { dg-final { scan-assembler-not "lxvx" } } */
66 /* { dg-final { scan-assembler-not "lxv" } } */
68 /* With recent enhancements to the code generator, it is considered
69 * legal to implement vec_extract with lvx and xxpermdi. Previous
70 * versions of this test forbid both instructions. */