Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/m68k/fpe FATANH(-0) is -0, not +0.



details:   https://anonhg.NetBSD.org/src/rev/d19152a3df45
branches:  trunk
changeset: 790446:d19152a3df45
user:      isaki <isaki%NetBSD.org@localhost>
date:      Fri Oct 11 03:37:08 2013 +0000

description:
FATANH(-0) is -0, not +0.
This bug was introduced by the mistake of my test program.
Last week, I talked about the probelm (my FATANH(-0) returns +0 ?)
by NetBSD seminar at Open Source Conference 2013 Hiroshima,
and tsutsui@ confirmed that returns -0.

diffstat:

 sys/arch/m68k/fpe/fpu_hyperb.c |  13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diffs (35 lines):

diff -r 78164aaf63b6 -r d19152a3df45 sys/arch/m68k/fpe/fpu_hyperb.c
--- a/sys/arch/m68k/fpe/fpu_hyperb.c    Fri Oct 11 01:20:52 2013 +0000
+++ b/sys/arch/m68k/fpe/fpu_hyperb.c    Fri Oct 11 03:37:08 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu_hyperb.c,v 1.15 2013/04/20 07:33:05 isaki Exp $    */
+/*     $NetBSD: fpu_hyperb.c,v 1.16 2013/10/11 03:37:08 isaki Exp $    */
 
 /*
  * Copyright (c) 1995  Ken Nakata
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_hyperb.c,v 1.15 2013/04/20 07:33:05 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_hyperb.c,v 1.16 2013/10/11 03:37:08 isaki Exp $");
 
 #include <machine/ieee.h>
 
@@ -89,14 +89,9 @@
        if (ISINF(&fe->fe_f2))
                return fpu_newnan(fe);
 
-       /*
-        * if x is +0/-0, 68000PRM.pdf says it returns +0/-0 but
-        * my real 68882 returns +0 for both.
-        */
-       if (ISZERO(&fe->fe_f2)) {
-               fe->fe_f2.fp_sign = 0;
+       /* if x is +0/-0, return +0/-0 */
+       if (ISZERO(&fe->fe_f2))
                return &fe->fe_f2;
-       }
 
        /*
         * -INF if x == -1



Home | Main Index | Thread Index | Old Index