1 1.1 matt /* $NetBSD: ieeefp.h,v 1.1 2014/09/03 19:34:26 matt Exp $ */ 2 1.1 matt 3 1.1 matt /* 4 1.1 matt * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 5 1.1 matt * Public domain. 6 1.1 matt */ 7 1.1 matt 8 1.1 matt #ifndef _OR1K_IEEEFP_H_ 9 1.1 matt #define _OR1K_IEEEFP_H_ 10 1.1 matt 11 1.1 matt #include <sys/featuretest.h> 12 1.1 matt 13 1.1 matt #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE) 14 1.1 matt 15 1.1 matt #include <or1k/fenv.h> 16 1.1 matt 17 1.1 matt #if !defined(_ISOC99_SOURCE) 18 1.1 matt 19 1.1 matt /* Exception type (used by fpsetmask() et al.) */ 20 1.1 matt 21 1.1 matt typedef int fp_except; 22 1.1 matt 23 1.1 matt /* Bit defines for fp_except */ 24 1.1 matt 25 1.1 matt #define FP_X_INV FE_INVALID /* invalid operation exception */ 26 1.1 matt #define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ 27 1.1 matt #define FP_X_OFL FE_OVERFLOW /* overflow exception */ 28 1.1 matt #define FP_X_UFL FE_UNDERFLOW /* underflow exception */ 29 1.1 matt #define FP_X_IMP FE_INEXACT /* imprecise (prec. loss; "inexact") */ 30 1.1 matt 31 1.1 matt /* Rounding modes */ 32 1.1 matt 33 1.1 matt typedef enum { 34 1.1 matt FP_RN=FE_TONEAREST, /* round to nearest representable number */ 35 1.1 matt FP_RP=FE_UPWARD, /* round toward positive infinity */ 36 1.1 matt FP_RM=FE_DOWNWARD, /* round toward negative infinity */ 37 1.1 matt FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */ 38 1.1 matt } fp_rnd; 39 1.1 matt 40 1.1 matt #endif /* !_ISOC99_SOURCE */ 41 1.1 matt 42 1.1 matt #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */ 43 1.1 matt 44 1.1 matt #endif /* _OR1K_IEEEFP_H_ */ 45