diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-05-26 20:24:08 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-05-26 20:24:08 +0000 |
commit | 47023889431f41fa4e408ba468096b7040caaa11 (patch) | |
tree | 11d6fc1c1eb971e3177650edbe3c7f3d1d6361c9 /libc/sysdeps/ieee754/dbl-64 | |
parent | a2c69819561df393e300481562d300f12ee5bc69 (diff) |
Merge changes between r18730 and r18761 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@18762 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754/dbl-64')
-rw-r--r-- | libc/sysdeps/ieee754/dbl-64/s_logb.c | 10 | ||||
-rw-r--r-- | libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/libc/sysdeps/ieee754/dbl-64/s_logb.c b/libc/sysdeps/ieee754/dbl-64/s_logb.c index baa35e14d..17aa94b75 100644 --- a/libc/sysdeps/ieee754/dbl-64/s_logb.c +++ b/libc/sysdeps/ieee754/dbl-64/s_logb.c @@ -34,10 +34,12 @@ __logb (double x) { /* POSIX specifies that denormal number is treated as though it were normalized. */ - int m1 = (ix == 0) ? 0 : __builtin_clz (ix); - int m2 = (lx == 0) ? 0 : __builtin_clz (lx); - int ma = (m1 == 0) ? m2 + 32 : m1; - return -1022.0 + (double)(11 - ma); + int ma; + if (ix == 0) + ma = __builtin_clz (lx) + 32; + else + ma = __builtin_clz (ix); + rix -= ma - 12; } return (double) (rix - 1023); } diff --git a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c index 185dd05be..40b888813 100644 --- a/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c +++ b/libc/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c @@ -36,8 +36,8 @@ __logb (double x) return x * x; if (__builtin_expect (ex == 0, 0)) { - int m = (ix == 0) ? 0 : __builtin_clzll (ix); - return -1022.0 + (double)(11 -m); + int m = __builtin_clzll (ix); + ex -= m - 12; } return (double) (ex - 1023); } |