1 /* $NetBSD: ieeefp.h,v 1.8.2.1 2017/03/20 06:57:17 pgoyette Exp $ */ 2 3 /* 4 * Written by J.T. Conklin, Apr 11, 1995 5 * Public domain. 6 */ 7 8 #ifndef _MIPS_IEEEFP_H_ 9 #define _MIPS_IEEEFP_H_ 10 11 #include <sys/featuretest.h> 12 13 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE) 14 15 #include <mips/fenv.h> 16 17 #if !defined(_ISOC99_SOURCE) 18 19 typedef unsigned int fp_except; 20 21 /* adjust for FP_* and FE_* value differences */ 22 #define __FPE(x) ((x) >> 2) 23 24 #define FP_X_IMP __FPE(FE_INEXACT) /* imprecise (loss of precision) */ 25 #define FP_X_UFL __FPE(FE_UNDERFLOW) /* underflow exception */ 26 #define FP_X_OFL __FPE(FE_OVERFLOW) /* overflow exception */ 27 #define FP_X_DZ __FPE(FE_DIVBYZERO) /* divide-by-zero exception */ 28 #define FP_X_INV __FPE(FE_INVALID) /* invalid operation exception */ 29 30 typedef enum { 31 FP_RN=FE_TONEAREST, /* round to nearest representable number */ 32 FP_RZ=FE_TOWARDZERO, /* round to zero (truncate) */ 33 FP_RP=FE_UPWARD, /* round toward positive infinity */ 34 FP_RM=FE_DOWNWARD /* round toward negative infinity */ 35 } fp_rnd; 36 37 #endif /* !_ISOC99_SOURCE */ 38 39 #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */ 40 41 #endif /* _MIPS_IEEEFP_H_ */ 42