diff options
author | kargl <kargl@FreeBSD.org> | 2012-07-26 04:05:08 +0000 |
---|---|---|
committer | kargl <kargl@FreeBSD.org> | 2012-07-26 04:05:08 +0000 |
commit | 0fee65786ad8b4344a79fa7da306e7c00289e111 (patch) | |
tree | 1109c8d8e8c4d6e1fe5f7ec9d54632678780069c /lib/msun/ld128 | |
parent | da1349053f2cae9f35535b9a0d84c5bb437bcaed (diff) | |
download | FreeBSD-src-0fee65786ad8b4344a79fa7da306e7c00289e111.zip FreeBSD-src-0fee65786ad8b4344a79fa7da306e7c00289e111.tar.gz |
Replace the macro name NUM with INTERVALS. This change provides
compatibility with the INTERVALS macro used in the soon-to-be-commmitted
expm1l() and someday-to-be-committed log*l() functions.
Add a comment into ld128/s_expl.c noting at gcc issue that was
deleted when rewriting ld80/e_expl.c as ld128/s_expl.c.
Requested by: bde
Approved by: das (mentor)
Diffstat (limited to 'lib/msun/ld128')
-rw-r--r-- | lib/msun/ld128/s_expl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/msun/ld128/s_expl.c b/lib/msun/ld128/s_expl.c index 1888ef8..c03368e 100644 --- a/lib/msun/ld128/s_expl.c +++ b/lib/msun/ld128/s_expl.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #define BIAS (LDBL_MAX_EXP - 1) +/* XXX Prevent gcc from erroneously constant folding this: */ static volatile const long double twom10000 = 0x1p-10000L, tiny = 0x1p-10000L; static const long double @@ -57,12 +58,12 @@ P9 = 2.75573192240103867817876199544468806e-6L, P10 = 2.75573236172670046201884000197885520e-7L, P11 = 2.50517544183909126492878226167697856e-8L; -#define NUM 128 +#define INTERVALS 128 static const struct { long double hi; long double lo; -} s[NUM] = { +} s[INTERVALS] = { 0x1p0L, 0x0p0L, 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L, 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L, @@ -226,8 +227,8 @@ expl(long double x) fn = x * INV_L + 0x1.8p112 - 0x1.8p112; n = (int)fn; - n2 = (unsigned)n % NUM; /* Tang's j. */ - k = (n - n2) / NUM; + n2 = (unsigned)n % INTERVALS; /* Tang's j. */ + k = (n - n2) / INTERVALS; r1 = x - fn * L1; r2 = -fn * L2; |