summaryrefslogtreecommitdiffstats
path: root/lib/msun
diff options
context:
space:
mode:
authorkargl <kargl@FreeBSD.org>2013-06-03 18:07:04 +0000
committerkargl <kargl@FreeBSD.org>2013-06-03 18:07:04 +0000
commit5426a2bf25c3acab8706393936d68642445c8fae (patch)
treef29a3feb41e98265051125024ec150cc5b9990da /lib/msun
parent0ded3d37df30ac90468c725aca63495d1380d443 (diff)
downloadFreeBSD-src-5426a2bf25c3acab8706393936d68642445c8fae.zip
FreeBSD-src-5426a2bf25c3acab8706393936d68642445c8fae.tar.gz
Add a u suffix to the IEEEl2bits unions o_threshold and u_threshold,
and use macros to access the e component of the unions. This allows the portions of the code in ld80 to be identical to the ld128 code. Obtained from: bde
Diffstat (limited to 'lib/msun')
-rw-r--r--lib/msun/ld80/s_expl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/msun/ld80/s_expl.c b/lib/msun/ld80/s_expl.c
index c7d923d..3499038 100644
--- a/lib/msun/ld80/s_expl.c
+++ b/lib/msun/ld80/s_expl.c
@@ -61,9 +61,12 @@ static volatile const long double tiny = 0x1p-10000L;
static const union IEEEl2bits
/* log(2**16384 - 0.5) rounded towards zero: */
-o_threshold = LD80C(0xb17217f7d1cf79ab, 13, 11356.5234062941439488L),
+/* log(2**16384 - 0.5 + 1) rounded towards zero for expm1l() is the same: */
+o_thresholdu = LD80C(0xb17217f7d1cf79ab, 13, 11356.5234062941439488L),
+#define o_threshold (o_thresholdu.e)
/* log(2**(-16381-64-1)) rounded towards zero: */
-u_threshold = LD80C(0xb21dfe7f09e2baa9, 13, -11399.4985314888605581L);
+u_thresholdu = LD80C(0xb21dfe7f09e2baa9, 13, -11399.4985314888605581L);
+#define u_threshold (u_thresholdu.e)
static const double
/*
@@ -246,9 +249,9 @@ expl(long double x)
return (0.0L); /* x is -Inf */
return (x + x); /* x is +Inf, NaN or unsupported */
}
- if (x > o_threshold.e)
+ if (x > o_threshold)
return (huge * huge);
- if (x < u_threshold.e)
+ if (x < u_threshold)
return (tiny * tiny);
} else if (ix < BIAS - 66) { /* |x| < 0x1p-66 */
/* includes pseudo-denormals */
OpenPOWER on IntegriCloud