From: nsz Date: Mon, 5 Mar 2012 10:50:39 +0000 (+0100) Subject: use #if LDBL_MANT_DIG == ... instead of custom LD80 etc macros X-Git-Url: http://nsz.repo.hu/git/?p=libm;a=commitdiff_plain;h=59c2bd747bce9b1e35c893b2ace9bea57523a901 use #if LDBL_MANT_DIG == ... instead of custom LD80 etc macros --- diff --git a/src/internal/ldhack.h b/src/internal/ldhack.h index 32fb711..25ec802 100644 --- a/src/internal/ldhack.h +++ b/src/internal/ldhack.h @@ -4,15 +4,8 @@ #include #include -// FIXME: conveniance macros - -#undef LD64 -#undef LD80 -#undef LD128 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 -#define LD64 1 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 -#define LD80 1 union ldshape { long double value; struct { @@ -23,7 +16,6 @@ union ldshape { } bits; }; #elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 -#define LD128 1 union ldshape { long double value; struct { diff --git a/src/math/__cosl.c b/src/math/__cosl.c index bac0303..9ea51ec 100644 --- a/src/math/__cosl.c +++ b/src/math/__cosl.c @@ -14,7 +14,7 @@ #include "libm.h" -#if LD80 +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* * ld80 version of __cos.c. See __cos.c for most comments. */ diff --git a/src/math/__fpclassifyl.c b/src/math/__fpclassifyl.c index 308dc21..c886e5a 100644 --- a/src/math/__fpclassifyl.c +++ b/src/math/__fpclassifyl.c @@ -1,8 +1,8 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 int __fpclassifyl(long double x) { union ldshape u = { x }; @@ -13,7 +13,7 @@ int __fpclassifyl(long double x) return u.bits.m & ~((uint64_t)1<<63) ? FP_NAN : FP_INFINITE; return u.bits.m & (uint64_t)1<<63 ? FP_NORMAL : FP_NAN; } -#elif LD128 +#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 int __fpclassifyl(long double x) { union ldshape u = { x }; diff --git a/src/math/__invtrigl.c b/src/math/__invtrigl.c index 110891d..a821842 100644 --- a/src/math/__invtrigl.c +++ b/src/math/__invtrigl.c @@ -27,7 +27,7 @@ #include "__invtrigl.h" -#if LD80 +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* * asinl() and acosl() */ diff --git a/src/math/__invtrigl.h b/src/math/__invtrigl.h index 5ffde70..c3ad3c4 100644 --- a/src/math/__invtrigl.h +++ b/src/math/__invtrigl.h @@ -27,7 +27,7 @@ #include "libm.h" -#if LD80 +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 #define BIAS (LDBL_MAX_EXP - 1) #define MANH_SIZE LDBL_MANH_SIZE diff --git a/src/math/__rem_pio2l.h b/src/math/__rem_pio2l.h index 130a8f0..37f3bd2 100644 --- a/src/math/__rem_pio2l.h +++ b/src/math/__rem_pio2l.h @@ -13,7 +13,7 @@ * Optimized by Bruce D. Evans. */ #include "libm.h" -#if LD80 +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* ld80 version of __rem_pio2(x,y) * * return the remainder of x rem pi/2 in y[0]+y[1] diff --git a/src/math/__signbitl.c b/src/math/__signbitl.c index fcc9e3c..81adb6c 100644 --- a/src/math/__signbitl.c +++ b/src/math/__signbitl.c @@ -1,7 +1,7 @@ #include "libm.h" // FIXME: should be a macro -#if LD80 || LD128 +#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 int __signbitl(long double x) { union ldshape u = {x}; diff --git a/src/math/__sinl.c b/src/math/__sinl.c index 667c94b..71851d8 100644 --- a/src/math/__sinl.c +++ b/src/math/__sinl.c @@ -13,7 +13,7 @@ #include "libm.h" -#if LD80 +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* * ld80 version of __sin.c. See __sin.c for most comments. */ diff --git a/src/math/__tanl.c b/src/math/__tanl.c index 40f9918..f842543 100644 --- a/src/math/__tanl.c +++ b/src/math/__tanl.c @@ -12,7 +12,7 @@ #include "libm.h" -#if LD80 +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* * ld80 version of __tan.c. See __tan.c for most comments. */ diff --git a/src/math/acoshl.c b/src/math/acoshl.c index 9e37a38..d8310a7 100644 --- a/src/math/acoshl.c +++ b/src/math/acoshl.c @@ -25,12 +25,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double acoshl(long double x) { return acosh(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double one = 1.0, ln2 = 6.931471805599453094287e-01L; /* 0x3FFE, 0xB17217F7, 0xD1CF79AC */ diff --git a/src/math/acosl.c b/src/math/acosl.c index f52dedd..21e6c95 100644 --- a/src/math/acosl.c +++ b/src/math/acosl.c @@ -16,12 +16,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double acosl(long double x) { return acos(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include "__invtrigl.h" static const long double diff --git a/src/math/asinhl.c b/src/math/asinhl.c index a86e2f2..b2edf90 100644 --- a/src/math/asinhl.c +++ b/src/math/asinhl.c @@ -22,12 +22,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double asinhl(long double x) { return asinh(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double one = 1.000000000000000000000e+00L, /* 0x3FFF, 0x00000000, 0x00000000 */ ln2 = 6.931471805599453094287e-01L, /* 0x3FFE, 0xB17217F7, 0xD1CF79AC */ diff --git a/src/math/asinl.c b/src/math/asinl.c index a513bf2..370997b 100644 --- a/src/math/asinl.c +++ b/src/math/asinl.c @@ -16,12 +16,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double asinl(long double x) { return asin(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include "__invtrigl.h" static const long double one = 1.00000000000000000000e+00, diff --git a/src/math/atan2l.c b/src/math/atan2l.c index f9002cb..64ec12e 100644 --- a/src/math/atan2l.c +++ b/src/math/atan2l.c @@ -17,12 +17,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double atan2l(long double y, long double x) { return atan2(y, x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include "__invtrigl.h" static volatile long double tiny = 1.0e-300; diff --git a/src/math/atanhl.c b/src/math/atanhl.c index bc0d7ff..af0f856 100644 --- a/src/math/atanhl.c +++ b/src/math/atanhl.c @@ -28,12 +28,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double atanhl(long double x) { return atanh(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double zero = 0.0, one = 1.0, huge = 1e4900L; long double atanhl(long double x) diff --git a/src/math/atanl.c b/src/math/atanl.c index 35108c4..4e99955 100644 --- a/src/math/atanl.c +++ b/src/math/atanl.c @@ -16,12 +16,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double atanl(long double x) { return atan(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include "__invtrigl.h" static const long double one = 1.0, diff --git a/src/math/cbrtl.c b/src/math/cbrtl.c index ecbd7be..d138b9f 100644 --- a/src/math/cbrtl.c +++ b/src/math/cbrtl.c @@ -17,12 +17,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double cbrtl(long double x) { return cbrt(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #define BIAS (LDBL_MAX_EXP - 1) static const unsigned B1 = 709958130; /* B1 = (127-127.0/3-0.03306235651)*2**23 */ diff --git a/src/math/ceill.c b/src/math/ceill.c index 9459c73..b938cc7 100644 --- a/src/math/ceill.c +++ b/src/math/ceill.c @@ -20,12 +20,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double ceill(long double x) { return ceil(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #ifdef LDBL_IMPLICIT_NBIT #define MANH_SIZE (LDBL_MANH_SIZE + 1) diff --git a/src/math/copysignl.c b/src/math/copysignl.c index 93cb1c5..72a2148 100644 --- a/src/math/copysignl.c +++ b/src/math/copysignl.c @@ -1,11 +1,11 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double copysignl(long double x, long double y) { return copysign(x, y); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 long double copysignl(long double x, long double y) { union ldshape ux = {x}, uy = {y}; diff --git a/src/math/coshl.c b/src/math/coshl.c index 7564d8c..bcc9128 100644 --- a/src/math/coshl.c +++ b/src/math/coshl.c @@ -32,12 +32,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double coshl(long double x) { return cosh(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double one = 1.0, half = 0.5, huge = 1.0e4900L; long double coshl(long double x) diff --git a/src/math/cosl.c b/src/math/cosl.c index 4d43629..2c650cd 100644 --- a/src/math/cosl.c +++ b/src/math/cosl.c @@ -31,11 +31,11 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double cosl(long double x) { return cos(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include "__rem_pio2l.h" long double cosl(long double x) diff --git a/src/math/erfl.c b/src/math/erfl.c index 86c2bad..c38d745 100644 --- a/src/math/erfl.c +++ b/src/math/erfl.c @@ -100,12 +100,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double erfl(long double x) { return erfl(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double tiny = 1e-4931L, half = 0.5L, diff --git a/src/math/exp2l.c b/src/math/exp2l.c index c90a6f2..ce085a7 100644 --- a/src/math/exp2l.c +++ b/src/math/exp2l.c @@ -27,12 +27,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double exp2l(long double x) { return exp2l(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 #define TBLBITS 7 #define TBLSIZE (1 << TBLBITS) diff --git a/src/math/expl.c b/src/math/expl.c index f9fcae7..ed794fb 100644 --- a/src/math/expl.c +++ b/src/math/expl.c @@ -67,12 +67,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double expl(long double x) { return x; } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static long double P[3] = { 1.2617719307481059087798E-4L, diff --git a/src/math/expm1l.c b/src/math/expm1l.c index da2cffe..2f94dfa 100644 --- a/src/math/expm1l.c +++ b/src/math/expm1l.c @@ -55,12 +55,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double expm1l(long double x) { return expm1(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double MAXLOGL = 1.1356523406294143949492E4L; /* exp(x) - 1 = x + 0.5 x^2 + x^3 P(x)/Q(x) diff --git a/src/math/fabsl.c b/src/math/fabsl.c index f1dec1f..711d908 100644 --- a/src/math/fabsl.c +++ b/src/math/fabsl.c @@ -1,10 +1,10 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double fabsl(long double x) { return fabs(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 long double fabsl(long double x) { union ldshape u = {x}; diff --git a/src/math/floorl.c b/src/math/floorl.c index 184b7ff..08f6ba2 100644 --- a/src/math/floorl.c +++ b/src/math/floorl.c @@ -20,12 +20,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double floorl(long double x) { return floor(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #ifdef LDBL_IMPLICIT_NBIT #define MANH_SIZE (LDBL_MANH_SIZE + 1) diff --git a/src/math/fmal.c b/src/math/fmal.c index ca2e664..200bd5a 100644 --- a/src/math/fmal.c +++ b/src/math/fmal.c @@ -27,12 +27,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double fmal(long double x, long double y, long double z) { return fma(x, y, z); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include /* diff --git a/src/math/fmodl.c b/src/math/fmodl.c index 10720e2..2e3eec1 100644 --- a/src/math/fmodl.c +++ b/src/math/fmodl.c @@ -12,12 +12,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double fmodl(long double x, long double y) { return fmod(x, y); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #define BIAS (LDBL_MAX_EXP - 1) diff --git a/src/math/hypotl.c b/src/math/hypotl.c index a2cd78f..f4a64f7 100644 --- a/src/math/hypotl.c +++ b/src/math/hypotl.c @@ -13,12 +13,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double hypotl(long double x, long double y) { return hypot(x, y); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #define GET_LDBL_EXPSIGN(i, v) do { \ union IEEEl2bits uv; \ diff --git a/src/math/ilogbl.c b/src/math/ilogbl.c index 03c8f21..099c81a 100644 --- a/src/math/ilogbl.c +++ b/src/math/ilogbl.c @@ -1,11 +1,11 @@ #include #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 int ilogbl(long double x) { return ilogb(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 int ilogbl(long double x) { union ldshape u = {x}; diff --git a/src/math/lgammal.c b/src/math/lgammal.c index db2e34d..603477c 100644 --- a/src/math/lgammal.c +++ b/src/math/lgammal.c @@ -92,12 +92,12 @@ long double lgammal(long double x) return lgammal_r(x, &signgam); } -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double lgammal_r(long double x, int *sg) { return lgamma_r(x, sg); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double half = 0.5L, one = 1.0L, diff --git a/src/math/llrintl.c b/src/math/llrintl.c index b8113a5..6b0838d 100644 --- a/src/math/llrintl.c +++ b/src/math/llrintl.c @@ -1,5 +1,5 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long long llrintl(long double x) { return llrint(x); diff --git a/src/math/llroundl.c b/src/math/llroundl.c index a9ed0da..9e2cfdc 100644 --- a/src/math/llroundl.c +++ b/src/math/llroundl.c @@ -1,5 +1,5 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long long llroundl(long double x) { return llround(x); diff --git a/src/math/log10l.c b/src/math/log10l.c index 12c71f6..3a85883 100644 --- a/src/math/log10l.c +++ b/src/math/log10l.c @@ -59,12 +59,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double log10l(long double x) { return log10(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* Coefficients for log(1+x) = x - x**2/2 + x**3 P(x)/Q(x) * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 6.2e-22 diff --git a/src/math/log1pl.c b/src/math/log1pl.c index 079b395..7aafc5c 100644 --- a/src/math/log1pl.c +++ b/src/math/log1pl.c @@ -55,12 +55,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double log1pl(long double x) { return log1p(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* Coefficients for log(1+x) = x - x^2 / 2 + x^3 P(x)/Q(x) * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 2.32e-20 diff --git a/src/math/log2l.c b/src/math/log2l.c index 8198af7..cf08b0a 100644 --- a/src/math/log2l.c +++ b/src/math/log2l.c @@ -59,12 +59,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double log2l(long double x) { return log2(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* Coefficients for ln(1+x) = x - x**2/2 + x**3 P(x)/Q(x) * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 6.2e-22 diff --git a/src/math/logbl.c b/src/math/logbl.c index 58d8eea..5d04abd 100644 --- a/src/math/logbl.c +++ b/src/math/logbl.c @@ -1,6 +1,6 @@ #include #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double logbl(long double x) { return logb(x); diff --git a/src/math/logl.c b/src/math/logl.c index 9dbbfee..2139b2a 100644 --- a/src/math/logl.c +++ b/src/math/logl.c @@ -59,12 +59,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double logl(long double x) { return log(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* Coefficients for log(1+x) = x - x**2/2 + x**3 P(x)/Q(x) * 1/sqrt(2) <= x < sqrt(2) * Theoretical peak relative error = 2.32e-20 diff --git a/src/math/lrintl.c b/src/math/lrintl.c index 4eedb38..7c09653 100644 --- a/src/math/lrintl.c +++ b/src/math/lrintl.c @@ -1,5 +1,5 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long lrintl(long double x) { return lrint(x); diff --git a/src/math/lroundl.c b/src/math/lroundl.c index bbe719e..1469127 100644 --- a/src/math/lroundl.c +++ b/src/math/lroundl.c @@ -1,5 +1,5 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long lroundl(long double x) { return lround(x); diff --git a/src/math/modfl.c b/src/math/modfl.c index d1a2360..2ca67b1 100644 --- a/src/math/modfl.c +++ b/src/math/modfl.c @@ -37,12 +37,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double modfl(long double x, long double *iptr) { return modf(x, iptr); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #if LDBL_MANL_SIZE > 32 #define MASK ((uint64_t)-1) diff --git a/src/math/nearbyintl.c b/src/math/nearbyintl.c index bcc707a..b58527c 100644 --- a/src/math/nearbyintl.c +++ b/src/math/nearbyintl.c @@ -1,5 +1,5 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double nearbyintl(long double x) { return nearbyint(x); diff --git a/src/math/nextafterl.c b/src/math/nextafterl.c index 1522042..1c6d537 100644 --- a/src/math/nextafterl.c +++ b/src/math/nextafterl.c @@ -18,12 +18,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double nextafterl(long double x, long double y) { return nextafter(x, y); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 long double nextafterl(long double x, long double y) { volatile long double t; diff --git a/src/math/nexttoward.c b/src/math/nexttoward.c index 6f4bae5..5e12c48 100644 --- a/src/math/nexttoward.c +++ b/src/math/nexttoward.c @@ -11,12 +11,12 @@ */ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 double nexttoward(double x, long double y) { return nextafter(x, y); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 double nexttoward(double x, long double y) { union IEEEl2bits uy; diff --git a/src/math/nexttowardf.c b/src/math/nexttowardf.c index fc0948c..5e1616a 100644 --- a/src/math/nexttowardf.c +++ b/src/math/nexttowardf.c @@ -12,9 +12,9 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 // FIXME -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #define LDBL_INFNAN_EXP (LDBL_MAX_EXP * 2 - 1) float nexttowardf(float x, long double y) diff --git a/src/math/powl.c b/src/math/powl.c index c83289b..c829c18 100644 --- a/src/math/powl.c +++ b/src/math/powl.c @@ -69,7 +69,7 @@ #include "libm.h" -#if LD80 +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* Table size */ #define NXT 32 diff --git a/src/math/remainderl.c b/src/math/remainderl.c index d5656da..7794560 100644 --- a/src/math/remainderl.c +++ b/src/math/remainderl.c @@ -1,5 +1,5 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double remainderl(long double x, long double y) { return remainder(x, y); diff --git a/src/math/remquol.c b/src/math/remquol.c index 596170b..cacc5ba 100644 --- a/src/math/remquol.c +++ b/src/math/remquol.c @@ -11,12 +11,12 @@ */ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double remquol(long double x, long double y, int *quo) { return remquo(x, y, quo); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #define BIAS (LDBL_MAX_EXP - 1) diff --git a/src/math/rintl.c b/src/math/rintl.c index 46eecff..1cc35df 100644 --- a/src/math/rintl.c +++ b/src/math/rintl.c @@ -27,12 +27,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double rintl(long double x) { return rint(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #define BIAS (LDBL_MAX_EXP - 1) diff --git a/src/math/roundl.c b/src/math/roundl.c index b92b8fb..ce56e8a 100644 --- a/src/math/roundl.c +++ b/src/math/roundl.c @@ -26,7 +26,7 @@ */ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double roundl(long double x) { return round(x); diff --git a/src/math/scalbnl.c b/src/math/scalbnl.c index ff5db51..5510186 100644 --- a/src/math/scalbnl.c +++ b/src/math/scalbnl.c @@ -18,12 +18,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double scalbnl(long double x, int n) { return scalbn(x, n); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 static const long double huge = 0x1p16000L, tiny = 0x1p-16000L; diff --git a/src/math/sinhl.c b/src/math/sinhl.c index 14003cc..2252dec 100644 --- a/src/math/sinhl.c +++ b/src/math/sinhl.c @@ -29,12 +29,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double sinhl(long double x) { return sinh(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double one = 1.0, huge = 1.0e4931L; long double sinhl(long double x) diff --git a/src/math/sinl.c b/src/math/sinl.c index 5b3f60d..0b1aeb7 100644 --- a/src/math/sinl.c +++ b/src/math/sinl.c @@ -28,12 +28,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double sinl(long double x) { return sin(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include "__rem_pio2l.h" long double sinl(long double x) diff --git a/src/math/tanhl.c b/src/math/tanhl.c index 445793f..e62be59 100644 --- a/src/math/tanhl.c +++ b/src/math/tanhl.c @@ -35,12 +35,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double tanhl(long double x) { return tanh(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 static const long double one=1.0, two=2.0, tiny = 1.0e-4900L; long double tanhl(long double x) diff --git a/src/math/tanl.c b/src/math/tanl.c index cfd9666..462ead9 100644 --- a/src/math/tanl.c +++ b/src/math/tanl.c @@ -32,12 +32,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double tanl(long double x) { return tan(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #include "__rem_pio2l.h" long double tanl(long double x) diff --git a/src/math/tgammal.c b/src/math/tgammal.c index 1bd6a33..e590550 100644 --- a/src/math/tgammal.c +++ b/src/math/tgammal.c @@ -54,12 +54,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double tgammal(long double x) { return tgamma(x); } -#elif LD80 +#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 /* tgamma(x+2) = tgamma(x+2) P(x)/Q(x) 0 <= x <= 1 diff --git a/src/math/truncl.c b/src/math/truncl.c index 57b6489..d817e9a 100644 --- a/src/math/truncl.c +++ b/src/math/truncl.c @@ -20,12 +20,12 @@ #include "libm.h" -#if LD64 +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double truncl(long double x) { return trunc(x); } -#elif LD80 || LD128 +#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 #ifdef LDBL_IMPLICIT_NBIT #define MANH_SIZE (LDBL_MANH_SIZE + 1) #else