1 /* $NetBSD: ieeefp.h,v 1.3 2010/07/31 21:47:54 joerg Exp $ */ 2 3 /* 4 * Written by J.T. Conklin, Apr 6, 1995 5 * Public domain. 6 */ 7 8 #ifndef _X86_IEEEFP_H_ 9 #define _X86_IEEEFP_H_ 10 11 #include <sys/featuretest.h> 12 #include <machine/fenv.h> 13 14 typedef int fp_except; 15 #define FP_X_INV FE_INVALID /* invalid operation exception */ 16 #define FP_X_DNML FE_DENORMAL /* denormalization exception */ 17 #define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ 18 #define FP_X_OFL FE_OVERFLOW /* overflow exception */ 19 #define FP_X_UFL FE_UNDERFLOW /* underflow exception */ 20 #define FP_X_IMP FE_INEXACT /* imprecise (loss of precision) */ 21 22 typedef enum { 23 FP_RN=FE_TONEAREST, /* round to nearest representable number */ 24 FP_RM=FE_DOWNWARD, /* round toward negative infinity */ 25 FP_RP=FE_UPWARD, /* round toward positive infinity */ 26 FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */ 27 } fp_rnd; 28 29 #endif /* _X86_IEEEFP_H_ */ 30