1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-O2 -mvsx" } */
9 add_double_0 (vector
double *p
, double x
)
11 return vec_extract (*p
, 0) + x
;
15 add_double_1 (vector
double *p
, double x
)
17 return vec_extract (*p
, 1) + x
;
21 add_long_0 (vector
long *p
, long x
)
23 return vec_extract (*p
, 0) + x
;
27 add_long_1 (vector
long *p
, long x
)
29 return vec_extract (*p
, 1) + x
;
32 /* { dg-final { scan-assembler-not "lxvd2x" } } */
33 /* { dg-final { scan-assembler-not "lxvw4x" } } */
34 /* { dg-final { scan-assembler-not "lxvx" } } */
35 /* { dg-final { scan-assembler-not "lxv" } } */
37 /* With recent enhancements to the code generator, it is considered
38 * legal to implement vec_extract with lvx and xxpermdi. Previous
39 * versions of this test forbid both instructions. */