diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-03 02:05:44 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-03 02:05:44 +0000 |
commit | acf40e7ea585f2d89ed91fa5215ed79980323c4e (patch) | |
tree | 600f5ab6116c9a7fad8b0f87b548b842bbf02f7f /libgcc/config/rs6000 | |
parent | 37d099d8904f9374bade06e401dad12c56ad5740 (diff) | |
download | gcc-acf40e7ea585f2d89ed91fa5215ed79980323c4e.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206310 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/rs6000')
-rw-r--r-- | libgcc/config/rs6000/ibm-ldouble.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c index 089de7d5352..abcd3c51435 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 |