1 1.4 christos /* $NetBSD: ieeefp.h,v 1.4 2011/03/26 19:52:20 christos Exp $ */ 2 1.1 fvdl 3 1.1 fvdl /* 4 1.1 fvdl * Written by J.T. Conklin, Apr 6, 1995 5 1.1 fvdl * Public domain. 6 1.1 fvdl */ 7 1.1 fvdl 8 1.1 fvdl #ifndef _X86_IEEEFP_H_ 9 1.1 fvdl #define _X86_IEEEFP_H_ 10 1.1 fvdl 11 1.2 matt #include <sys/featuretest.h> 12 1.3 joerg #include <machine/fenv.h> 13 1.2 matt 14 1.1 fvdl typedef int fp_except; 15 1.2 matt #define FP_X_INV FE_INVALID /* invalid operation exception */ 16 1.2 matt #define FP_X_DNML FE_DENORMAL /* denormalization exception */ 17 1.2 matt #define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ 18 1.2 matt #define FP_X_OFL FE_OVERFLOW /* overflow exception */ 19 1.2 matt #define FP_X_UFL FE_UNDERFLOW /* underflow exception */ 20 1.2 matt #define FP_X_IMP FE_INEXACT /* imprecise (loss of precision) */ 21 1.1 fvdl 22 1.1 fvdl typedef enum { 23 1.4 christos FP_RN=FE_TONEAREST, /* round to nearest representable num */ 24 1.4 christos FP_RM=FE_DOWNWARD, /* round toward negative infinity */ 25 1.4 christos FP_RP=FE_UPWARD, /* round toward positive infinity */ 26 1.4 christos FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */ 27 1.1 fvdl } fp_rnd; 28 1.1 fvdl 29 1.4 christos typedef enum { 30 1.4 christos FP_PS = 0, /* 24 bit (single-precision) */ 31 1.4 christos FP_PRS, /* reserved */ 32 1.4 christos FP_PD, /* 53 bit (double-precision) */ 33 1.4 christos FP_PE /* 64 bit (extended-precision) */ 34 1.4 christos } fp_prec; 35 1.4 christos 36 1.4 christos 37 1.1 fvdl #endif /* _X86_IEEEFP_H_ */ 38