[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-extract-2.c
blob2aea0baeff410c528b1f0d61ff29f9609e8b2e3b
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" } */
6 #include <altivec.h>
8 double
9 add_double_0 (vector double *p, double x)
11 return vec_extract (*p, 0) + x;
14 double
15 add_double_1 (vector double *p, double x)
17 return vec_extract (*p, 1) + x;
20 long
21 add_long_0 (vector long *p, long x)
23 return vec_extract (*p, 0) + x;
26 long
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. */