Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/m68k/include use FPCR instead of FPSR to manipulate...
details: https://anonhg.NetBSD.org/src/rev/420f70a369ec
branches: trunk
changeset: 351784:420f70a369ec
user: chs <chs%NetBSD.org@localhost>
date: Mon Feb 27 06:47:30 2017 +0000
description:
use FPCR instead of FPSR to manipulate the exception mask.
diffstat:
sys/arch/m68k/include/fenv.h | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diffs (69 lines):
diff -r babc687be92d -r 420f70a369ec sys/arch/m68k/include/fenv.h
--- a/sys/arch/m68k/include/fenv.h Mon Feb 27 06:46:59 2017 +0000
+++ b/sys/arch/m68k/include/fenv.h Mon Feb 27 06:47:30 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fenv.h,v 1.4 2016/01/05 00:47:08 ozaki-r Exp $ */
+/* $NetBSD: fenv.h,v 1.5 2017/02/27 06:47:30 chs Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
#define FE_ALL_EXCEPT \
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
-/* Rounding modes, from FPSR */
+/* Rounding modes, from FPCR */
#define FE_TONEAREST FPCR_NEAR
#define FE_TOWARDZERO FPCR_ZERO
#define FE_DOWNWARD FPCR_MINF
@@ -266,12 +266,12 @@
static inline int
feenableexcept(int __mask)
{
- fexcept_t __fpsr, __oldmask;
+ fexcept_t __fpcr, __oldmask;
- __get_fpsr(__fpsr);
- __oldmask = __fpsr & FE_ALL_EXCEPT;
- __fpsr |= __mask & FE_ALL_EXCEPT;
- __set_fpsr(__fpsr);
+ __get_fpcr(__fpcr);
+ __oldmask = (__fpcr >> 6) & FE_ALL_EXCEPT;
+ __fpcr |= (__mask & FE_ALL_EXCEPT) << 6;
+ __set_fpcr(__fpcr);
return __oldmask;
}
@@ -279,12 +279,12 @@
static inline int
fedisableexcept(int __mask)
{
- fexcept_t __fpsr, __oldmask;
+ fexcept_t __fpcr, __oldmask;
- __get_fpsr(__fpsr);
- __oldmask = __fpsr & FE_ALL_EXCEPT;
- __fpsr &= ~(__mask & FE_ALL_EXCEPT);
- __set_fpsr(__fpsr);
+ __get_fpcr(__fpcr);
+ __oldmask = (__fpcr >> 6) & FE_ALL_EXCEPT;
+ __fpcr &= ~((__mask & FE_ALL_EXCEPT) << 6);
+ __set_fpcr(__fpcr);
return __oldmask;
}
@@ -292,11 +292,11 @@
static inline int
fegetexcept(void)
{
- fexcept_t __fpsr;
+ fexcept_t __fpcr;
- __get_fpsr(__fpsr);
+ __get_fpcr(__fpcr);
- return __fpsr & FE_ALL_EXCEPT;
+ return (__fpcr >> 6) & FE_ALL_EXCEPT;
}
#endif /* _NETBSD_SOURCE || _GNU_SOURCE */
Home |
Main Index |
Thread Index |
Old Index