Module Name:    src
Committed By:   chs
Date:           Mon Feb 27 06:51:46 UTC 2017

Modified Files:
        src/sys/arch/powerpc/include: ieeefp.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/ieeefp.h

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/powerpc/include/ieeefp.h
diff -u src/sys/arch/powerpc/include/ieeefp.h:1.5 src/sys/arch/powerpc/include/ieeefp.h:1.6
--- src/sys/arch/powerpc/include/ieeefp.h:1.5	Fri Dec 25 06:02:10 2015
+++ src/sys/arch/powerpc/include/ieeefp.h	Mon Feb 27 06:51:46 2017
@@ -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 */

Reply via email to