Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/include the FP_* rounding constants need to be...
details: https://anonhg.NetBSD.org/src/rev/686d061561f0
branches: trunk
changeset: 351792:686d061561f0
user: chs <chs%NetBSD.org@localhost>
date: Mon Feb 27 06:56:03 2017 +0000
description:
the FP_* rounding constants need to be different from the new FE_* constants
to preserve the ABI, so shift them as needed when using them.
diffstat:
sys/arch/mips/include/ieeefp.h | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diffs (30 lines):
diff -r 41cb0b4ef0dd -r 686d061561f0 sys/arch/mips/include/ieeefp.h
--- a/sys/arch/mips/include/ieeefp.h Mon Feb 27 06:55:26 2017 +0000
+++ b/sys/arch/mips/include/ieeefp.h Mon Feb 27 06:56:03 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ieeefp.h,v 1.8 2015/12/25 06:01:38 christos Exp $ */
+/* $NetBSD: ieeefp.h,v 1.9 2017/02/27 06:56:03 chs Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
@@ -17,11 +17,15 @@
#if !defined(_ISOC99_SOURCE)
typedef unsigned int fp_except;
-#define FP_X_IMP FE_INEXACT /* imprecise (loss of precision) */
-#define FP_X_UFL FE_UNDERFLOW /* underflow exception */
-#define FP_X_OFL FE_OVERFLOW /* overflow exception */
-#define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */
-#define FP_X_INV FE_INVALID /* invalid operation exception */
+
+/* adjust for FP_* and FE_* value differences */
+#define __FPE(x) ((x) >> 2)
+
+#define FP_X_IMP __FPE(FE_INEXACT) /* imprecise (loss of precision) */
+#define FP_X_UFL __FPE(FE_UNDERFLOW) /* underflow exception */
+#define FP_X_OFL __FPE(FE_OVERFLOW) /* overflow exception */
+#define FP_X_DZ __FPE(FE_DIVBYZERO) /* divide-by-zero exception */
+#define FP_X_INV __FPE(FE_INVALID) /* invalid operation exception */
typedef enum {
FP_RN=FE_TONEAREST, /* round to nearest representable number */
Home |
Main Index |
Thread Index |
Old Index