[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-extract-double.p7.c
blob3cae644b90b71feb250a96481a2fe389db193a7f
1 /* Verify that overloaded built-ins for vec_extract() with
2 double inputs produce the right code. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_altivec_ok } */
6 /* { dg-options "-mdejagnu-cpu=power7 -O2" } */
7 /* { dg-additional-options "-mbig-endian" { target powerpc*-*-linux* } } */
9 // targeting P7 (BE), 2 tests.
10 // P7 constants: xxpermdi
11 // P7 variables: li, addi, rldic, addi, stxvd2x, lfdx
13 /* { dg-final { scan-assembler-times {\mxxpermdi\M} 1 } } */
14 /* { dg-final { scan-assembler-times {\mli\M} 1 } } */
15 /* -m32 target has an 'add' in place of one of the 'addi'. */
16 /* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 2 { target lp64 } } } */
17 /* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 3 { target ilp32 } } } */
18 /* -m32 target has a rlwinm in place of a rldic . */
19 /* { dg-final { scan-assembler-times {\mrldic\M|\mrlwinm\M} 1 } } */
20 /* { dg-final { scan-assembler-times {\mstxvd2x\M} 1 } } */
21 /* { dg-final { scan-assembler-times {\mlfdx\M|\mlfd\M} 1 } } */
23 #include <altivec.h>
25 double
26 testd_var (vector double vd2, signed int si)
28 return vec_extract (vd2, si);
31 double
32 testd_cst (vector double vd2)
34 return vec_extract (vd2, 1);