diff options
| author | Steve Kargl <kargl@FreeBSD.org> | 2013-06-03 19:13:44 +0000 |
|---|---|---|
| committer | Steve Kargl <kargl@FreeBSD.org> | 2013-06-03 19:13:44 +0000 |
| commit | 8cc74771f213973238da15c7e62db7e89c805cbd (patch) | |
| tree | fb306508993bc0afee36e06852dc656db25fe49f /lib | |
| parent | 35cbca6a7f6eaa1e34e054bdab4a839aa49e0575 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/msun/ld128/s_expl.c | 15 | ||||
| -rw-r--r-- | lib/msun/ld80/s_expl.c | 4 |
2 files changed, 11 insertions, 8 deletions
diff --git a/lib/msun/ld128/s_expl.c b/lib/msun/ld128/s_expl.c index a379ff0541fd..5637cbe1f86e 100644 --- a/lib/msun/ld128/s_expl.c +++ b/lib/msun/ld128/s_expl.c @@ -228,7 +228,7 @@ expl(long double x) double dr, fn, r2; int k, n, n2; - uint32_t hx, ix; + uint16_t hx, ix; /* Filter out exceptional cases. */ u.e = x; @@ -248,6 +248,8 @@ expl(long double x) return (1 + x); /* 1 with inexact iff x != 0 */ } + ENTERI(); + /* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */ /* Use a specialized rint() to get fn. Assume round-to-nearest. */ /* XXX assume no extra precision for the additions, as for trig fns. */ @@ -262,10 +264,11 @@ expl(long double x) k = n >> LOG2_INTERVALS; r1 = x - fn * L1; r2 = fn * -L2; + r = r1 + r2; /* Prepare scale factors. */ - v.xbits.manh = 0; - v.xbits.manl = 0; + /* XXX sparc64 multiplication is so slow that scalbnl() is faster. */ + v.e = 1; if (k >= LDBL_MIN_EXP) { v.xbits.expsign = BIAS + k; twopk = v.e; @@ -284,9 +287,9 @@ expl(long double x) /* Scale by 2**k. */ if (k >= LDBL_MIN_EXP) { if (k == LDBL_MAX_EXP) - return (t * 2.0L * 0x1p16383L); - return (t * twopk); + RETURNI(t * 2 * 0x1p16383L); + RETURNI(t * twopk); } else { - return (t * twopkp10000 * twom10000); + RETURNI(t * twopkp10000 * twom10000); } } diff --git a/lib/msun/ld80/s_expl.c b/lib/msun/ld80/s_expl.c index 79c5110005bb..5bec63b03c7f 100644 --- a/lib/msun/ld80/s_expl.c +++ b/lib/msun/ld80/s_expl.c @@ -278,7 +278,7 @@ expl(long double x) r2 = fn * -L2; /* Prepare scale factors. */ - v.e = 1ULL << 63; + v.e = 1; if (k >= LDBL_MIN_EXP) { v.xbits.expsign = BIAS + k; twopk = v.e; @@ -296,7 +296,7 @@ expl(long double x) /* Scale by 2**k. */ if (k >= LDBL_MIN_EXP) { if (k == LDBL_MAX_EXP) - RETURNI(t * 2.0L * 0x1p16383L); + RETURNI(t * 2 * 0x1p16383L); RETURNI(t * twopk); } else { RETURNI(t * twopkp10000 * twom10000); |
