This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] PPC64 perpare for -mlong-double-128
- From: Steve Munroe <sjmunroe at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com, Dwayne McConnell <dgm69 at us dot ibm dot com>, janis187 at us dot ibm dot com
- Date: Thu, 29 Apr 2004 11:05:59 -0500
- Subject: [PATCH] PPC64 perpare for -mlong-double-128
- Organization: IBM LTC
- Reply-to: sjmunroe at vnet dot ibm dot com
gcc-3.4 now has support for -mlong-double-128. The attached patches
fixup some of the internal constants that will cause a build break for
PPC64 if -mlong-double-128 is used.
This is just the start of a ~80-90 file changes required for PPC64 long
double support.
2004-04-29 Steven Munroe <sjmunroe@us.ibm.com>
* math/test-misc.c [LDBL_MANT_DIG == 106](main): Correct LDBL_MAX
mantissa for AIX long double format.
* misc/qefgcvt.c [LDBL_MANT_DIG == 106](NDIGIT_MAX): Define NDIGIT_MAX
for AIX long double format.
* misc/qefgcvt_r.c [LDBL_MANT_DIG == 106](NDIGIT_MAX): Define
NDIGIT_MAX for AIX long double format.
* stdlib/fpioconst.c [!__NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__>1024]
(_fpioconst_pow10): AIX long double format has same exponent range as
double.
* stdlib/fpioconst.h [!__NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__>1024]
(LDBL_MAX_10_EXP_LOG): AIX long double format has same exponent range
as double.
diff -urN libc23-cvstip-20040423/math/test-misc.c libc23/math/test-misc.c
--- libc23-cvstip-20040423/math/test-misc.c 2001-07-05 23:55:35.000000000 -0500
+++ libc23/math/test-misc.c 2004-04-23 15:26:38.000000000 -0500
@@ -54,6 +54,10 @@
# if LDBL_MANT_DIG == 64
m = 0xf.fffffffffffffffp-4L;
+# elif LDBL_MANT_DIG == 106
+ /* This has to match the mantissa of LDBL_MAX which actually does have a
+ missing bit in the middle. */
+ m = 0x1.fffffffffffff7ffffffffffff8p-1L;
# elif LDBL_MANT_DIG == 113
m = 0x1.ffffffffffffffffffffffffffffp-1L;
# else
diff -urN libc23-cvstip-20040423/misc/qefgcvt.c libc23/misc/qefgcvt.c
--- libc23-cvstip-20040423/misc/qefgcvt.c 2001-07-05 23:55:36.000000000 -0500
+++ libc23/misc/qefgcvt.c 2004-04-23 15:49:22.000000000 -0500
@@ -33,6 +33,8 @@
# define NDIGIT_MAX 17
#elif LDBL_MANT_DIG == 113
# define NDIGIT_MAX 36
+#elif LDBL_MANT_DIG == 106
+# define NDIGIT_MAX 34
#elif LDBL_MANT_DIG == 56
# define NDIGIT_MAX 18
#else
diff -urN libc23-cvstip-20040423/misc/qefgcvt_r.c libc23/misc/qefgcvt_r.c
--- libc23-cvstip-20040423/misc/qefgcvt_r.c 2001-07-05 23:55:36.000000000 -0500
+++ libc23/misc/qefgcvt_r.c 2004-04-23 15:49:06.000000000 -0500
@@ -30,6 +30,8 @@
# define NDIGIT_MAX 17
#elif LDBL_MANT_DIG == 113
# define NDIGIT_MAX 36
+#elif LDBL_MANT_DIG == 106
+# define NDIGIT_MAX 34
#elif LDBL_MANT_DIG == 56
# define NDIGIT_MAX 18
#else
diff -urN libc23-cvstip-20040423/stdlib/fpioconst.c libc23/stdlib/fpioconst.c
--- libc23-cvstip-20040423/stdlib/fpioconst.c 2003-03-13 21:59:41.000000000 -0600
+++ libc23/stdlib/fpioconst.c 2004-04-23 15:26:38.000000000 -0500
@@ -278,7 +278,7 @@
0x26b2716ed595d80full, 0x1d153624adc666b0ull, 0x63ff540e3c42d35aull,
0x65f9ef17cc5573c0ull, 0x80dcc7f755bc28f2ull, 0x5fdcefcef46eeddcull,
0x00000000000553f7ull,
-#ifndef __NO_LONG_DOUBLE_MATH
+#if!defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
# define TENS_P9_IDX (TENS_P8_IDX + TENS_P8_SIZE)
# define TENS_P9_SIZE 28
[TENS_P9_IDX] = 0x0000000000000000ull, 0x0000000000000000ull,
@@ -449,7 +449,7 @@
{ TENS_P6_IDX, TENS_P6_SIZE, 213, 210 },
{ TENS_P7_IDX, TENS_P7_SIZE, 426, 422 },
{ TENS_P8_IDX, TENS_P8_SIZE, 851, 848 },
-#ifndef __NO_LONG_DOUBLE_MATH
+#if !defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
{ TENS_P9_IDX, TENS_P9_SIZE, 1701, 1698 },
{ TENS_P10_IDX, TENS_P10_SIZE, 3402, 3399 },
{ TENS_P11_IDX, TENS_P11_SIZE, 6804, 6800 },
diff -urN libc23-cvstip-20040423/stdlib/fpioconst.h libc23/stdlib/fpioconst.h
--- libc23-cvstip-20040423/stdlib/fpioconst.h 2003-03-13 22:21:27.000000000 -0600
+++ libc23/stdlib/fpioconst.h 2004-04-23 15:26:38.000000000 -0500
@@ -34,7 +34,7 @@
XXX These should be defined in <float.h>. For the time being, we have the
IEEE754 values here. */
-#ifndef __NO_LONG_DOUBLE_MATH
+#if !defined __NO_LONG_DOUBLE_MATH && __LDBL_MAX_EXP__ > 1024
# define LDBL_MAX_10_EXP_LOG 12 /* = floor(log_2(LDBL_MAX_10_EXP)) */
#else
# define LDBL_MAX_10_EXP_LOG 8 /* = floor(log_2(LDBL_MAX_10_EXP)) */