arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-ppc64le-04.patch

147e83
# commit 9605ca6c085a749f29b6866a3e00bce1ba1a2698
147e83
# Author: Alan Modra <amodra@gmail.com>
147e83
# Date:   Sat Aug 17 18:12:56 2013 +0930
147e83
# 
147e83
#     IBM long double mechanical changes to support little-endian
147e83
#     http://sourceware.org/ml/libc-alpha/2013-07/msg00001.html
147e83
#     
147e83
#     This patch starts the process of supporting powerpc64 little-endian
147e83
#     long double in glibc.  IBM long double is an array of two ieee
147e83
#     doubles, so making union ibm_extended_long_double reflect this fact is
147e83
#     the correct way to access fields of the doubles.
147e83
#     
147e83
#         * sysdeps/ieee754/ldbl-128ibm/ieee754.h
147e83
#         (union ibm_extended_long_double): Define as an array of ieee754_double.
147e83
#         (IBM_EXTENDED_LONG_DOUBLE_BIAS): Delete.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Update all references
147e83
#         to ibm_extended_long_double and IBM_EXTENDED_LONG_DOUBLE_BIAS.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/e_exp10l.c: Likewise.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/e_expl.c: Likewise.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c: Likewise.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h: Likewise.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: Likewise.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Likewise.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/strtold_l.c: Likewise.
147e83
#         * sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c: Likewise.
147e83
# 
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_exp10l.c	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -36,9 +36,9 @@
147e83
   else if (arg > LDBL_MAX_10_EXP + 1)
147e83
     return LDBL_MAX * LDBL_MAX;
147e83
 
147e83
-  u.d = arg;
147e83
-  arg_high = u.dd[0];
147e83
-  arg_low = u.dd[1];
147e83
+  u.ld = arg;
147e83
+  arg_high = u.d[0].d;
147e83
+  arg_low = u.d[1].d;
147e83
   exp_high = arg_high * log10_high;
147e83
   exp_low = arg_high * log10_low + arg_low * M_LN10l;
147e83
   return __ieee754_expl (exp_high) * __ieee754_expl (exp_low);
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -162,39 +162,39 @@
147e83
       x = x + xl;
147e83
 
147e83
       /* Compute ex2 = 2^n_0 e^(argtable[tval1]) e^(argtable[tval2]).  */
147e83
-      ex2_u.d = __expl_table[T_EXPL_RES1 + tval1]
147e83
-		* __expl_table[T_EXPL_RES2 + tval2];
147e83
+      ex2_u.ld = (__expl_table[T_EXPL_RES1 + tval1]
147e83
+		  * __expl_table[T_EXPL_RES2 + tval2]);
147e83
       n_i = (int)n;
147e83
       /* 'unsafe' is 1 iff n_1 != 0.  */
147e83
       unsafe = fabsl(n_i) >= -LDBL_MIN_EXP - 1;
147e83
-      ex2_u.ieee.exponent += n_i >> unsafe;
147e83
+      ex2_u.d[0].ieee.exponent += n_i >> unsafe;
147e83
       /* Fortunately, there are no subnormal lowpart doubles in
147e83
 	 __expl_table, only normal values and zeros.
147e83
 	 But after scaling it can be subnormal.  */
147e83
-      exponent2 = ex2_u.ieee.exponent2 + (n_i >> unsafe);
147e83
-      if (ex2_u.ieee.exponent2 == 0)
147e83
-	/* assert ((ex2_u.ieee.mantissa2|ex2_u.ieee.mantissa3) == 0) */;
147e83
+      exponent2 = ex2_u.d[1].ieee.exponent + (n_i >> unsafe);
147e83
+      if (ex2_u.d[1].ieee.exponent == 0)
147e83
+	/* assert ((ex2_u.d[1].ieee.mantissa0|ex2_u.d[1].ieee.mantissa1) == 0) */;
147e83
       else if (exponent2 > 0)
147e83
-	ex2_u.ieee.exponent2 = exponent2;
147e83
+	ex2_u.d[1].ieee.exponent = exponent2;
147e83
       else if (exponent2 <= -54)
147e83
 	{
147e83
-	  ex2_u.ieee.exponent2 = 0;
147e83
-	  ex2_u.ieee.mantissa2 = 0;
147e83
-	  ex2_u.ieee.mantissa3 = 0;
147e83
+	  ex2_u.d[1].ieee.exponent = 0;
147e83
+	  ex2_u.d[1].ieee.mantissa0 = 0;
147e83
+	  ex2_u.d[1].ieee.mantissa1 = 0;
147e83
 	}
