diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-09-05 22:41:05 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-09-05 22:41:05 +0000 |
commit | 2c1d357a5fe5bdc4c9521a9d1af05ba1b5a4c238 (patch) | |
tree | 12e23fa555f1432064e8fdeeb063dce798764f50 /libc/sysdeps/ieee754/ldbl-128ibm | |
parent | 0d983ceeeee6bd20ae296d224ca2fd4bf27a47af (diff) |
Merge changes between r23795 and r23927 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@23928 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754/ldbl-128ibm')
-rw-r--r-- | libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c | 2 | ||||
-rw-r--r-- | libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h | 19 | ||||
-rw-r--r-- | libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c | 9 |
4 files changed, 25 insertions, 9 deletions
diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c index b599f369a..1b994cd7a 100644 --- a/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c +++ b/libc/sysdeps/ieee754/ldbl-128ibm/e_expl.c @@ -116,7 +116,7 @@ static const long double C[] = { #define TWO15 C[11] 32768.0L, -/* Chebyshev polynom coeficients for (exp(x)-1)/x */ +/* Chebyshev polynom coefficients for (exp(x)-1)/x */ #define P1 C[12] #define P2 C[13] #define P3 C[14] diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h b/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h index e5644f5d3..9e94f53b0 100644 --- a/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h +++ b/libc/sysdeps/ieee754/ldbl-128ibm/ieee754.h @@ -199,6 +199,25 @@ union ibm_extended_long_double 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; }; #define IBM_EXTENDED_LONG_DOUBLE_BIAS 0x3ff /* Added to exponent. */ diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c b/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c index 3b4af5423..a344e9288 100644 --- a/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c +++ b/libc/sysdeps/ieee754/ldbl-128ibm/s_cprojl.c @@ -24,9 +24,7 @@ __complex__ long double __cprojl (__complex__ long double x) { - if (isnan (__real__ x) && isnan (__imag__ x)) - return x; - else if (!isfinite (__real__ x) || !isfinite (__imag__ x)) + if (__isinf_nsl (__real__ x) || __isinf_nsl (__imag__ x)) { __complex__ long double res; diff --git a/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c b/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c index 93415f0f0..04e328857 100644 --- a/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c +++ b/libc/sysdeps/ieee754/ldbl-128ibm/strtold_l.c @@ -44,11 +44,10 @@ libc_hidden_proto (STRTOF) # define SET_MANTISSA(flt, mant) \ do { union ibm_extended_long_double u; \ u.d = (flt); \ - if ((mant & 0xfffffffffffffULL) == 0) \ - mant = 0x8000000000000ULL; \ - u.ieee.mantissa0 = ((mant) >> 32) & 0xfffff; \ - u.ieee.mantissa1 = (mant) & 0xffffffff; \ - (flt) = u.d; \ + u.ieee_nan.mantissa0 = (mant) >> 32; \ + u.ieee_nan.mantissa1 = (mant); \ + if ((u.ieee.mantissa0 | u.ieee.mantissa1) != 0) \ + (flt) = u.d; \ } while (0) #include <strtod_l.c> |