Module Name: src
Committed By: isaki
Date: Sat Aug 6 00:58:55 UTC 2016
Modified Files:
src/sys/arch/m68k/fpe: fpu_trig.c
Log Message:
Modify fpu_sin()'s logic to avoid GCC's warning that has been
pointed out in the previous commit.
For fpu_cos() there is no such problem, but sync with fpu_sin().
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/m68k/fpe/fpu_trig.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_trig.c
diff -u src/sys/arch/m68k/fpe/fpu_trig.c:1.16 src/sys/arch/m68k/fpe/fpu_trig.c:1.17
--- src/sys/arch/m68k/fpe/fpu_trig.c:1.16 Wed Mar 23 05:25:51 2016
+++ src/sys/arch/m68k/fpe/fpu_trig.c Sat Aug 6 00:58:55 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu_trig.c,v 1.16 2016/03/23 05:25:51 mrg Exp $ */
+/* $NetBSD: fpu_trig.c,v 1.17 2016/08/06 00:58:55 isaki Exp $ */
/*
* Copyright (c) 1995 Ken Nakata
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu_trig.c,v 1.16 2016/03/23 05:25:51 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_trig.c,v 1.17 2016/08/06 00:58:55 isaki Exp $");
#include "fpu_emulate.h"
@@ -229,11 +229,10 @@ fpu_cos(struct fpemu *fe)
if (ISINF(&fe->fe_f2))
return fpu_newnan(fe);
- CPYFPN(&x, &fe->fe_f2);
-
/* x = abs(input) */
- x.fp_sign = 0;
sign = 0;
+ CPYFPN(&x, &fe->fe_f2);
+ x.fp_sign = 0;
/* p <- 2*pi */
fpu_const(&p, FPU_CONST_PI);
@@ -334,13 +333,9 @@ fpu_sin(struct fpemu *fe)
if (ISZERO(&fe->fe_f2))
return &fe->fe_f2;
-#if defined(__GNUC__) && (__GNUC__ >= 5) && defined(__OPTIMIZE__)
- x.fp_sign = 0;
-#endif
- CPYFPN(&x, &fe->fe_f2);
-
/* x = abs(input) */
- sign = x.fp_sign;
+ sign = fe->fe_f2.fp_sign;
+ CPYFPN(&x, &fe->fe_f2);
x.fp_sign = 0;
/* p <- 2*pi */