147e83
       else
147e83
 	{
147e83
 	  static const double
147e83
 	    two54 = 1.80143985094819840000e+16, /* 4350000000000000 */
147e83
 	    twom54 = 5.55111512312578270212e-17; /* 3C90000000000000 */
147e83
-	  ex2_u.dd[1] *= two54;
147e83
-	  ex2_u.ieee.exponent2 += n_i >> unsafe;
147e83
-	  ex2_u.dd[1] *= twom54;
147e83
+	  ex2_u.d[1].d *= two54;
147e83
+	  ex2_u.d[1].ieee.exponent += n_i >> unsafe;
147e83
+	  ex2_u.d[1].d *= twom54;
147e83
 	}
147e83
 
147e83
       /* Compute scale = 2^n_1.  */
147e83
-      scale_u.d = 1.0L;
147e83
-      scale_u.ieee.exponent += n_i - (n_i >> unsafe);
147e83
+      scale_u.ld = 1.0L;
147e83
+      scale_u.d[0].ieee.exponent += n_i - (n_i >> unsafe);
147e83
 
147e83
       /* Approximate e^x2 - 1, using a seventh-degree polynomial,
147e83
 	 with maximum error in [-2^-16-2^-53,2^-16+2^-53]
147e83
@@ -204,7 +204,7 @@
147e83
       /* Return result.  */
147e83
       fesetenv (&oldenv);
147e83
 
147e83
-      result = x22 * ex2_u.d + ex2_u.d;
147e83
+      result = x22 * ex2_u.ld + ex2_u.ld;
147e83
 
147e83
       /* Now we can test whether the result is ultimate or if we are unsure.
147e83
 	 In the later case we should probably call a mpn based routine to give
147e83
@@ -238,7 +238,7 @@
147e83
       if (!unsafe)
147e83
 	return result;
147e83
       else
147e83
-	return result * scale_u.d;
147e83
+	return result * scale_u.ld;
147e83
     }
147e83
   /* Exceptional cases:  */
147e83
   else if (isless (x, himark))
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ieee754.h	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -180,29 +180,9 @@
147e83
 
147e83
 union ibm_extended_long_double
147e83
   {
147e83
-    long double d;
147e83
-    double dd[2];
147e83
-
147e83
-    /* This is the IBM extended format long double.  */
147e83
-    struct
147e83
-      { /* Big endian.  There is no other.  */
147e83
-
147e83
-	unsigned int negative:1;
147e83
-	unsigned int exponent:11;
147e83
-	/* Together Mantissa0-3 comprise the mantissa.  */
147e83
-	unsigned int mantissa0:20;
147e83
-	unsigned int mantissa1:32;
147e83
-
147e83
-	unsigned int negative2:1;
147e83
-	unsigned int exponent2:11;
147e83
-	/* There is an implied 1 here?  */
147e83
-	/* Together these comprise the mantissa.  */
147e83
-	unsigned int mantissa2:20;
147e83
-	unsigned int mantissa3:32;
147e83
-      } ieee;
147e83
-   };
147e83
-
147e83
-#define IBM_EXTENDED_LONG_DOUBLE_BIAS 0x3ff /* Added to exponent.  */
147e83
+    long double ld;
147e83
+    union ieee754_double d[2];
147e83
+  };
147e83
 
147e83
 __END_DECLS
147e83
 
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -36,22 +36,22 @@
147e83
   union ibm_extended_long_double u;
147e83
   unsigned long long hi, lo;
147e83
   int ediff;
147e83
-  u.d = value;
147e83
+  u.ld = value;
147e83
 
147e83
-  *is_neg = u.ieee.negative;
147e83
-  *expt = (int) u.ieee.exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS;
147e83
+  *is_neg = u.d[0].ieee.negative;
147e83
+  *expt = (int) u.d[0].ieee.exponent - IEEE754_DOUBLE_BIAS;
147e83
 
