about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2012-05-25 11:57:33 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2012-05-26 13:53:22 +0200
commit25dbcb277a9dea5f241c0b888a30b9341310d941 (patch)
tree74c7933f325f44fed6f2f15fd87c59fd4752be37 /sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
parentd81dcb356909937b0c8e9c69ff0be27f51aaa07a (diff)
downloadglibc-25dbcb277a9dea5f241c0b888a30b9341310d941.tar.gz
glibc-25dbcb277a9dea5f241c0b888a30b9341310d941.tar.xz
glibc-25dbcb277a9dea5f241c0b888a30b9341310d941.zip
Optimize handling of denormals in logb/logbf/logbl
Diffstat (limited to 'sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c')
-rw-r--r--sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
index 185dd05be3..40b8888130 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_logb.c
+++ b/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);
 }