From af5f6d9556441487e5c66a7a4cfeddf4ed354aa7 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 2 Sep 2013 00:38:51 +0000 Subject: long double cleanup, initial commit new ldshape union, ld128 support is kept, code that used the old ldshape union was rewritten (IEEEl2bits union of freebsd libm is not touched yet) ld80 __fpclassifyl no longer tries to handle invalid representation --- src/math/ilogbl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/math/ilogbl.c') diff --git a/src/math/ilogbl.c b/src/math/ilogbl.c index 1512934f..7df6eb6c 100644 --- a/src/math/ilogbl.c +++ b/src/math/ilogbl.c @@ -10,12 +10,12 @@ int ilogbl(long double x) int ilogbl(long double x) { union ldshape u = {x}; - uint64_t m = u.bits.m; - int e = u.bits.exp; + uint64_t m = u.i.m; + int e = u.i.se & 0x7fff; if (!e) { if (m == 0) { - FORCE_EVAL(0/0.0f); + FORCE_EVAL(x/x); return FP_ILOGB0; } /* subnormal x */ @@ -25,7 +25,7 @@ int ilogbl(long double x) if (e == 0x7fff) { FORCE_EVAL(0/0.0f); /* in ld80 msb is set in inf */ - return m & (uint64_t)-1>>1 ? FP_ILOGBNAN : INT_MAX; + return m << 1 ? FP_ILOGBNAN : INT_MAX; } return e - 0x3fff; } -- cgit v1.2.1