Fix IEEE negative zero problems
authorMichael Meissner <meissner@cygnus.com>
Mon, 1 Jun 1998 09:15:23 +0000 (09:15 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Mon, 1 Jun 1998 09:15:23 +0000 (09:15 +0000)
From-SVN: r20169

gcc/ChangeLog
gcc/config/fp-bit.c

index 87f05f9e3b7fa365de832fcbaa1917ad7735e05d..fac0310fc38d9c2bc1306f032abaf61e9b3ecdfe 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jun  1 12:14:28 1998  Michael Meissner  <meissner@cygnus.com>
+
+       * config/fp-bit.c (_fp{add,div}_parts): Return correct IEEE result
+       in the presence of IEEE negative 0's.
+
 Sun May 31 16:11:41 1998  John Wehle  (john@feith.com)
 
        * reload.c (find_reloads): Record the existing mode if
index 4ff8e028cc75e0b4db73446c342dbf393b032192..ca4e0c5ba28d63a2c4e3615c76384d8c3a195d37 100644 (file)
@@ -1,7 +1,7 @@
 /* This is a software floating point library which can be used instead of
    the floating point routines in libgcc1.c for targets without hardware
    floating point. 
- Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
 This file is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as published by the
@@ -663,6 +663,12 @@ _fpadd_parts (fp_number_type * a,
     }
   if (iszero (b))
     {
+      if (iszero (a))
+       {
+         *tmp = *a;
+         tmp->sign = a->sign & b->sign;
+         return tmp;
+       }
       return a;
     }
   if (iszero (a))
@@ -1028,7 +1034,7 @@ _fpdiv_parts (fp_number_type * a,
   if (iszero (b))
     {
       a->class = CLASS_INFINITY;
-      return b;
+      return a;
     }
 
   /* Calculate the mantissa by multiplying both 64bit numbers to get a