+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>
* math/powq.c (powq): Use uint32_t instead of u_int32_t.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
typedef _Complex float __attribute__((mode(TC))) __complex128;
+ #else
+ typedef _Complex float __attribute__((mode(KC))) __complex128;
+ #endif
__float128 foo (__float128 x)
{
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
typedef _Complex float __attribute__((mode(TC))) __complex128;
+ #else
+ typedef _Complex float __attribute__((mode(KC))) __complex128;
+ #endif
__float128 foo (__float128 x)
{
AC_CACHE_CHECK([whether __float128 is supported], [libquad_cv_have_float128],
[GCC_TRY_COMPILE_OR_LINK([
+ #if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
typedef _Complex float __attribute__((mode(TC))) __complex128;
+ #else
+ typedef _Complex float __attribute__((mode(KC))) __complex128;
+ #endif
__float128 foo (__float128 x)
{
#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
/* 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. */
}
#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
/* Define the complex type corresponding to __float128
("_Complex __float128" is not allowed) */
+#if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__)
typedef _Complex float __attribute__((mode(TC))) __complex128;
+#else
+typedef _Complex float __attribute__((mode(KC))) __complex128;
+#endif
#ifdef __cplusplus
# define __quadmath_throw throw ()