1 /* { dg-do run { target { powerpc*-*-linux* } } } */
2 /* { dg-require-effective-target ppc_float128_sw } */
3 /* { dg-require-effective-target vsx_hw } */
4 /* { dg-options "-mvsx -O2" } */
6 /* PR 85657 -- make __ibm128 a full type. */
8 __attribute__ ((__noinline__
))
10 ibm128_to_float128 (__ibm128 a
)
12 return (__float128
)a
+ 1.0q
;
15 __attribute__ ((__noinline__
))
17 ldouble_to_float128 (long double a
)
19 return (__float128
)a
+ 1.0q
;
22 __attribute__ ((__noinline__
))
24 float128_to_ibm128 (__float128 a
)
26 return (__ibm128
)a
+ (__ibm128
)1.0;
29 __attribute__ ((__noinline__
))
31 ldouble_to_ibm128 (long double a
)
33 return (__ibm128
)a
+ (__ibm128
)1.0;
36 __attribute__ ((__noinline__
))
38 ibm128_to_ldouble (__ibm128 a
)
40 return (long double)a
+ 1.0L;
43 __attribute__ ((__noinline__
))
45 float128_to_ldouble (__float128 a
)
47 return (long double)a
+ 1.0L;
50 volatile __float128 f128
= 1.25Q
;
51 volatile __ibm128 i128
= (__ibm128
)3.5L;
52 volatile long double ld
= 4.75L;
54 volatile double f128_p1
= 2.25;
55 volatile double i128_p1
= 4.5;
56 volatile double ld_p1
= 5.75;
58 extern void abort (void);
63 if (((double) float128_to_ldouble (f128
)) != f128_p1
)
66 if (((double) float128_to_ibm128 (f128
)) != f128_p1
)
69 if (((double) ibm128_to_ldouble (i128
)) != i128_p1
)
72 if (((double) ibm128_to_float128 (i128
)) != i128_p1
)
75 if (((double) ldouble_to_ibm128 (ld
)) != ld_p1
)
78 if (((double) ldouble_to_float128 (ld
)) != ld_p1
)