147e83
-  lo = ((long long) u.ieee.mantissa2 << 32) | u.ieee.mantissa3;
147e83
-  hi = ((long long) u.ieee.mantissa0 << 32) | u.ieee.mantissa1;
147e83
+  lo = ((long long) u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1;
147e83
+  hi = ((long long) u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1;
147e83
   /* If the lower double is not a denomal or zero then set the hidden
147e83
      53rd bit.  */
147e83
-  if (u.ieee.exponent2 > 0)
147e83
+  if (u.d[1].ieee.exponent > 0)
147e83
     {
147e83
       lo |= 1LL << 52;
147e83
 
147e83
       /* The lower double is normalized separately from the upper.  We may
147e83
 	 need to adjust the lower manitissa to reflect this.  */
147e83
-      ediff = u.ieee.exponent - u.ieee.exponent2;
147e83
+      ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent;
147e83
       if (ediff > 53)
147e83
 	lo = lo >> (ediff-53);
147e83
     }
147e83
@@ -59,8 +59,8 @@
147e83
      difference between the long double and the rounded high double
147e83
      value.  This is indicated by a differnce between the signs of the
147e83
      high and low doubles.  */
147e83
-  if ((u.ieee.negative != u.ieee.negative2)
147e83
-      && ((u.ieee.exponent2 != 0) && (lo != 0L)))
147e83
+  if ((u.d[0].ieee.negative != u.d[1].ieee.negative)
147e83
+      && ((u.d[1].ieee.exponent != 0) && (lo != 0L)))
147e83
     {
147e83
       lo = (1ULL << 53) - lo;
147e83
       if (hi == 0LL)
147e83
@@ -92,7 +92,7 @@
147e83
 #define NUM_LEADING_ZEROS (BITS_PER_MP_LIMB \
147e83
 			   - (LDBL_MANT_DIG - ((N - 1) * BITS_PER_MP_LIMB)))
147e83
 
147e83
-  if (u.ieee.exponent == 0)
147e83
+  if (u.d[0].ieee.exponent == 0)
147e83
     {
147e83
       /* A biased exponent of zero is a special case.
147e83
 	 Either it is a zero or it is a denormal number.  */
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -14,28 +14,28 @@
147e83
      as bit 53 of the mantissa.  */
147e83
   uint64_t hi, lo;
147e83
   int ediff;
147e83
-  union ibm_extended_long_double eldbl;
147e83
-  eldbl.d = x;
147e83
-  *exp = eldbl.ieee.exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS;
147e83
+  union ibm_extended_long_double u;
147e83
+  u.ld = x;
147e83
+  *exp = u.d[0].ieee.exponent - IEEE754_DOUBLE_BIAS;
147e83
 
147e83
-  lo = ((int64_t)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3;
147e83
-  hi = ((int64_t)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1;
147e83
+  lo = ((uint64_t)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1;
147e83
+  hi = ((uint64_t)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1;
147e83
   /* If the lower double is not a denomal or zero then set the hidden
147e83
      53rd bit.  */
147e83
-  if (eldbl.ieee.exponent2 > 0x001)
147e83
+  if (u.d[1].ieee.exponent > 0x001)
147e83
     {
147e83
       lo |= (1ULL << 52);
147e83
       lo = lo << 7; /* pre-shift lo to match ieee854.  */
147e83
       /* The lower double is normalized separately from the upper.  We
147e83
 	 may need to adjust the lower manitissa to reflect this.  */
147e83
-      ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2;
147e83
+      ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent;
147e83
       if (ediff > 53)
147e83
 	lo = lo >> (ediff-53);
147e83
       hi |= (1ULL << 52);
147e83
     }
147e83
   
147e83
-  if ((eldbl.ieee.negative != eldbl.ieee.negative2)
147e83
-      && ((eldbl.ieee.exponent2 != 0) && (lo != 0LL)))
147e83
+  if ((u.d[0].ieee.negative != u.d[1].ieee.negative)
147e83
+      && ((u.d[1].ieee.exponent != 0) && (lo != 0LL)))
147e83
     {
147e83
       hi--;
147e83
       lo = (1ULL << 60) - lo;
147e83
@@ -58,10 +58,10 @@
147e83
   unsigned long hidden2, lzcount;
147e83
   unsigned long long hi, lo;
147e83
 
147e83
-  u.ieee.negative = sign;
147e83
-  u.ieee.negative2 = sign;
147e83
-  u.ieee.exponent = exp + IBM_EXTENDED_LONG_DOUBLE_BIAS;
147e83
-  u.ieee.exponent2 = exp-53 + IBM_EXTENDED_LONG_DOUBLE_BIAS;
147e83
+  u.d[0].ieee.negative = sign;
147e83
+  u.d[1].ieee.negative = sign;
147e83
+  u.d[0].ieee.exponent = exp + IEEE754_DOUBLE_BIAS;
147e83
+  u.d[1].ieee.exponent = exp-53 + IEEE754_DOUBLE_BIAS;
147e83
   /* Expect 113 bits (112 bits + hidden) right justified in two longs.
147e83
      The low order 53 bits (52 + hidden) go into the lower double */ 
147e83
   lo = (lo64 >> 7)& ((1ULL << 53) - 1);
147e83
@@ -78,7 +78,7 @@
147e83
       if (hidden2)
147e83
 	{
147e83
 	  hi++;
147e83
-	  u.ieee.negative2 = !sign;
147e83
+	  u.d[1].ieee.negative = !sign;
147e83
 	  lo = (1ULL << 53) - lo;
147e83
 	}
147e83
       /* The hidden bit of the lo mantissa is zero so we need to
147e83
@@ -94,32 +94,32 @@
147e83
       lzcount = lzcount - 11;
147e83
       if (lzcount > 0)
147e83
 	{
147e83
-	  int expnt2 = u.ieee.exponent2 - lzcount;
147e83
+	  int expnt2 = u.d[1].ieee.exponent - lzcount;
147e83
 	  if (expnt2 >= 1)
147e83
 	    {
147e83
 	      /* Not denormal.  Normalize and set low exponent.  */
147e83
 	      lo = lo << lzcount;
147e83
-	      u.ieee.exponent2 = expnt2;
147e83
+	      u.d[1].ieee.exponent = expnt2;
147e83
 	    }
147e83
 	  else
147e83
 	    {
147e83
 	      /* Is denormal.  */
147e83
 	      lo = lo << (lzcount + expnt2);
147e83
-	      u.ieee.exponent2 = 0;
147e83
+	      u.d[1].ieee.exponent = 0;
147e83
 	    }
147e83
 	}
147e83
     }
147e83
   else
147e83
     {
147e83
-      u.ieee.negative2 = 0;
147e83
-      u.ieee.exponent2 = 0;
147e83
+      u.d[1].ieee.negative = 0;
147e83
+      u.d[1].ieee.exponent = 0;
147e83
     }
147e83
 
147e83
-  u.ieee.mantissa3 = lo & ((1ULL << 32) - 1);
147e83
-  u.ieee.mantissa2 = (lo >> 32) & ((1ULL << 20) - 1);
147e83
-  u.ieee.mantissa1 = hi & ((1ULL << 32) - 1);
147e83
-  u.ieee.mantissa0 = (hi >> 32) & ((1ULL << 20) - 1);
147e83
-  return u.d;
147e83
+  u.d[1].ieee.mantissa1 = lo & ((1ULL << 32) - 1);
147e83
+  u.d[1].ieee.mantissa0 = (lo >> 32) & ((1ULL << 20) - 1);
147e83
+  u.d[0].ieee.mantissa1 = hi & ((1ULL << 32) - 1);
147e83
+  u.d[0].ieee.mantissa0 = (hi >> 32) & ((1ULL << 20) - 1);
147e83
+  return u.ld;
147e83
 }
147e83
   
147e83
 /* Handy utility functions to pack/unpack/cononicalize and find the nearbyint
147e83
@@ -128,18 +128,18 @@
147e83
 default_ldbl_pack (double a, double aa)
147e83
 {
147e83
   union ibm_extended_long_double u;
147e83
-  u.dd[0] = a;
147e83
-  u.dd[1] = aa;
147e83
-  return u.d;
147e83
+  u.d[0].d = a;
147e83
+  u.d[1].d = aa;
147e83
+  return u.ld;
147e83
 }
147e83
 
147e83
 static inline void
147e83
 default_ldbl_unpack (long double l, double *a, double *aa)
147e83
 {
147e83
   union ibm_extended_long_double u;
147e83
-  u.d = l;
147e83
-  *a = u.dd[0];
147e83
-  *aa = u.dd[1];
147e83
+  u.ld = l;
147e83
+  *a = u.d[0].d;
147e83
+  *aa = u.d[1].d;
147e83
 }
147e83
 
147e83
 #ifndef ldbl_pack
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -34,11 +34,11 @@
147e83
   unsigned long long hi, lo;
147e83
   int exponent2;
147e83
 
147e83
-  u.ieee.negative = sign;
147e83
-  u.ieee.negative2 = sign;
147e83
-  u.ieee.exponent = expt + IBM_EXTENDED_LONG_DOUBLE_BIAS;
147e83
-  u.ieee.exponent2 = 0;
147e83
-  exponent2 = expt - 53 + IBM_EXTENDED_LONG_DOUBLE_BIAS;
147e83
+  u.d[0].ieee.negative = sign;
147e83
+  u.d[1].ieee.negative = sign;
147e83
+  u.d[0].ieee.exponent = expt + IEEE754_DOUBLE_BIAS;
147e83
+  u.d[1].ieee.exponent = 0;
147e83
+  exponent2 = expt - 53 + IEEE754_DOUBLE_BIAS;
147e83
 
147e83
 #if BITS_PER_MP_LIMB == 32
147e83
   /* The low order 53 bits (52 + hidden) go into the lower double */
147e83
@@ -74,15 +74,15 @@
147e83
       else
147e83
 	lzcount = lzcount + 42;
147e83
 
147e83
-      if (lzcount > u.ieee.exponent)
147e83
+      if (lzcount > u.d[0].ieee.exponent)
147e83
 	{
147e83
-	  lzcount = u.ieee.exponent;
147e83
-	  u.ieee.exponent = 0;
147e83
+	  lzcount = u.d[0].ieee.exponent;
147e83
+	  u.d[0].ieee.exponent = 0;
147e83
 	  exponent2 -= lzcount;
147e83
 	}
147e83
       else
147e83
 	{
147e83
-	  u.ieee.exponent -= (lzcount - 1);
147e83
+	  u.d[0].ieee.exponent -= (lzcount - 1);
147e83
 	  exponent2 -= (lzcount - 1);
147e83
 	}
147e83
 
147e83
@@ -112,9 +112,9 @@
147e83
 	    {
147e83
 	      if ((hi & (1LL << 53)) != 0)
147e83
 		hi -= 1LL << 52;
147e83
-	      u.ieee.exponent++;
147e83
+	      u.d[0].ieee.exponent++;
147e83
 	    }
147e83
-	  u.ieee.negative2 = !sign;
147e83
+	  u.d[1].ieee.negative = !sign;
147e83
 	  lo = (1LL << 53) - lo;
147e83
 	}
147e83
 
147e83
@@ -135,17 +135,17 @@
147e83
 	  exponent2 = exponent2 - lzcount;
147e83
 	}
147e83
       if (exponent2 > 0)
147e83
-	u.ieee.exponent2 = exponent2;
147e83
+	u.d[1].ieee.exponent = exponent2;
147e83
       else
147e83
 	lo >>= 1 - exponent2;
147e83
     }
147e83
   else
147e83
-    u.ieee.negative2 = 0;
147e83
+    u.d[1].ieee.negative = 0;
147e83
 
147e83
-  u.ieee.mantissa3 = lo & 0xffffffffLL;
147e83
-  u.ieee.mantissa2 = (lo >> 32) & 0xfffff;
147e83
-  u.ieee.mantissa1 = hi & 0xffffffffLL;
147e83
-  u.ieee.mantissa0 = (hi >> 32) & ((1LL << (LDBL_MANT_DIG - 86)) - 1);
147e83
+  u.d[1].ieee.mantissa1 = lo & 0xffffffffLL;
147e83
+  u.d[1].ieee.mantissa0 = (lo >> 32) & 0xfffff;
147e83
+  u.d[0].ieee.mantissa1 = hi & 0xffffffffLL;
147e83
+  u.d[0].ieee.mantissa0 = (hi >> 32) & ((1LL << (LDBL_MANT_DIG - 86)) - 1);
147e83
 
147e83
-  return u.d;
147e83
+  return u.ld;
147e83
 }
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -27,31 +27,31 @@
147e83
       unsigned long long int num0, num1;				      \
