diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-27 06:23:32 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-27 06:23:32 +0000 |
commit | 650102e076dcf6e805a3e1cb109c995471e1d6df (patch) | |
tree | 43fd6b80783b3f8f586143d0614702108ec8e86c /gcc | |
parent | 57f03ed4d05598d3e465dc2e1d52fe9d6cf7936c (diff) | |
download | gcc-650102e076dcf6e805a3e1cb109c995471e1d6df.tar.gz |
* real.c (ibm_extended_format): Add 53 to minimum exponent.
(encode_ibm_extended): Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/real.c | 21 |
2 files changed, 23 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 69c2e9854ea..78a6a249a5d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-01-27 Alexandre Oliva <aoliva@redhat.com> + + * real.c (ibm_extended_format): Add 53 to minimum exponent. + (encode_ibm_extended): Adjust. + 2003-01-26 Gabriel Dos Reis <gdr@soliton.integrable-solutions.net> * timevar.def (TV_OVERLOAD, TV_TEMPLATE_INSTANTIATION): New diff --git a/gcc/real.c b/gcc/real.c index f1e10b33ac5..369d32401fb 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, |