summaryrefslogtreecommitdiffstats
path: root/libgcc
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-03 02:05:44 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-03 02:05:44 +0000
commitacf40e7ea585f2d89ed91fa5215ed79980323c4e (patch)
tree600f5ab6116c9a7fad8b0f87b548b842bbf02f7f /libgcc
parent37d099d8904f9374bade06e401dad12c56ad5740 (diff)
downloadppe42-gcc-acf40e7ea585f2d89ed91fa5215ed79980323c4e.tar.gz
ppe42-gcc-acf40e7ea585f2d89ed91fa5215ed79980323c4e.zip
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')
-rw-r--r--libgcc/ChangeLog5
-rw-r--r--libgcc/config/rs6000/ibm-ldouble.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 0c326525a92..7fc4bd08449 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 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
OpenPOWER on IntegriCloud