summaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-19 04:17:11 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-19 04:17:11 +0000
commitb044deec88e847736d4bf49f2ac1978518d81a68 (patch)
treee8a90d2006d130eb7cfc7fef2fb7db2523566785 /gcc/real.c
parent2d2fca6b7e2d1e09da5d4db05e75c1143b8d212e (diff)
downloadgcc-b044deec88e847736d4bf49f2ac1978518d81a68.tar.gz
2006-12-18 Roger Sayle <roger@eyesopen.com>
Eric Christopher <echristo@apple.com> PR target/29302 * real.c (real_maxval): Correctly handle IBM extended double format. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120040 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 0d239b3379d..b6e5ed6ee3e 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -2282,6 +2282,15 @@ real_maxval (REAL_VALUE_TYPE *r, int sign, enum machine_mode mode)
np2 = SIGNIFICAND_BITS - fmt->p * fmt->log2_b;
memset (r->sig, -1, SIGSZ * sizeof (unsigned long));
clear_significand_below (r, np2);
+
+ if (fmt->pnan < fmt->p)
+ /* This is an IBM extended double format made up of two IEEE
+ doubles. The value of the long double is the sum of the
+ values of the two parts. The most significant part is
+ required to be the value of the long double rounded to the
+ nearest double. Rounding means we need a slightly smaller
+ value for LDBL_MAX. */
+ clear_significand_bit (r, SIGNIFICAND_BITS - fmt->pnan);
}
}