147e83
       unsigned long long hi, lo;					      \
147e83
       int ediff;							      \
147e83
-      union ibm_extended_long_double eldbl;				      \
147e83
-      eldbl.d = fpnum.ldbl.d;						      \
147e83
+      union ibm_extended_long_double u;					      \
147e83
+      u.ld = fpnum.ldbl.d;						      \
147e83
 									      \
147e83
       assert (sizeof (long double) == 16);				      \
147e83
 									      \
147e83
-      lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3;    \
147e83
-      hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1;    \
147e83
+      lo = ((long long)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1;  \
147e83
+      hi = ((long long)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1;  \
147e83
       lo <<= 7; /* pre-shift lo to match ieee854.  */			      \
147e83
       /* If the lower double is not a denomal or zero then set the hidden     \
147e83
 	 53rd bit.  */							      \
147e83
-      if (eldbl.ieee.exponent2 != 0)					      \
147e83
+      if (u.d[1].ieee.exponent != 0)					      \
147e83
 	lo |= (1ULL << (52 + 7));					      \
147e83
       else								      \
147e83
 	lo <<= 1;							      \
147e83
       /* The lower double is normalized separately from the upper.  We	      \
147e83
 	 may need to adjust the lower manitissa to reflect this.  */	      \
147e83
-      ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2;		      \
147e83
+      ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent;		      \
147e83
       if (ediff > 53 + 63)						      \
147e83
 	lo = 0;								      \
147e83
       else if (ediff > 53)						      \
147e83
 	lo = lo >> (ediff - 53);					      \
147e83
-      else if (eldbl.ieee.exponent2 == 0 && ediff < 53)			      \
147e83
+      else if (u.d[1].ieee.exponent == 0 && ediff < 53)			      \
147e83
 	lo = lo << (53 - ediff);					      \
147e83
-      if (eldbl.ieee.negative != eldbl.ieee.negative2			      \
147e83
-	  && (eldbl.ieee.exponent2 != 0 || lo != 0L))			      \
147e83
+      if (u.d[0].ieee.negative != u.d[1].ieee.negative			      \
147e83
+	  && (u.d[1].ieee.exponent != 0 || lo != 0L))			      \
147e83
 	{								      \
147e83
 	  lo = (1ULL << 60) - lo;					      \
147e83
 	  if (hi == 0L)							      \
147e83
@@ -59,7 +59,7 @@
147e83
 	      /* we have a borrow from the hidden bit, so shift left 1.  */   \
147e83
 	      hi = 0xffffffffffffeLL | (lo >> 59);			      \
147e83
 	      lo = 0xfffffffffffffffLL & (lo << 1);			      \
147e83
-	      eldbl.ieee.exponent--;					      \
147e83
+	      u.d[0].ieee.exponent--;					      \
147e83
 	    }								      \
147e83
 	  else								      \
147e83
 	    hi--;							      \
147e83
@@ -110,9 +110,9 @@
147e83
 	  *--wnumstr = L'0';						      \
147e83
 	}								      \
147e83
 									      \
147e83
-      leading = eldbl.ieee.exponent == 0 ? '0' : '1';			      \
147e83
+      leading = u.d[0].ieee.exponent == 0 ? '0' : '1';			      \
147e83
 									      \
147e83
-      exponent = eldbl.ieee.exponent;					      \
147e83
+      exponent = u.d[0].ieee.exponent;					      \
147e83
 									      \
147e83
       if (exponent == 0)						      \
147e83
 	{								      \
147e83
@@ -122,18 +122,18 @@
147e83
 	    {								      \
147e83
 	      /* This is a denormalized number.  */			      \
147e83
 	      expnegative = 1;						      \
147e83
-	      exponent = IBM_EXTENDED_LONG_DOUBLE_BIAS - 1;		      \
147e83
+	      exponent = IEEE754_DOUBLE_BIAS - 1;			      \
147e83
 	    }								      \
147e83
 	}								      \
147e83
-      else if (exponent >= IBM_EXTENDED_LONG_DOUBLE_BIAS)		      \
147e83
+      else if (exponent >= IEEE754_DOUBLE_BIAS)				      \
147e83
 	{								      \
147e83
 	  expnegative = 0;						      \
147e83
-	  exponent -= IBM_EXTENDED_LONG_DOUBLE_BIAS;			      \
147e83
+	  exponent -= IEEE754_DOUBLE_BIAS;				      \
147e83
 	}								      \
147e83
       else								      \
147e83
 	{								      \
147e83
 	  expnegative = 1;						      \
147e83
-	  exponent = -(exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS);	      \
147e83
+	  exponent = -(exponent - IEEE754_DOUBLE_BIAS);			      \
147e83
 	}								      \
147e83
 } while (0)
