Module Name: src
Committed By: isaki
Date: Fri Oct 11 03:37:08 UTC 2013
Modified Files:
src/sys/arch/m68k/fpe: fpu_hyperb.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/fpe/fpu_hyperb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/m68k/fpe/fpu_hyperb.c
diff -u src/sys/arch/m68k/fpe/fpu_hyperb.c:1.15 src/sys/arch/m68k/fpe/fpu_hyperb.c:1.16
--- src/sys/arch/m68k/fpe/fpu_hyperb.c:1.15 Sat Apr 20 07:33:05 2013
+++ src/sys/arch/m68k/fpe/fpu_hyperb.c Fri Oct 11 03:37:08 2013
@@ -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 @@ fpu_atanh(struct fpemu *fe)
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