ce426f
# commit 4ebd120cd983c8d2ac7a234884b3ac6805d82973
ce426f
# Author: Alan Modra <amodra@gmail.com>
ce426f
# Date:   Sat Aug 17 18:24:05 2013 +0930
ce426f
# 
ce426f
#     PowerPC floating point little-endian [2 of 15]
ce426f
#     http://sourceware.org/ml/libc-alpha/2013-08/msg00082.html
ce426f
#     
ce426f
#     This patch replaces occurrences of GET_LDOUBLE_* and SET_LDOUBLE_*
ce426f
#     macros, and union ieee854_long_double_shape_type in ldbl-128ibm/,
ce426f
#     and a stray one in the 32-bit fpu support.  These files have no
ce426f
#     significant changes apart from rewriting the long double bit access.
ce426f
#     
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_high): Define.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_acoshl.c (__ieee754_acoshl): Rewrite
ce426f
#         all uses of ieee854 long double macros and unions.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_acosl.c (__ieee754_acosl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_asinl.c (__ieee754_asinl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_atanhl.c (__ieee754_atanhl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_coshl.c (__ieee754_coshl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_log2l.c (__ieee754_log2l): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c (__ieee754_rem_pio2l):
ce426f
#         Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/e_sinhl.c (__ieee754_sinhl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/k_cosl.c (__kernel_cosl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/k_sincosl.c (__kernel_sincosl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_asinhl.c (__asinhl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_atanl.c (__atanl): Likewise.
ce426f
#         Simplify sign and nan test too.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_cosl.c (__cosl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (__fabsl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_finitel.c (___finitel): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c (___fpclassifyl):
ce426f
#         Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_isnanl.c (___isnanl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c (__issignalingl):
ce426f
#         Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_logbl.c (__logbl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_signbitl.c (___signbitl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_sincosl.c (__sincosl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_sinl.c (__sinl): Likewise.
ce426f
#         * sysdeps/ieee754/ldbl-128ibm/s_tanl.c (__tanl): Likewise.
ce426f
#         * sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c (__logbl): Likewise.
ce426f
# 
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -36,8 +36,12 @@
ce426f
 {
ce426f
 	long double t;
ce426f
 	int64_t hx;
ce426f
-	u_int64_t lx;
ce426f
-	GET_LDOUBLE_WORDS64(hx,lx,x);
ce426f
+	uint64_t lx;
ce426f
+	double xhi, xlo;
ce426f
+
ce426f
+	ldbl_unpack (x, &xhi, &xlo;;
ce426f
+	EXTRACT_WORDS64 (hx, xhi);
ce426f
+	EXTRACT_WORDS64 (lx, xlo);
ce426f
 	if(hx<0x3ff0000000000000LL) {		/* x < 1 */
ce426f
 	    return (x-x)/(x-x);
ce426f
 	} else if(hx >=0x41b0000000000000LL) {	/* x > 2**28 */
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -151,26 +151,25 @@
ce426f
 long double
ce426f
 __ieee754_acosl (long double x)
ce426f
 {
ce426f
-  long double z, r, w, p, q, s, t, f2;
ce426f
-  ieee854_long_double_shape_type u;
ce426f
+  long double a, z, r, w, p, q, s, t, f2;
ce426f
 
ce426f
-  u.value = __builtin_fabsl (x);
ce426f
-  if (u.value == 1.0L)
ce426f
+  a = __builtin_fabsl (x);
ce426f
+  if (a == 1.0L)
ce426f
     {
ce426f
       if (x > 0.0L)
ce426f
 	return 0.0;		/* acos(1) = 0  */
ce426f
       else
ce426f
 	return (2.0 * pio2_hi) + (2.0 * pio2_lo);	/* acos(-1)= pi */
ce426f
     }
ce426f
-  else if (u.value > 1.0L)
ce426f
+  else if (a > 1.0L)
ce426f
     {
ce426f
       return (x - x) / (x - x);	/* acos(|x| > 1) is NaN */
ce426f
     }
ce426f
-  if (u.value < 0.5L)
ce426f
+  if (a < 0.5L)
ce426f
     {
ce426f
-      if (u.value < 6.938893903907228e-18L)	/* |x| < 2**-57 */
ce426f
+      if (a < 6.938893903907228e-18L)	/* |x| < 2**-57 */
ce426f
 	return pio2_hi + pio2_lo;
ce426f
-      if (u.value < 0.4375L)
ce426f
+      if (a < 0.4375L)
ce426f
 	{
ce426f
 	  /* Arcsine of x.  */
ce426f
 	  z = x * x;
ce426f
@@ -199,7 +198,7 @@
ce426f
 	  return z;
ce426f
 	}
ce426f
       /* .4375 <= |x| < .5 */
ce426f
-      t = u.value - 0.4375L;
ce426f
+      t = a - 0.4375L;
ce426f
       p = ((((((((((P10 * t
ce426f
 		    + P9) * t
ce426f
 		   + P8) * t
ce426f
@@ -230,9 +229,9 @@
ce426f
 	r = acosr4375 + r;
ce426f
       return r;
ce426f
     }
ce426f
-  else if (u.value < 0.625L)
ce426f
+  else if (a < 0.625L)
ce426f
     {
ce426f
-      t = u.value - 0.5625L;
ce426f
+      t = a - 0.5625L;
ce426f
       p = ((((((((((rS10 * t
ce426f
 		    + rS9) * t
ce426f
 		   + rS8) * t
ce426f
@@ -264,7 +263,9 @@
ce426f
     }
ce426f
   else
ce426f
     {				/* |x| >= .625 */
ce426f
-      z = (one - u.value) * 0.5;
ce426f
+      double shi, slo;
ce426f
+
ce426f
+      z = (one - a) * 0.5;
ce426f
       s = __ieee754_sqrtl (z);
ce426f
       /* Compute an extended precision square root from
ce426f
 	 the Newton iteration  s -> 0.5 * (s + z / s).
ce426f
@@ -273,12 +274,11 @@
ce426f
 	  Express s = f1 + f2 where f1 * f1 is exactly representable.
ce426f
 	  w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s .
ce426f
 	  s + w has extended precision.  */
ce426f
-      u.value = s;
ce426f
-      u.parts32.w2 = 0;
ce426f
-      u.parts32.w3 = 0;
ce426f
-      f2 = s - u.value;
ce426f
-      w = z - u.value * u.value;
ce426f
-      w = w - 2.0 * u.value * f2;
ce426f
+      ldbl_unpack (s, &shi, &slo;;
ce426f
+      a = shi;
ce426f
+      f2 = slo;
ce426f
+      w = z - a * a;
ce426f
+      w = w - 2.0 * a * f2;
ce426f
       w = w - f2 * f2;
ce426f
       w = w / (2.0 * s);
ce426f
       /* Arcsine of s.  */
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -131,19 +131,18 @@
ce426f
 long double
ce426f
 __ieee754_asinl (long double x)
ce426f
 {
ce426f
-  long double t, w, p, q, c, r, s;
ce426f
+  long double a, t, w, p, q, c, r, s;
ce426f
   int flag;
ce426f
-  ieee854_long_double_shape_type u;
ce426f
 
ce426f
   flag = 0;
ce426f
-  u.value = __builtin_fabsl (x);
ce426f
-  if (u.value == 1.0L)	/* |x|>= 1 */
ce426f
+  a = __builtin_fabsl (x);
ce426f
+  if (a == 1.0L)	/* |x|>= 1 */
ce426f
     return x * pio2_hi + x * pio2_lo;	/* asin(1)=+-pi/2 with inexact */
ce426f
-  else if (u.value >= 1.0L)
ce426f
+  else if (a >= 1.0L)
ce426f
     return (x - x) / (x - x);	/* asin(|x|>1) is NaN */
ce426f
-  else if (u.value < 0.5L)
ce426f
+  else if (a < 0.5L)
ce426f
     {
ce426f
-      if (u.value < 6.938893903907228e-18L) /* |x| < 2**-57 */
ce426f
+      if (a < 6.938893903907228e-18L) /* |x| < 2**-57 */
ce426f
 	{
ce426f
 	  if (huge + x > one)
ce426f
 	    return x;		/* return x with inexact if x!=0 */
ce426f
@@ -155,9 +154,9 @@
ce426f
 	  flag = 1;
ce426f
 	}
ce426f
     }
ce426f
-  else if (u.value < 0.625L)
ce426f
+  else if (a < 0.625L)
ce426f
     {
ce426f
-      t = u.value - 0.5625;
ce426f
+      t = a - 0.5625;
ce426f
       p = ((((((((((rS10 * t
ce426f
 		    + rS9) * t
ce426f
 		   + rS8) * t
ce426f
@@ -190,7 +189,7 @@
ce426f
   else
ce426f
     {
ce426f
       /* 1 > |x| >= 0.625 */
ce426f
-      w = one - u.value;
ce426f
+      w = one - a;
ce426f
       t = w * 0.5;
ce426f
     }
ce426f
 
ce426f
@@ -223,17 +222,14 @@
ce426f
     }
ce426f
 
ce426f
   s = __ieee754_sqrtl (t);
ce426f
-  if (u.value > 0.975L)
ce426f
+  if (a > 0.975L)
ce426f
     {
ce426f
       w = p / q;
ce426f
       t = pio2_hi - (2.0 * (s + s * w) - pio2_lo);
ce426f
     }
ce426f
   else
ce426f
     {
ce426f
-      u.value = s;
ce426f
-      u.parts32.w3 = 0;
ce426f
-      u.parts32.w2 = 0;
ce426f
-      w = u.value;
ce426f
+      w = ldbl_high (s);
ce426f
       c = (t - w * w) / (s + w);
ce426f
       r = p / q;
ce426f
       p = 2.0 * s * r - (pio2_lo - 2.0 * c);
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -40,8 +40,10 @@
ce426f
 {
ce426f
 	long double t;
ce426f
 	int64_t hx,ix;
ce426f
-	u_int64_t lx __attribute__ ((unused));
ce426f
-	GET_LDOUBLE_WORDS64(hx,lx,x);
ce426f
+	double xhi;
ce426f
+
ce426f
+	xhi = ldbl_high (x);
ce426f
+	EXTRACT_WORDS64 (hx, xhi);
ce426f
 	ix = hx&0x7fffffffffffffffLL;
ce426f
 	if (ix >= 0x3ff0000000000000LL) { /* |x|>=1 */
ce426f
 	    if (ix > 0x3ff0000000000000LL)
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -41,9 +41,11 @@
ce426f
 {
ce426f
 	long double t,w;
ce426f
 	int64_t ix;
ce426f
+	double xhi;
ce426f
 
ce426f
     /* High word of |x|. */
ce426f
-	GET_LDOUBLE_MSW64(ix,x);
ce426f
+	xhi = ldbl_high (x);
ce426f
+	EXTRACT_WORDS64 (ix, xhi);
ce426f
 	ix &= 0x7fffffffffffffffLL;
ce426f
 
ce426f
     /* x is INF or NaN */
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -177,11 +177,13 @@
ce426f
   long double z;
ce426f
   long double y;
ce426f
   int e;
ce426f
-  int64_t hx, lx;
ce426f
+  int64_t hx;
ce426f
+  double xhi;
ce426f
 
ce426f
 /* Test for domain */
ce426f
-  GET_LDOUBLE_WORDS64 (hx, lx, x);
ce426f
-  if (((hx & 0x7fffffffffffffffLL) | (lx & 0x7fffffffffffffffLL)) == 0)
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (hx, xhi);
ce426f
+  if ((hx & 0x7fffffffffffffffLL) == 0)
ce426f
     return (-1.0L / (x - x));
ce426f
   if (hx < 0)
ce426f
     return (x - x) / (x - x);
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -200,10 +200,11 @@
ce426f
   double tx[8];
ce426f
   int exp;
ce426f
   int64_t n, ix, hx, ixd;
ce426f
-  u_int64_t lx __attribute__ ((unused));
ce426f
   u_int64_t lxd;
ce426f
+  double xhi;
ce426f
 
ce426f
-  GET_LDOUBLE_WORDS64 (hx, lx, x);
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (hx, xhi);
ce426f
   ix = hx & 0x7fffffffffffffffLL;
ce426f
   if (ix <= 0x3fe921fb54442d10LL)	/* x in <-pi/4, pi/4> */
ce426f
     {
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -38,9 +38,11 @@
ce426f
 {
ce426f
 	long double t,w,h;
ce426f
 	int64_t ix,jx;
ce426f
+	double xhi;
ce426f
 
ce426f
     /* High word of |x|. */
ce426f
-	GET_LDOUBLE_MSW64(jx,x);
ce426f
+	xhi = ldbl_high (x);
ce426f
+	EXTRACT_WORDS64 (jx, xhi);
ce426f
 	ix = jx&0x7fffffffffffffffLL;
ce426f
 
ce426f
     /* x is INF or NaN */
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -81,8 +81,11 @@
ce426f
 {
ce426f
   long double h, l, z, sin_l, cos_l_m1;
ce426f
   int64_t ix;
ce426f
-  u_int32_t tix, hix, index;
ce426f
-  GET_LDOUBLE_MSW64 (ix, x);
ce426f
+  uint32_t tix, hix, index;
ce426f
+  double xhi, hhi;
ce426f
+
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (ix, xhi);
ce426f
   tix = ((u_int64_t)ix) >> 32;
ce426f
   tix &= ~0x80000000;			/* tix = |x|'s high 32 bits */
ce426f
   if (tix < 0x3fc30000)			/* |x| < 0.1484375 */
ce426f
@@ -136,7 +139,8 @@
ce426f
 	case 2: index = (hix - 0x3fc30000) >> 14; break;
ce426f
 	}
ce426f
 */
ce426f
-      SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
ce426f
+      INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32);
ce426f
+      h = hhi;
ce426f
       l = y - (h - x);
ce426f
       z = l * l;
ce426f
       sin_l = l*(ONE+z*(SSIN1+z*(SSIN2+z*(SSIN3+z*(SSIN4+z*SSIN5)))));
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -100,9 +100,12 @@
ce426f
 {
ce426f
   long double h, l, z, sin_l, cos_l_m1;
ce426f
   int64_t ix;
ce426f
-  u_int32_t tix, hix, index;
ce426f
-  GET_LDOUBLE_MSW64 (ix, x);
ce426f
-  tix = ((u_int64_t)ix) >> 32;
ce426f
+  uint32_t tix, hix, index;
ce426f
+  double xhi, hhi;
ce426f
+
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (ix, xhi);
ce426f
+  tix = ((uint64_t)ix) >> 32;
ce426f
   tix &= ~0x80000000;			/* tix = |x|'s high 32 bits */
ce426f
   if (tix < 0x3fc30000)			/* |x| < 0.1484375 */
ce426f
     {
ce426f
@@ -164,7 +167,8 @@
ce426f
 	case 2: index = (hix - 0x3fc30000) >> 14; break;
ce426f
 	}
ce426f
 */
ce426f
-      SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
ce426f
+      INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32);
ce426f
+      h = hhi;
ce426f
       if (iy)
ce426f
 	l = y - (h - x);
ce426f
       else
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -82,7 +82,10 @@
ce426f
   long double h, l, z, sin_l, cos_l_m1;
ce426f
   int64_t ix;
ce426f
   u_int32_t tix, hix, index;
ce426f
-  GET_LDOUBLE_MSW64 (ix, x);
ce426f
+  double xhi, hhi;
ce426f
+
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (ix, xhi);
ce426f
   tix = ((u_int64_t)ix) >> 32;
ce426f
   tix &= ~0x80000000;			/* tix = |x|'s high 32 bits */
ce426f
   if (tix < 0x3fc30000)			/* |x| < 0.1484375 */
ce426f
@@ -132,7 +135,8 @@
ce426f
 	case 2: index = (hix - 0x3fc30000) >> 14; break;
ce426f
 	}
ce426f
 */
ce426f
-      SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
ce426f
+      INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32);
ce426f
+      h = hhi;
ce426f
       if (iy)
ce426f
 	l = (ix < 0 ? -y : y) - (h - x);
ce426f
       else
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -38,7 +38,10 @@
ce426f
 {
ce426f
 	long double t,w;
ce426f
 	int64_t hx,ix;
ce426f
-	GET_LDOUBLE_MSW64(hx,x);
ce426f
+	double xhi;
ce426f
+
ce426f
+	xhi = ldbl_high (x);
ce426f
+	EXTRACT_WORDS64 (hx, xhi);
ce426f
 	ix = hx&0x7fffffffffffffffLL;
ce426f
 	if(ix>=0x7ff0000000000000LL) return x+x;	/* x is inf or NaN */
ce426f
 	if(ix< 0x3e20000000000000LL) {	/* |x|<2**-29 */
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -173,23 +173,20 @@
ce426f
 long double
ce426f
 __atanl (long double x)
ce426f
 {
ce426f
-  int k, sign;
ce426f
+  int32_t k, sign, lx;
ce426f
   long double t, u, p, q;
ce426f
-  ieee854_long_double_shape_type s;
ce426f
+  double xhi;
ce426f
 
ce426f
-  s.value = x;
ce426f
-  k = s.parts32.w0;
ce426f
-  if (k & 0x80000000)
ce426f
-    sign = 1;
ce426f
-  else
ce426f
-    sign = 0;
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS (k, lx, xhi);
ce426f
+  sign = k & 0x80000000;
ce426f
 
ce426f
   /* Check for IEEE special cases.  */
ce426f
   k &= 0x7fffffff;
ce426f
   if (k >= 0x7ff00000)
ce426f
     {
ce426f
       /* NaN. */
ce426f
-      if ((k & 0xfffff) | s.parts32.w1 )
ce426f
+      if (((k - 0x7ff00000) | lx) != 0)
ce426f
 	return (x + x);
ce426f
 
ce426f
       /* Infinity. */
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -53,9 +53,11 @@
ce426f
 {
ce426f
 	long double y[2],z=0.0L;
ce426f
 	int64_t n, ix;
ce426f
+	double xhi;
ce426f
 
ce426f
     /* High word of x. */
ce426f
-	GET_LDOUBLE_MSW64(ix,x);
ce426f
+	xhi = ldbl_high (x);
ce426f
+	EXTRACT_WORDS64 (ix, xhi);
ce426f
 
ce426f
     /* |x| ~< pi/4 */
ce426f
 	ix &= 0x7fffffffffffffffLL;
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -29,10 +29,16 @@
ce426f
 long double __fabsl(long double x)
ce426f
 {
ce426f
 	u_int64_t hx, lx;
ce426f
-	GET_LDOUBLE_WORDS64(hx,lx,x);
ce426f
+	double xhi, xlo;
ce426f
+
ce426f
+	ldbl_unpack (x, &xhi, &xlo;;
ce426f
+	EXTRACT_WORDS64 (hx, xhi);
ce426f
+	EXTRACT_WORDS64 (lx, xlo);
ce426f
 	lx = lx ^ ( hx & 0x8000000000000000LL );
ce426f
 	hx = hx & 0x7fffffffffffffffLL;
ce426f
-	SET_LDOUBLE_WORDS64(x,hx,lx);
ce426f
+	INSERT_WORDS64 (xhi, hx);
ce426f
+	INSERT_WORDS64 (xlo, lx);
ce426f
+	x = ldbl_pack (xhi, xlo);
ce426f
 	return x;
ce426f
 }
ce426f
 long_double_symbol (libm, __fabsl, fabsl);
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -29,10 +29,14 @@
ce426f
 int
ce426f
 ___finitel (long double x)
ce426f
 {
ce426f
-	int64_t hx;
ce426f
-	GET_LDOUBLE_MSW64(hx,x);
ce426f
-	return (int)((u_int64_t)((hx&0x7fffffffffffffffLL)
ce426f
-				 -0x7ff0000000000000LL)>>63);
ce426f
+  uint64_t hx;
ce426f
+  double xhi;
ce426f
+
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (hx, xhi);
ce426f
+  hx &= 0x7fffffffffffffffLL;
ce426f
+  hx -= 0x7ff0000000000000LL;
ce426f
+  return hx >> 63;
ce426f
 }
ce426f
 hidden_ver (___finitel, __finitel)
ce426f
 weak_alias (___finitel, ____finitel)
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -46,8 +46,10 @@
ce426f
 {
ce426f
   u_int64_t hx, lx;
ce426f
   int retval = FP_NORMAL;
ce426f
+  double xhi, xlo;
ce426f
 
ce426f
-  GET_LDOUBLE_WORDS64 (hx, lx, x);
ce426f
+  ldbl_unpack (x, &xhi, &xlo;;
ce426f
+  EXTRACT_WORDS64 (hx, xhi);
ce426f
   if ((hx & 0x7ff0000000000000ULL) == 0x7ff0000000000000ULL) {
ce426f
       /* +/-NaN or +/-Inf */
ce426f
       if (hx & 0x000fffffffffffffULL) {
ce426f
@@ -65,6 +67,7 @@
ce426f
 	      retval = FP_NORMAL;
ce426f
 	  } else {
ce426f
 	      if ((hx & 0x7ff0000000000000ULL) == 0x0360000000000000ULL) {
ce426f
+		  EXTRACT_WORDS64 (lx, xlo);
ce426f
 		  if ((lx & 0x7fffffffffffffff)	/* lower is non-zero */
ce426f
 		  && ((lx^hx) & 0x8000000000000000ULL)) { /* and sign differs */
ce426f
 		      /* +/- denormal */
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c	2014-05-27 19:59:00.000000000 -0500
ce426f
@@ -29,12 +29,14 @@
ce426f
 int
ce426f
 ___isnanl (long double x)
ce426f
 {
ce426f
-	int64_t hx;
ce426f
-	int64_t lx __attribute__ ((unused));
ce426f
-	GET_LDOUBLE_WORDS64(hx,lx,x);
ce426f
-	hx &= 0x7fffffffffffffffLL;
ce426f
-	hx = 0x7ff0000000000000LL - hx;
ce426f
-	return (int)((u_int64_t)hx>>63);
ce426f
+  uint64_t hx;
ce426f
+  double xhi;
ce426f
+
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (hx, xhi);
ce426f
+  hx &= 0x7fffffffffffffffLL;
ce426f
+  hx = 0x7ff0000000000000LL - hx;
ce426f
+  return (int) (hx >> 63);
ce426f
 }
ce426f
 hidden_ver (___isnanl, __isnanl)
ce426f
 #ifndef IS_IN_libm
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_logbl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_logbl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_logbl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_logbl.c	2014-05-27 19:59:19.000000000 -0500
ce426f
@@ -27,9 +27,10 @@
ce426f
 __logbl (long double x)
ce426f
 {
ce426f
   int64_t hx, rhx;
ce426f
-  int64_t lx __attribute__ ((unused));
ce426f
+  double xhi;
ce426f
 
ce426f
-  GET_LDOUBLE_WORDS64 (hx, lx, x);
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (hx, xhi);
ce426f
   hx &= 0x7fffffffffffffffLL;	/* high |x| */
ce426f
   if (hx == 0)
ce426f
     return -1.0 / fabs (x);
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_signbitl.c	2014-05-27 19:59:19.000000000 -0500
ce426f
@@ -25,8 +25,10 @@
ce426f
 ___signbitl (long double x)
ce426f
 {
ce426f
   int64_t e;
ce426f
+  double xhi;
ce426f
 
ce426f
-  GET_LDOUBLE_MSW64 (e, x);
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (e, xhi);
ce426f
   return e < 0;
ce426f
 }
ce426f
 #ifdef IS_IN_libm
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sincosl.c	2014-05-27 19:59:19.000000000 -0500
ce426f
@@ -27,9 +27,11 @@
ce426f
 __sincosl (long double x, long double *sinx, long double *cosx)
ce426f
 {
ce426f
   int64_t ix;
ce426f
+  double xhi;
ce426f
 
ce426f
   /* High word of x. */
ce426f
-  GET_LDOUBLE_MSW64 (ix, x);
ce426f
+  xhi = ldbl_high (x);
ce426f
+  EXTRACT_WORDS64 (ix, xhi);
ce426f
 
ce426f
   /* |x| ~< pi/4 */
ce426f
   ix &= 0x7fffffffffffffffLL;
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c	2014-05-27 19:59:19.000000000 -0500
ce426f
@@ -53,9 +53,11 @@
ce426f
 {
ce426f
 	long double y[2],z=0.0L;
ce426f
 	int64_t n, ix;
ce426f
+	double xhi;
ce426f
 
ce426f
     /* High word of x. */
ce426f
-	GET_LDOUBLE_MSW64(ix,x);
ce426f
+	xhi = ldbl_high (x);
ce426f
+	EXTRACT_WORDS64 (ix, xhi);
ce426f
 
ce426f
     /* |x| ~< pi/4 */
ce426f
 	ix &= 0x7fffffffffffffffLL;
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c	2014-05-27 19:59:19.000000000 -0500
ce426f
@@ -53,9 +53,11 @@
ce426f
 {
ce426f
 	long double y[2],z=0.0L;
ce426f
 	int64_t n, ix;
ce426f
+	double xhi;
ce426f
 
ce426f
     /* High word of x. */
ce426f
-	GET_LDOUBLE_MSW64(ix,x);
ce426f
+	xhi = ldbl_high (x);
ce426f
+	EXTRACT_WORDS64 (ix, xhi);
ce426f
 
ce426f
     /* |x| ~< pi/4 */
ce426f
 	ix &= 0x7fffffffffffffffLL;
ce426f
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c
ce426f
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c	2014-05-27 19:58:07.000000000 -0500
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c	2014-05-27 19:59:19.000000000 -0500
ce426f
@@ -35,14 +35,14 @@
ce426f
 long double
ce426f
 __logbl (long double x)
ce426f
 {
ce426f
-  double xh, xl;
ce426f
+  double xh;
ce426f
   double ret;
ce426f
 
ce426f
   if (__builtin_expect (x == 0.0L, 0))
ce426f
     /* Raise FE_DIVBYZERO and return -HUGE_VAL[LF].  */
ce426f
     return -1.0L / __builtin_fabsl (x);
ce426f
 
ce426f
-  ldbl_unpack (x, &xh, &xl);
ce426f
+  xh = ldbl_high (x);
ce426f
   /* ret = x & 0x7ff0000000000000;  */
ce426f
   asm (
ce426f
     "xxland %x0,%x1,%x2\n"
ce426f
@@ -58,9 +58,9 @@
ce426f
     {
ce426f
       /* POSIX specifies that denormal number is treated as
ce426f
          though it were normalized.  */
ce426f
-      int64_t lx, hx;
ce426f
+      int64_t hx;
ce426f
 
ce426f
-      GET_LDOUBLE_WORDS64 (hx, lx, x);
ce426f
+      EXTRACT_WORDS64 (hx, xh);
ce426f
       return (long double) (-1023 - (__builtin_clzll (hx) - 12));
ce426f
     }
ce426f
   /* Test to avoid logb_downward (0.0) == -0.0.  */