@@ -220,7 +220,8 @@
; This is redundant with __builtin_pack_ibm128, as it requires long
; double to be __ibm128. Should probably be deprecated.
const long double __builtin_pack_longdouble (double, double);
- PACK_TF packtf {ibmld}
+; FIXME: Make this available for soft-float, see PR105213.
+ PACK_TF packtf {ibmld,nosoft}
unsigned long __builtin_ppc_mftb ();
MFTB rs6000_mftb_di {32bit}
@@ -235,18 +236,21 @@
MTFSF rs6000_mtfsf {}
const __ibm128 __builtin_pack_ibm128 (double, double);
- PACK_IF packif {ibm128}
+; FIXME: Make this available for soft-float, see PR105213.
+ PACK_IF packif {ibm128,nosoft}
void __builtin_set_fpscr_rn (const int[0,3]);
SET_FPSCR_RN rs6000_set_fpscr_rn {nosoft}
const double __builtin_unpack_ibm128 (__ibm128, const int<1>);
- UNPACK_IF unpackif {ibm128}
+; FIXME: Make this available for soft-float, see PR105213.
+ UNPACK_IF unpackif {ibm128,nosoft}
; This is redundant with __builtin_unpack_ibm128, as it requires long
; double to be __ibm128. Should probably be deprecated.
const double __builtin_unpack_longdouble (long double, const int<1>);
- UNPACK_TF unpacktf {ibmld}
+; FIXME: Make this available for soft-float, see PR105213.
+ UNPACK_TF unpacktf {ibmld,nosoft}
; Builtins that have been around just about forever, but not quite.
new file mode 100644
@@ -0,0 +1,47 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } } */
+/* { dg-options "-mlong-double-128 -msoft-float" } */
+
+/* Verify there is no ICE. */
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <math.h>
+
+#if defined(__LONG_DOUBLE_IEEE128__)
+/* If long double is IEEE 128-bit, we need to use the __ibm128 type instead of
+ long double, and to use the appropriate pack/unpack routines. We can't use
+ __ibm128 on systems that don't support IEEE 128-bit floating point, because
+ the type is not enabled on those systems. */
+#define PACK __builtin_pack_ibm128
+#define UNPACK __builtin_unpack_ibm128
+#define LDOUBLE __ibm128
+
+#elif defined(__LONG_DOUBLE_IBM128__)
+#define PACK __builtin_pack_longdouble
+#define UNPACK __builtin_unpack_longdouble
+#define LDOUBLE long double
+
+#else
+#error "long double must be either IBM 128-bit or IEEE 128-bit"
+#endif
+
+extern LDOUBLE bar (LDOUBLE);
+
+int
+main (void)
+{
+ double high = pow (2.0, 60);
+ double low = 2.0;
+ LDOUBLE a = ((LDOUBLE) high) + ((LDOUBLE) low);
+ double x0 = UNPACK (a, 0);
+ /* Let's ignore all error messages about built-in function
+ unsupported due to soft-float, since they are not test
+ points here (this case is to check no ICE). */
+ /* { dg-excess-errors "pr103623" } */
+ double x1 = UNPACK (a, 1);
+ LDOUBLE b = PACK (x0, x1);
+ LDOUBLE c = bar (b);
+
+ return c > a;
+}
+