Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/include the FP_* exception constants need t...
details: https://anonhg.NetBSD.org/src/rev/1ccc2dc93f4f
branches: trunk
changeset: 351788:1ccc2dc93f4f
user: chs <chs%NetBSD.org@localhost>
date: Mon Feb 27 06:51:46 2017 +0000
description:
the FP_* exception 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/powerpc/include/ieeefp.h | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diffs (30 lines):
diff -r dc1dd8712e21 -r 1ccc2dc93f4f sys/arch/powerpc/include/ieeefp.h
--- a/sys/arch/powerpc/include/ieeefp.h Mon Feb 27 06:50:15 2017 +0000
+++ b/sys/arch/powerpc/include/ieeefp.h Mon Feb 27 06:51:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ieeefp.h,v 1.5 2015/12/25 06:02:10 christos Exp $ */
+/* $NetBSD: ieeefp.h,v 1.6 2017/02/27 06:51:46 chs Exp $ */
/*
* Written by J.T. Conklin, Apr 6, 1995
@@ -17,11 +17,15 @@
#if !defined(_ISOC99_SOURCE)
typedef int fp_except;
-#define FP_X_IMP FE_INEXACT /* imprecise (loss of precision) */
-#define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */
-#define FP_X_UFL FE_UNDERFLOW /* underflow exception */
-#define FP_X_OFL FE_OVERFLOW /* overflow exception */
-#define FP_X_INV FE_INVALID /* invalid operation exception */
+
+/* adjust for FP_* and FE_* value differences */
+#define __FPE(x) ((x) >> 25)
+
+#define FP_X_IMP __FPE(FE_INEXACT) /* imprecise (loss of precision) */
+#define FP_X_DZ __FPE(FE_DIVBYZERO) /* divide-by-zero exception */
+#define FP_X_UFL __FPE(FE_UNDERFLOW) /* underflow exception */
+#define FP_X_OFL __FPE(FE_OVERFLOW) /* overflow 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