147e83
 
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -33,11 +33,11 @@
147e83
   fenv_t env;
147e83
   static const long double TWO52 = 4503599627370496.0L;
147e83
   union ibm_extended_long_double u;
147e83
-  u.d = x;
147e83
+  u.ld = x;
147e83
 
147e83
-  if (fabs (u.dd[0]) < TWO52)
147e83
+  if (fabs (u.d[0].d) < TWO52)
147e83
     {
147e83
-      double high = u.dd[0];
147e83
+      double high = u.d[0].d;
147e83
       feholdexcept (&env;;
147e83
       if (high > 0.0)
147e83
 	{
147e83
@@ -51,11 +51,11 @@
147e83
 	  high += TWO52;
147e83
           if (high == 0.0) high = -0.0;
147e83
 	}
147e83
-      u.dd[0] = high;
147e83
-      u.dd[1] = 0.0;
147e83
+      u.d[0].d = high;
147e83
+      u.d[1].d = 0.0;
147e83
       fesetenv (&env;;
147e83
     }
147e83
-  else if (fabs (u.dd[1]) < TWO52 && u.dd[1] != 0.0)
147e83
+  else if (fabs (u.d[1].d) < TWO52 && u.d[1].d != 0.0)
147e83
     {
147e83
       double high, low, tau;
147e83
       /* In this case we have to round the low double and handle any
147e83
@@ -64,55 +64,55 @@
147e83
          may already be rounded and the low double may have the
147e83
          opposite sign to compensate.  */
147e83
       feholdexcept (&env;;
147e83
-      if (u.dd[0] > 0.0)
147e83
+      if (u.d[0].d > 0.0)
147e83
 	{
147e83
-	  if (u.dd[1] > 0.0)
147e83
+	  if (u.d[1].d > 0.0)
147e83
 	    {
147e83
 	      /* If the high/low doubles are the same sign then simply
147e83
 	         round the low double.  */
147e83
-	      high = u.dd[0];
147e83
-	      low = u.dd[1];
147e83
+	      high = u.d[0].d;
147e83
+	      low = u.d[1].d;
147e83
 	    }
147e83
-	  else if (u.dd[1] < 0.0)
147e83
+	  else if (u.d[1].d < 0.0)
147e83
 	    {
147e83
 	      /* Else the high double is pre rounded and we need to
147e83
 	         adjust for that.  */
147e83
 
147e83
-	      tau = __nextafter (u.dd[0], 0.0);
147e83
-	      tau = (u.dd[0] - tau) * 2.0;
147e83
-	      high = u.dd[0] - tau;
147e83
-	      low = u.dd[1] + tau;
147e83
+	      tau = __nextafter (u.d[0].d, 0.0);
147e83
+	      tau = (u.d[0].d - tau) * 2.0;
147e83
+	      high = u.d[0].d - tau;
147e83
+	      low = u.d[1].d + tau;
147e83
 	    }
147e83
 	  low += TWO52;
147e83
 	  low -= TWO52;
147e83
 	}
147e83
-      else if (u.dd[0] < 0.0)
147e83
+      else if (u.d[0].d < 0.0)
147e83
 	{
147e83
-	  if (u.dd[1] < 0.0)
147e83
+	  if (u.d[1].d < 0.0)
147e83
 	    {
147e83
 	      /* If the high/low doubles are the same sign then simply
147e83
 	         round the low double.  */
147e83
-	      high = u.dd[0];
147e83
-	      low = u.dd[1];
147e83
+	      high = u.d[0].d;
147e83
+	      low = u.d[1].d;
147e83
 	    }
147e83
-	  else if (u.dd[1] > 0.0)
147e83
+	  else if (u.d[1].d > 0.0)
147e83
 	    {
147e83
 	      /* Else the high double is pre rounded and we need to
147e83
 	         adjust for that.  */
147e83
-	      tau = __nextafter (u.dd[0], 0.0);
147e83
-	      tau = (u.dd[0] - tau) * 2.0;
147e83
-	      high = u.dd[0] - tau;
147e83
-	      low = u.dd[1] + tau;
147e83
+	      tau = __nextafter (u.d[0].d, 0.0);
147e83
+	      tau = (u.d[0].d - tau) * 2.0;
147e83
+	      high = u.d[0].d - tau;
147e83
+	      low = u.d[1].d + tau;
147e83
 	    }
147e83
 	  low = TWO52 - low;
147e83
 	  low = -(low - TWO52);
147e83
 	}
147e83
-      u.dd[0] = high + low;
147e83
-      u.dd[1] = high - u.dd[0] + low;
147e83
+      u.d[0].d = high + low;
147e83
+      u.d[1].d = high - u.d[0].d + low;
147e83
       fesetenv (&env;;
147e83
     }
147e83
 
147e83
-  return u.d;
147e83
+  return u.ld;
147e83
 }
147e83
 
147e83
 long_double_symbol (libm, __nearbyintl, nearbyintl);
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/strtold_l.c	2014-05-26 21:12:01.000000000 -0500
147e83
@@ -43,12 +43,11 @@
147e83
 #define FLOAT_HUGE_VAL	HUGE_VALL
147e83
 # define SET_MANTISSA(flt, mant) \
147e83
   do { union ibm_extended_long_double u;				      \
147e83
-       u.d = (flt);							      \
147e83
-       if ((mant & 0xfffffffffffffULL) == 0)				      \
147e83
-	 mant = 0x8000000000000ULL;					      \
147e83
-       u.ieee.mantissa0 = ((mant) >> 32) & 0xfffff;			      \
147e83
-       u.ieee.mantissa1 = (mant) & 0xffffffff;				      \
147e83
-       (flt) = u.d;							      \
147e83
+       u.ld = (flt);							      \
147e83
+       u.d[0].ieee_nan.mantissa0 = (mant) >> 32;				      \
147e83
+       u.d[0].ieee_nan.mantissa1 = (mant);				   	      \
147e83
+       if ((u.d[0].ieee.mantissa0 | u.d[0].ieee.mantissa1) != 0)	      \
147e83
+         (flt) = u.ld;							      \
147e83
   } while (0)
147e83
 
147e83
 #include <strtod_l.c>
147e83
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
147e83
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c	2014-05-26 21:08:01.000000000 -0500
147e83
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c	2014-05-26 21:08:10.000000000 -0500
147e83
@@ -89,23 +89,23 @@
147e83
   double vals[12];
147e83
   SET_RESTORE_ROUND (FE_TONEAREST);
147e83
   union ibm_extended_long_double xu, yu;
147e83
-  xu.d = x;
147e83
-  yu.d = y;
147e83
-  if (fabs (xu.dd[1]) < 0x1p-500)
147e83
-    xu.dd[1] = 0.0;
147e83
-  if (fabs (yu.dd[1]) < 0x1p-500)
147e83
-    yu.dd[1] = 0.0;
147e83
-  mul_split (&vals[1], &vals[0], xu.dd[0], xu.dd[0]);
147e83
-  mul_split (&vals[3], &vals[2], xu.dd[0], xu.dd[1]);
147e83
+  xu.ld = x;
147e83
+  yu.ld = y;
147e83
+  if (fabs (xu.d[1].d) < 0x1p-500)
147e83
+    xu.d[1].d = 0.0;
147e83
+  if (fabs (yu.d[1].d) < 0x1p-500)
147e83
+    yu.d[1].d = 0.0;
147e83
+  mul_split (&vals[1], &vals[0], xu.d[0].d, xu.d[0].d);
147e83
+  mul_split (&vals[3], &vals[2], xu.d[0].d, xu.d[1].d);
147e83
   vals[2] *= 2.0;
147e83
   vals[3] *= 2.0;
147e83
-  mul_split (&vals[5], &vals[4], xu.dd[1], xu.dd[1]);
147e83
-  mul_split (&vals[7], &vals[6], yu.dd[0], yu.dd[0]);
147e83
-  mul_split (&vals[9], &vals[8], yu.dd[0], yu.dd[1]);
147e83
+  mul_split (&vals[5], &vals[4], xu.d[1].d, xu.d[1].d);
147e83
+  mul_split (&vals[7], &vals[6], yu.d[0].d, yu.d[0].d);
147e83
+  mul_split (&vals[9], &vals[8], yu.d[0].d, yu.d[1].d);
147e83
   vals[8] *= 2.0;
147e83
   vals[9] *= 2.0;
147e83
-  mul_split (&vals[11], &vals[10], yu.dd[1], yu.dd[1]);
147e83
-  if (xu.dd[0] >= 0.75)
147e83
+  mul_split (&vals[11], &vals[10], yu.d[1].d, yu.d[1].d);
147e83
+  if (xu.d[0].d >= 0.75)
147e83
     vals[1] -= 1.0;
147e83
   else
147e83
     {