]> sourceware.org Git - glibc.git/commitdiff
Fix POWER7 logb results for negative subnormals (bug 19375)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 17 Dec 2015 14:34:57 +0000 (12:34 -0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 17 Dec 2015 16:34:33 +0000 (14:34 -0200)
The optimized POWER7 logb implementation does not use the absolute
value of the word extracted from the input to apply the leading 0-bits
builtin (to ignore the float sign).  This patch fixes it by
clearing the signal bit in the resulting word.

It fixes the subnormal tests failures when running on POWER7 ou
newer chip.

Tested on powerpc64le (POWER8).

[BZ# 19375]
* sysdeps/powerpc/power7/fpu/s_logb.c (__logb): Fix return for
negative subnormals.

ChangeLog
sysdeps/powerpc/power7/fpu/s_logb.c

index 17b04cd45fb8ce06d3355ea9f57b00712660c9eb..6cd6d72159c747bf343a30621a39ce10b0da0090 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-17  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/powerpc/power7/fpu/s_logb.c (__logb): Fix return for
+       negative subnormals.
+
 2015-12-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/unix/sysv/linux/x86_64/sysdep.h
index c5feb67960703f957f447a37d641c07a2b2c872b..abd1c2ae3c183d228422092ede6443dd19427fb8 100644 (file)
@@ -58,6 +58,7 @@ __logb (double x)
       int ma;
 
       EXTRACT_WORDS (ix, lx, x);
+      ix &= 0x7fffffff;
       if (ix == 0)
        ma = __builtin_clz (lx) + 32;
       else
This page took 0.182882 seconds and 5 git commands to generate.