This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] BZ#15536: Fix ulp(0x0.0p0) for 128-bit IBM long double.


The subnormal precision degenerates to that of double
for 128-bit IBM long double.

Thus when testing 128-bit IBM long double we use the same
ulp as double for FP_SUBNORMAL.

The following patch fixes the build failure described
in BZ#15536.

Tested on ppc64 (POWER7).

I noticed 52 regressions in the math testsuite as
a result of the new more precise ulp. I would appreciate
help in reviewing and disabling these tests for IBM
128-bit long double.

OK to checkin?

2013-05-31  Carlos O'Donell  <carlos@redhat.com>

	* math/libm-test.inc [TEST_LDOUBLE && LDBL_MANT_DIG == 106]
	(ulp): 

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 7a6bf09..0b0b0d3 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -680,7 +680,13 @@ ulp (FLOAT value)
        /* Fall through...  */
       case FP_SUBNORMAL:
         /* The next closest subnormal value is a constant distance away.  */
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 106
+       /* In 128-bit IBM long double the precision of the type degenerates
+          to double when we use subnormals.  */
+       ulp = FUNC(ldexp) (1.0, 1 - (MAX_EXP + (__DBL_MANT_DIG__ - 1)));
+#else
        ulp = FUNC(ldexp) (1.0, 1 - (MAX_EXP + MANT_DIG));
+#endif
        break;
 
       case FP_NORMAL:
---

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]