This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Ping Re: Fix strtod rounding (bug 3479)
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Tue, 11 Sep 2012 09:11:12 -0300
- Subject: Re: Ping Re: Fix strtod rounding (bug 3479)
- References: <Pine.LNX.4.64.1208142055120.19862@digraph.polyomino.org.uk> <20120814210740.4A0092C0E5@topped-with-meat.com> <Pine.LNX.4.64.1208151907250.22955@digraph.polyomino.org.uk> <Pine.LNX.4.64.1208201102390.4976@digraph.polyomino.org.uk> <Pine.LNX.4.64.1208251539310.12613@digraph.polyomino.org.uk> <m2oblkleiw.fsf@igel.home> <Pine.LNX.4.64.1209051449120.7777@digraph.polyomino.org.uk>
On 09/05/2012 11:50 AM, Joseph S. Myers wrote:
> On Wed, 5 Sep 2012, Andreas Schwab wrote:
>
>> That doesn't appear to work with IBM long double:
> See what I said in
> <http://sourceware.org/ml/libc-alpha/2012-08/msg00603.html> (current
> version <http://sourceware.org/ml/libc-alpha/2012-09/msg00069.html>,
> pending review).
>
This patch fixes the IBM long double 'tst-strtod-overflow' failures.
Tested on PPC32 and PPC64.
2012-09-11 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
[BZ #14551]
sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: (__mpn_construct_long_double):
Fix the overflow long double generation.
---
sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
index b49ad96..53528d1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
@@ -134,7 +134,7 @@ __mpn_construct_long_double (mp_srcptr frac_ptr, int expt, int sign)
lo = lo << lzcount;
exponent2 = exponent2 - lzcount;
}
- if (exponent2 > 0)
+ if (exponent2 > 0 && u.ieee.exponent < 0x7FF)
u.ieee.exponent2 = exponent2;
else
lo >>= 1 - exponent2;
--
Adhemerval Zanella Netto
Software Engineer
Linux Technology Center Brazil
Toolchain / GLIBC on Power Architecture
azanella@linux.vnet.ibm.com / azanella@br.ibm.com
+55 61 8642-9890