mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
fe920c2d9f
commit
0c949f0a1c
|
|
@ -1,3 +1,20 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2017-07-19 Gerald Pfeifer <gerald@pfeifer.com>
|
2017-07-19 Gerald Pfeifer <gerald@pfeifer.com>
|
||||||
|
|
||||||
* math/powq.c (powq): Use uint32_t instead of u_int32_t.
|
* math/powq.c (powq): Use uint32_t instead of u_int32_t.
|
||||||
|
|
|
||||||
|
|
@ -12516,7 +12516,11 @@ else
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
|
||||||
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
||||||
|
#else
|
||||||
|
typedef _Complex float __attribute__((mode(KC))) __complex128;
|
||||||
|
#endif
|
||||||
|
|
||||||
__float128 foo (__float128 x)
|
__float128 foo (__float128 x)
|
||||||
{
|
{
|
||||||
|
|
@ -12563,7 +12567,11 @@ fi
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
|
||||||
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
||||||
|
#else
|
||||||
|
typedef _Complex float __attribute__((mode(KC))) __complex128;
|
||||||
|
#endif
|
||||||
|
|
||||||
__float128 foo (__float128 x)
|
__float128 foo (__float128 x)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,11 @@ AM_CONDITIONAL(LIBQUAD_USE_SYMVER_SUN, [test "x$quadmath_use_symver" = xsun])
|
||||||
|
|
||||||
AC_CACHE_CHECK([whether __float128 is supported], [libquad_cv_have_float128],
|
AC_CACHE_CHECK([whether __float128 is supported], [libquad_cv_have_float128],
|
||||||
[GCC_TRY_COMPILE_OR_LINK([
|
[GCC_TRY_COMPILE_OR_LINK([
|
||||||
|
#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
|
||||||
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
||||||
|
#else
|
||||||
|
typedef _Complex float __attribute__((mode(KC))) __complex128;
|
||||||
|
#endif
|
||||||
|
|
||||||
__float128 foo (__float128 x)
|
__float128 foo (__float128 x)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -56,10 +56,10 @@ Adapted for glibc October, 2001.
|
||||||
|
|
||||||
#include "quadmath-imp.h"
|
#include "quadmath-imp.h"
|
||||||
|
|
||||||
static const long double CBRT2 = 1.259921049894873164767210607278228350570251Q;
|
static const __float128 CBRT2 = 1.259921049894873164767210607278228350570251Q;
|
||||||
static const long double CBRT4 = 1.587401051968199474751705639272308260391493Q;
|
static const __float128 CBRT4 = 1.587401051968199474751705639272308260391493Q;
|
||||||
static const long double CBRT2I = 0.7937005259840997373758528196361541301957467Q;
|
static const __float128 CBRT2I = 0.7937005259840997373758528196361541301957467Q;
|
||||||
static const long double CBRT4I = 0.6299605249474365823836053036391141752851257Q;
|
static const __float128 CBRT4I = 0.6299605249474365823836053036391141752851257Q;
|
||||||
|
|
||||||
|
|
||||||
__float128
|
__float128
|
||||||
|
|
|
||||||
|
|
@ -816,7 +816,7 @@ static __float128 Y0_2D[NY0_2D + 1] = {
|
||||||
/* 1.000000000000000000000000000000000000000E0 */
|
/* 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. */
|
/* Bessel function of the second kind, order zero. */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,14 +32,17 @@ sqrtq (const __float128 x)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SQRTL
|
#ifdef HAVE_SQRTL
|
||||||
if (x <= LDBL_MAX && x >= LDBL_MIN)
|
|
||||||
{
|
{
|
||||||
/* Use long double result as starting point. */
|
long double xl = (long double) x;
|
||||||
y = sqrtl ((long double) x);
|
if (xl <= LDBL_MAX && xl >= LDBL_MIN)
|
||||||
|
{
|
||||||
|
/* Use long double result as starting point. */
|
||||||
|
y = (__float128) sqrtl (xl);
|
||||||
|
|
||||||
/* One Newton iteration. */
|
/* One Newton iteration. */
|
||||||
y -= 0.5q * (y - x / y);
|
y -= 0.5q * (y - x / y);
|
||||||
return y;
|
return y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,11 @@ extern "C" {
|
||||||
|
|
||||||
/* Define the complex type corresponding to __float128
|
/* Define the complex type corresponding to __float128
|
||||||
("_Complex __float128" is not allowed) */
|
("_Complex __float128" is not allowed) */
|
||||||
|
#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
|
||||||
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
typedef _Complex float __attribute__((mode(TC))) __complex128;
|
||||||
|
#else
|
||||||
|
typedef _Complex float __attribute__((mode(KC))) __complex128;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
# define __quadmath_throw throw ()
|
# define __quadmath_throw throw ()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue