This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PowerPC] gcc.dg/torture/fp-int-convert-timode.c
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Dec 2005 12:32:07 +1030
- Subject: [PowerPC] gcc.dg/torture/fp-int-convert-timode.c
- References: <20051226012521.GG4247@bubble.grove.modra.org>
As the comment says below, some of the long double tests here fail due
to excess precision. The problem is that gcc's real.c
ibm_extended_format (and mips_extended_format) fp constants are rounded
to 106 bit precision, whereas actual precision is variable with a
minimum of 106 bits. (In fact, with proper rounding as done by
rs6000/darwinldouble.c, the minimum precision is 107 bits.) So a TImode
constant assigned directly to a long double variable (and thus evaluated
by real.c) may have a different value to the same constant converted at
runtime. Fixing real.c to properly mimic IBM Extended Double behaviour
isn't trivial, so I'd like to disable the long double tests here. I
don't want the whole fp-int-convert-timode.c test xfailed, because the
float and double tests ought to pass.
* gcc.dg/torture/fp-int-convert-timode.c: Don't test IBM
Extended Double long doubles or repeat tests when long double is
the same size as double.
Tested powerpc64-linux.
Index: gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c (revision 109034)
+++ gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c (working copy)
@@ -11,6 +11,11 @@ main (void)
{
TEST_I_F(TItype, UTItype, float, FLT_MANT_DIG);
TEST_I_F(TItype, UTItype, double, DBL_MANT_DIG);
+ /* Disable the long double tests when using IBM Extended Doubles.
+ They have variable precision, but constants calculated by gcc's
+ real.c assume fixed precision. */
+#if DBL_MANT_DIG != LDBL_MANT_DIG && LDBL_MANT_DIG != 106
TEST_I_F(TItype, UTItype, long double, LDBL_MANT_DIG);
+#endif
exit (0);
}
--
Alan Modra
IBM OzLabs - Linux Technology Centre