summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-08-17 18:12:56 +0930
committerAlan Modra <amodra@gmail.com>2013-10-04 10:28:42 +0930
commit9605ca6c085a749f29b6866a3e00bce1ba1a2698 (patch)
tree3090d34c90df3fc6f68fc315d1c62e535c324480 /sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
parentd3d237560b858b3c07973a5261cd6903fe52909c (diff)
downloadglibc-9605ca6c085a749f29b6866a3e00bce1ba1a2698.tar.gz
glibc-9605ca6c085a749f29b6866a3e00bce1ba1a2698.tar.xz
glibc-9605ca6c085a749f29b6866a3e00bce1ba1a2698.zip
IBM long double mechanical changes to support little-endian
http://sourceware.org/ml/libc-alpha/2013-07/msg00001.html

This patch starts the process of supporting powerpc64 little-endian
long double in glibc.  IBM long double is an array of two ieee
doubles, so making union ibm_extended_long_double reflect this fact is
the correct way to access fields of the doubles.

	* sysdeps/ieee754/ldbl-128ibm/ieee754.h
	(union ibm_extended_long_double): Define as an array of ieee754_double.
	(IBM_EXTENDED_LONG_DOUBLE_BIAS): Delete.
	* sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Update all references
	to ibm_extended_long_double and IBM_EXTENDED_LONG_DOUBLE_BIAS.
	* sysdeps/ieee754/ldbl-128ibm/e_exp10l.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/math_ldbl.h: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/strtold_l.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c: Likewise.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
index ed0d4a5067..06dcf02ffe 100644
--- a/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c
@@ -89,23 +89,23 @@ __x2y2m1l (long double x, long double y)
   double vals[12];
   SET_RESTORE_ROUND (FE_TONEAREST);
   union ibm_extended_long_double xu, yu;
-  xu.d = x;
-  yu.d = y;
-  if (fabs (xu.dd[1]) < 0x1p-500)
-    xu.dd[1] = 0.0;
-  if (fabs (yu.dd[1]) < 0x1p-500)
-    yu.dd[1] = 0.0;
-  mul_split (&vals[1], &vals[0], xu.dd[0], xu.dd[0]);
-  mul_split (&vals[3], &vals[2], xu.dd[0], xu.dd[1]);
+  xu.ld = x;
+  yu.ld = y;
+  if (fabs (xu.d[1].d) < 0x1p-500)
+    xu.d[1].d = 0.0;
+  if (fabs (yu.d[1].d) < 0x1p-500)
+    yu.d[1].d = 0.0;
+  mul_split (&vals[1], &vals[0], xu.d[0].d, xu.d[0].d);
+  mul_split (&vals[3], &vals[2], xu.d[0].d, xu.d[1].d);
   vals[2] *= 2.0;
   vals[3] *= 2.0;
-  mul_split (&vals[5], &vals[4], xu.dd[1], xu.dd[1]);
-  mul_split (&vals[7], &vals[6], yu.dd[0], yu.dd[0]);
-  mul_split (&vals[9], &vals[8], yu.dd[0], yu.dd[1]);
+  mul_split (&vals[5], &vals[4], xu.d[1].d, xu.d[1].d);
+  mul_split (&vals[7], &vals[6], yu.d[0].d, yu.d[0].d);
+  mul_split (&vals[9], &vals[8], yu.d[0].d, yu.d[1].d);
   vals[8] *= 2.0;
   vals[9] *= 2.0;
-  mul_split (&vals[11], &vals[10], yu.dd[1], yu.dd[1]);
-  if (xu.dd[0] >= 0.75)
+  mul_split (&vals[11], &vals[10], yu.d[1].d, yu.d[1].d);
+  if (xu.d[0].d >= 0.75)
     vals[1] -= 1.0;
   else
     {