diff options
author | Joseph Myers <joseph@codesourcery.com> | 2014-01-03 02:05:44 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2014-01-03 02:05:44 +0000 |
commit | a02e7bddb8b6e631048c93a7463278f6079532a2 (patch) | |
tree | 600f5ab6116c9a7fad8b0f87b548b842bbf02f7f /libgcc | |
parent | 927734cfafbc115c51401621f37d17b56b162d2a (diff) | |
download | gcc-a02e7bddb8b6e631048c93a7463278f6079532a2.zip gcc-a02e7bddb8b6e631048c93a7463278f6079532a2.tar.gz gcc-a02e7bddb8b6e631048c93a7463278f6079532a2.tar.bz2 |
ibm-ldouble.c (__gcc_qdiv): Scale up arguments in case of small numerator and finite nonzero result.
libgcc:
* config/rs6000/ibm-ldouble.c (__gcc_qdiv): Scale up arguments in
case of small numerator and finite nonzero result.
gcc/testsuite:
* gcc.target/powerpc/rs6000-ldouble-3.c: New test.
From-SVN: r206310
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 5 | ||||
-rw-r--r-- | libgcc/config/rs6000/ibm-ldouble.c | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 0c32652..7fc4bd0 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +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. + 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com> Update copyright years diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c index 089de7d..abcd3c5 100644 --- a/libgcc/config/rs6000/ibm-ldouble.c +++ b/libgcc/config/rs6000/ibm-ldouble.c @@ -190,7 +190,16 @@ __gcc_qdiv (double a, double b, double c, double d) || nonfinite (t)) return t; - /* Finite nonzero result requires corrections to the highest order term. */ + /* Finite nonzero result requires corrections to the highest order + term. These corrections require the low part of c * t to be + exactly represented in double. */ + if (fabs (a) <= 0x1p-969) + { + a *= 0x1p106; + b *= 0x1p106; + c *= 0x1p106; + d *= 0x1p106; + } s = c * t; /* (s,sigma) = c*t exactly. */ w = -(-b + d * t); /* Written to get fnmsub for speed, but not |