diff options
author | Ian Moffett <ian@osmora.org> | 2024-03-07 17:28:52 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-03-07 18:24:51 -0500 |
commit | f5e48e94a2f4d4bbd6e5628c7f2afafc6dbcc459 (patch) | |
tree | 93b156621dc0303816b37f60ba88051b702d92f6 /lib/mlibc/options/ansi/musl-generic-math/nextafterl.c | |
parent | bd5969fc876a10b18613302db7087ef3c40f18e1 (diff) |
build: Build mlibc + add distclean target
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/ansi/musl-generic-math/nextafterl.c')
-rw-r--r-- | lib/mlibc/options/ansi/musl-generic-math/nextafterl.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/lib/mlibc/options/ansi/musl-generic-math/nextafterl.c b/lib/mlibc/options/ansi/musl-generic-math/nextafterl.c deleted file mode 100644 index 37e858f..0000000 --- a/lib/mlibc/options/ansi/musl-generic-math/nextafterl.c +++ /dev/null @@ -1,75 +0,0 @@ -#include "libm.h" - -#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 -long double nextafterl(long double x, long double y) -{ - return nextafter(x, y); -} -#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 -long double nextafterl(long double x, long double y) -{ - union ldshape ux, uy; - - if (isnan(x) || isnan(y)) - return x + y; - if (x == y) - return y; - ux.f = x; - if (x == 0) { - uy.f = y; - ux.i.m = 1; - ux.i.se = uy.i.se & 0x8000; - } else if ((x < y) == !(ux.i.se & 0x8000)) { - ux.i.m++; - if (ux.i.m << 1 == 0) { - ux.i.m = 1ULL << 63; - ux.i.se++; - } - } else { - if (ux.i.m << 1 == 0) { - ux.i.se--; - if (ux.i.se) - ux.i.m = 0; - } - ux.i.m--; - } - /* raise overflow if ux is infinite and x is finite */ - if ((ux.i.se & 0x7fff) == 0x7fff) - return x + x; - /* raise underflow if ux is subnormal or zero */ - if ((ux.i.se & 0x7fff) == 0) - FORCE_EVAL(x*x + ux.f*ux.f); - return ux.f; -} -#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 -long double nextafterl(long double x, long double y) -{ - union ldshape ux, uy; - - if (isnan(x) || isnan(y)) - return x + y; - if (x == y) - return y; - ux.f = x; - if (x == 0) { - uy.f = y; - ux.i.lo = 1; - ux.i.se = uy.i.se & 0x8000; - } else if ((x < y) == !(ux.i.se & 0x8000)) { - ux.i2.lo++; - if (ux.i2.lo == 0) - ux.i2.hi++; - } else { - if (ux.i2.lo == 0) - ux.i2.hi--; - ux.i2.lo--; - } - /* raise overflow if ux is infinite and x is finite */ - if ((ux.i.se & 0x7fff) == 0x7fff) - return x + x; - /* raise underflow if ux is subnormal or zero */ - if ((ux.i.se & 0x7fff) == 0) - FORCE_EVAL(x*x + ux.f*ux.f); - return ux.f; -} -#endif |