[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr60203.c
blob56b676fde9b13590e47e757ce73b5886e79cb229
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target longdouble128 } */
4 /* { dg-require-effective-target powerpc_vsx_ok } */
5 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O3" } */
7 #if defined(__LONG_DOUBLE_IEEE128__)
8 /* If long double is IEEE 128-bit, we need to use the __ibm128 type instead of
9 long double. We can't use __ibm128 on systems that don't support IEEE
10 128-bit floating point, because the type is not enabled on those
11 systems. */
12 #define LDOUBLE __ibm128
14 #elif defined(__LONG_DOUBLE_IBM128__)
15 #define LDOUBLE long double
17 #else
18 #error "long double must be either IBM 128-bit or IEEE 128-bit"
19 #endif
21 union u_ld { LDOUBLE ld; double d[2]; };
23 LDOUBLE
24 pack (double a, double aa)
26 union u_ld u;
27 u.d[0] = a;
28 u.d[1] = aa;
29 return u.ld;
32 double
33 unpack_0 (LDOUBLE x)
35 union u_ld u;
36 u.ld = x;
37 return u.d[0];
40 double
41 unpack_1 (LDOUBLE x)
43 union u_ld u;
44 u.ld = x;
45 return u.d[1];
48 /* { dg-final { scan-assembler-not "stfd" } } */
49 /* { dg-final { scan-assembler-not "lfd" } } */
50 /* { dg-final { scan-assembler-not "lxsdx" } } */
51 /* { dg-final { scan-assembler-not "stxsdx" } } */
52 /* { dg-final { scan-assembler-not "mfvsrd" } } */
53 /* { dg-final { scan-assembler-not "mtvsrd" } } */