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