This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix IBM long double division inaccuracy (glibc bug 15396)
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Date: Thu, 2 Jan 2014 19:19:04 -0500
- Subject: Re: Fix IBM long double division inaccuracy (glibc bug 15396)
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1401022142320 dot 28168 at digraph dot polyomino dot org dot uk>
On Thu, Jan 2, 2014 at 4:46 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> This patch fixes inaccuracy of IBM long double division that causes
> large errors in glibc testing
> <https://sourceware.org/bugzilla/show_bug.cgi?id=15396>. The
> implementation computes a first approximation to the result as t = a /
> c, dividing the high parts of the arguments, then does adjustments
> involving calculating c * t as the exact sum of two double values. In
> the problem cases, the low part of c * t underflows, so resulting in
> loss of precision compared to the precision available for a number
> with the exponent of the final result. This patch scales the
> arguments up in the problem case.
>
> Tested with no regressions for cross to powerpc-linux-gnu. OK to
> commit?
>
> (Note that there remain other bugs in the IBM long double code, some
> causing glibc test failures, at least (a) invalid results in rounding
> modes other than FE_TONEAREST, (b) spurious overflow and underflow
> exceptions, mainly but not entirely where discontiguous mantissa bits
> are involved.)
>
> libgcc:
> 2014-01-02 Joseph Myers <joseph@codesourcery.com>
>
> * config/rs6000/ibm-ldouble.c (__gcc_qdiv): Scale up arguments in
> case of small numerator and finite nonzero result.
>
> gcc/testsuite:
> 2014-01-02 Joseph Myers <joseph@codesourcery.com>
>
> * gcc.target/powerpc/rs6000-ldouble-3.c: New test.
Okay.
Thanks, David