On Thu, Jan 2, 2014 at 4:46 PM, Joseph S. Myers <jos...@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 <jos...@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 <jos...@codesourcery.com> > > * gcc.target/powerpc/rs6000-ldouble-3.c: New test.
Okay. Thanks, David