Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/pr60203.c

raw
1 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O3" } */
4 /* { dg-require-effective-target longdouble128 } */
5 /* { dg-require-effective-target powerpc_vsx } */
6
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
13
14 #elif defined(__LONG_DOUBLE_IBM128__)
15 #define LDOUBLE long double
16
17 #else
18 #error "long double must be either IBM 128-bit or IEEE 128-bit"
19 #endif
20
21 union u_ld { LDOUBLE ld; double d[2]; };
22
23 LDOUBLE
24 pack (double a, double aa)
25 {
26 union u_ld u;
27 u.d[0] = a;
28 u.d[1] = aa;
29 return u.ld;
30 }
31
32 double
33 unpack_0 (LDOUBLE x)
34 {
35 union u_ld u;
36 u.ld = x;
37 return u.d[0];
38 }
39
40 double
41 unpack_1 (LDOUBLE x)
42 {
43 union u_ld u;
44 u.ld = x;
45 return u.d[1];
46 }
47
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" } } */
54
55