1 /* { dg-do compile { target { powerpc*-*-linux* } } } */
2 /* { dg-require-effective-target ppc_float128_sw } */
3 /* { dg-options "-mvsx -mfloat128 -O2 -mabi=ibmlongdouble -Wno-psabi" } */
5 // PR 85657 -- make sure conversions work between each of the 128-bit floating
8 __attribute__ ((__noinline__
))
10 ibm128_to_float128 (__ibm128 a
)
15 __attribute__ ((__noinline__
))
17 ldouble_to_float128 (long double a
)
22 __attribute__ ((__noinline__
))
24 float128_to_ibm128 (__float128 a
)
29 __attribute__ ((__noinline__
))
31 ldouble_to_ibm128 (long double a
)
36 __attribute__ ((__noinline__
))
38 ibm128_to_ldouble (__ibm128 a
)
40 return (long double)a
;
43 __attribute__ ((__noinline__
))
45 float128_to_ldouble (__float128 a
)
47 return (long double)a
;
53 volatile __float128 f128
= 1.2Q
;
54 volatile __ibm128 i128
= (__ibm128
)3.4L;
55 volatile long double ld
= 5.6L;
60 printf ("f128 (1.2) = %g (ld), %g (ibm128)\n",
61 (double) float128_to_ldouble (f128
),
62 (double) float128_to_ibm128 (f128
));
64 printf ("i128 (3.4) = %g (ld), %g (float128)\n",
65 (double) ibm128_to_ldouble (i128
),
66 (double) ibm128_to_float128 (i128
));
68 printf ("long double (5.6) = %g (ibm128), %g (float128)\n",
69 (double) ldouble_to_ibm128 (ld
),
70 (double) ldouble_to_float128 (ld
));