Module Name:    src
Committed By:   isaki
Date:           Sat Apr 20 07:33:06 UTC 2013

Modified Files:
        src/sys/arch/m68k/fpe: fpu_hyperb.c

Log Message:
Support sinh(-0.0) and tanh(-0.0).


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 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.14 src/sys/arch/m68k/fpe/fpu_hyperb.c:1.15
--- src/sys/arch/m68k/fpe/fpu_hyperb.c:1.14	Sat Apr 20 05:27:05 2013
+++ src/sys/arch/m68k/fpe/fpu_hyperb.c	Sat Apr 20 07:33:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_hyperb.c,v 1.14 2013/04/20 05:27:05 isaki Exp $	*/
+/*	$NetBSD: fpu_hyperb.c,v 1.15 2013/04/20 07:33:05 isaki Exp $	*/
 
 /*
  * Copyright (c) 1995  Ken Nakata
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_hyperb.c,v 1.14 2013/04/20 05:27:05 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_hyperb.c,v 1.15 2013/04/20 07:33:05 isaki Exp $");
 
 #include <machine/ieee.h>
 
@@ -233,6 +233,10 @@ fpu_sinh(struct fpemu *fe)
 	if (ISINF(&fe->fe_f2))
 		return &fe->fe_f2;
 
+	/* if x is +0/-0, return +0/-0 */
+	if (ISZERO(&fe->fe_f2))
+		return &fe->fe_f2;
+
 	CPYFPN(&s0, &fe->fe_f2);
 	r = __fpu_sinhcosh_taylor(fe, &s0, 2);
 
@@ -250,6 +254,10 @@ fpu_tanh(struct fpemu *fe)
 	if (ISNAN(&fe->fe_f2))
 		return &fe->fe_f2;
 
+	/* if x is +0/-0, return +0/-0 */
+	if (ISZERO(&fe->fe_f2))
+		return &fe->fe_f2;
+
 	if (ISINF(&fe->fe_f2)) {
 		sign = fe->fe_f2.fp_sign;
 		fpu_const(&fe->fe_f2, FPU_CONST_1);

Reply via email to