diff options
author | Michael Meissner <meissner@linux.vnet.ibm.com> | 2017-09-01 22:10:57 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2017-09-01 22:10:57 +0000 |
commit | 0c949f0a1ce9cfa8c48e62628493140d60e65ea7 (patch) | |
tree | 19ec6e67a88c3251f2fa78dbe04a44c337eaeaf0 /libquadmath/math | |
parent | fe920c2d9f479c2b17d6963973cf11efe0169293 (diff) | |
download | gcc-0c949f0a1ce9cfa8c48e62628493140d60e65ea7.zip gcc-0c949f0a1ce9cfa8c48e62628493140d60e65ea7.tar.gz gcc-0c949f0a1ce9cfa8c48e62628493140d60e65ea7.tar.bz2 |
re PR libquadmath/81848 (Add PowerPC support to libquadmath)
2017-09-01 Michael Meissner <meissner@linux.vnet.ibm.com>
PR libquadmath/81848
* configure.ac (powerpc*-linux*): Use attribute mode KC to create
complex __float128 on PowerPC instead of attribute mode TC.
* quadmath.h (__complex128): Likewise.
* configure: Regenerate.
* math/cbrtq.c (CBRT2): Use __float128 not long double.
(CBRT4): Likewise.
(CBRT2I): Likewise.
(CBRT4I): Likewise.
* math/j0q.c (U0): Likewise.
* math/sqrtq.c (sqrtq): Don't depend on implicit conversion
between __float128, instead explicitly convert the __float128
value to long double because the PowerPC does not allow __float128
and long double in the same expression.
From-SVN: r251613
Diffstat (limited to 'libquadmath/math')
-rw-r--r-- | libquadmath/math/cbrtq.c | 8 | ||||
-rw-r--r-- | libquadmath/math/j0q.c | 2 | ||||
-rw-r--r-- | libquadmath/math/sqrtq.c | 17 |
3 files changed, 15 insertions, 12 deletions
diff --git a/libquadmath/math/cbrtq.c b/libquadmath/math/cbrtq.c index 2567d4d..a7a36f95 100644 --- a/libquadmath/math/cbrtq.c +++ b/libquadmath/math/cbrtq.c @@ -56,10 +56,10 @@ Adapted for glibc October, 2001. #include "quadmath-imp.h" -static const long double CBRT2 = 1.259921049894873164767210607278228350570251Q; -static const long double CBRT4 = 1.587401051968199474751705639272308260391493Q; -static const long double CBRT2I = 0.7937005259840997373758528196361541301957467Q; -static const long double CBRT4I = 0.6299605249474365823836053036391141752851257Q; +static const __float128 CBRT2 = 1.259921049894873164767210607278228350570251Q; +static const __float128 CBRT4 = 1.587401051968199474751705639272308260391493Q; +static const __float128 CBRT2I = 0.7937005259840997373758528196361541301957467Q; +static const __float128 CBRT4I = 0.6299605249474365823836053036391141752851257Q; __float128 diff --git a/libquadmath/math/j0q.c b/libquadmath/math/j0q.c index c6e482b..2dc93d5 100644 --- a/libquadmath/math/j0q.c +++ b/libquadmath/math/j0q.c @@ -816,7 +816,7 @@ static __float128 Y0_2D[NY0_2D + 1] = { /* 1.000000000000000000000000000000000000000E0 */ }; -static const long double U0 = -7.3804295108687225274343927948483016310862e-02Q; +static const __float128 U0 = -7.3804295108687225274343927948483016310862e-02Q; /* Bessel function of the second kind, order zero. */ diff --git a/libquadmath/math/sqrtq.c b/libquadmath/math/sqrtq.c index f63c0d1..56ea5d3 100644 --- a/libquadmath/math/sqrtq.c +++ b/libquadmath/math/sqrtq.c @@ -32,14 +32,17 @@ sqrtq (const __float128 x) } #ifdef HAVE_SQRTL - if (x <= LDBL_MAX && x >= LDBL_MIN) { - /* Use long double result as starting point. */ - y = sqrtl ((long double) x); - - /* One Newton iteration. */ - y -= 0.5q * (y - x / y); - return y; + long double xl = (long double) x; + if (xl <= LDBL_MAX && xl >= LDBL_MIN) + { + /* Use long double result as starting point. */ + y = (__float128) sqrtl (xl); + + /* One Newton iteration. */ + y -= 0.5q * (y - x / y); + return y; + } } #endif |