From 9605ca6c085a749f29b6866a3e00bce1ba1a2698 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 17 Aug 2013 18:12:56 +0930 Subject: 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. --- sysdeps/ieee754/ldbl-128ibm/ieee754.h | 43 ++--------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'sysdeps/ieee754/ldbl-128ibm/ieee754.h') diff --git a/sysdeps/ieee754/ldbl-128ibm/ieee754.h b/sysdeps/ieee754/ldbl-128ibm/ieee754.h index 9e94f53..0778b1f 100644 --- a/sysdeps/ieee754/ldbl-128ibm/ieee754.h +++ b/sysdeps/ieee754/ldbl-128ibm/ieee754.h @@ -179,49 +179,10 @@ union ieee854_long_double union ibm_extended_long_double { - long double d; - double dd[2]; - - /* This is the IBM extended format long double. */ - struct - { /* Big endian. There is no other. */ - - unsigned int negative:1; - unsigned int exponent:11; - /* Together Mantissa0-3 comprise the mantissa. */ - unsigned int mantissa0:20; - unsigned int mantissa1:32; - - unsigned int negative2:1; - unsigned int exponent2:11; - /* There is an implied 1 here? */ - /* Together these comprise the mantissa. */ - unsigned int mantissa2:20; - unsigned int mantissa3:32; - } ieee; - - /* This format makes it easier to see if a NaN is a signalling NaN. */ - struct - { /* Big endian. There is no other. */ - - unsigned int negative:1; - unsigned int exponent:11; - unsigned int quiet_nan:1; - /* Together Mantissa0-3 comprise the mantissa. */ - unsigned int mantissa0:19; - unsigned int mantissa1:32; - - unsigned int negative2:1; - unsigned int exponent2:11; - /* There is an implied 1 here? */ - /* Together these comprise the mantissa. */ - unsigned int mantissa2:20; - unsigned int mantissa3:32; - } ieee_nan; + long double ld; + union ieee754_double d[2]; }; -#define IBM_EXTENDED_LONG_DOUBLE_BIAS 0x3ff /* Added to exponent. */ - __END_DECLS #endif /* ieee754.h */ -- cgit v1.1