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 Modify fpu_sin()'s logic to avoid GCC's wa...
details: https://anonhg.NetBSD.org/src/rev/a75c6d1337f2
branches: trunk
changeset: 346897:a75c6d1337f2
user: isaki <isaki%NetBSD.org@localhost>
date: Sat Aug 06 00:58:55 2016 +0000
description:
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().
diffstat:
sys/arch/m68k/fpe/fpu_trig.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diffs (48 lines):
diff -r 25a6babc1f75 -r a75c6d1337f2 sys/arch/m68k/fpe/fpu_trig.c
--- a/sys/arch/m68k/fpe/fpu_trig.c Sat Aug 06 00:30:57 2016 +0000
+++ b/sys/arch/m68k/fpe/fpu_trig.c Sat Aug 06 00:58:55 2016 +0000
@@ -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 @@
if (ISINF(&fe->fe_f2))
return fpu_newnan(fe);
+ /* x = abs(input) */
+ sign = 0;
CPYFPN(&x, &fe->fe_f2);
-
- /* x = abs(input) */
x.fp_sign = 0;
- sign = 0;
/* p <- 2*pi */
fpu_const(&p, FPU_CONST_PI);
@@ -334,13 +333,9 @@
if (ISZERO(&fe->fe_f2))
return &fe->fe_f2;
-#if defined(__GNUC__) && (__GNUC__ >= 5) && defined(__OPTIMIZE__)
- x.fp_sign = 0;
-#endif
+ /* x = abs(input) */
+ sign = fe->fe_f2.fp_sign;
CPYFPN(&x, &fe->fe_f2);
-
- /* x = abs(input) */
- sign = x.fp_sign;
x.fp_sign = 0;
/* p <- 2*pi */
Home |
Main Index |
Thread Index |
Old Index