fp16.c (__gnu_f2h_internal): Fix inaccuracy when aexp is 25.
authorJohn Tytgat <John@bass-software.com>
Thu, 13 Dec 2012 12:05:30 +0000 (12:05 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Thu, 13 Dec 2012 12:05:30 +0000 (12:05 +0000)
* config/arm/fp16.c (__gnu_f2h_internal): Fix inaccuracy when aexp
is 25.

From-SVN: r194474

libgcc/ChangeLog
libgcc/config/arm/fp16.c

index 95b95b1d19399d559c13ef9c2fa4781162e22ba0..df3dfeef71fa2c9dcfc64bb96178b560bee57138 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-13  John Tytgat  <John@bass-software.com>
+
+       * config/arm/fp16.c (__gnu_f2h_internal): Fix inaccuracy when aexp
+       is 25.
+
 2012-12-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR libgcc/55451
index 936caeb78d05947b12b5b48e26e0dd39a5e2f18b..786830f2ec609606a320c028c45c585a47aa8e94 100644 (file)
@@ -47,11 +47,9 @@ __gnu_f2h_internal(unsigned int a, int ieee)
   mantissa |= 0x00800000;
   if (aexp < -14)
     {
-      mask = 0x007fffff;
-      if (aexp < -25)
-       aexp = -26;
-      else if (aexp != -25)
-       mask >>= 24 + aexp;
+      mask = 0x00ffffff;
+      if (aexp >= -25)
+        mask >>= 25 + aexp;
     }
   else
     mask = 0x00001fff;