aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-01-27 06:23:32 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2003-01-27 06:23:32 +0000
commitf004e5f376bd037ad11934b23c765bbfd428b242 (patch)
tree43fd6b80783b3f8f586143d0614702108ec8e86c /gcc/real.c
parent58c60e52692a29961730c86e2a8eac552c6e21f5 (diff)
downloadgcc-f004e5f376bd037ad11934b23c765bbfd428b242.zip
gcc-f004e5f376bd037ad11934b23c765bbfd428b242.tar.gz
gcc-f004e5f376bd037ad11934b23c765bbfd428b242.tar.bz2
real.c (ibm_extended_format): Add 53 to minimum exponent.
* real.c (ibm_extended_format): Add 53 to minimum exponent. (encode_ibm_extended): Adjust. From-SVN: r61875
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/real.c b/gcc/real.c
index f1e10b3..369d324 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -3261,8 +3261,23 @@ encode_ibm_extended (fmt, buf, r)
u = *r;
clear_significand_below (&u, SIGNIFICAND_BITS - 53);
- /* v = remainder containing additional 53 bits of significand. */
- do_add (&v, r, &u, 1);
+ normalize (&u);
+ /* If the upper double is zero, we have a denormal double, so
+ move it to the first double and leave the second as zero. */
+ if (u.class == rvc_zero)
+ {
+ v = u;
+ u = *r;
+ normalize (&u);
+ }
+ else
+ {
+ /* v = remainder containing additional 53 bits of significand. */
+ do_add (&v, r, &u, 1);
+ round_for_format (&ieee_double_format, &v);
+ }
+
+ round_for_format (&ieee_double_format, &u);
encode_ieee_double (&ieee_double_format, &buf[0], &u);
encode_ieee_double (&ieee_double_format, &buf[2], &v);
@@ -3299,7 +3314,7 @@ const struct real_format ibm_extended_format =
2,
1,
53 + 53,
- -1021,
+ -1021 + 53,
1024,
-1,
true,