1 /* $NetBSD: ieeefp.h,v 1.2 2017/02/23 02:03:27 scole Exp $ */ 2 3 /* 4 * Written by J.T. Conklin, Apr 28, 1995 5 * Public domain. 6 */ 7 8 #ifndef _IA64_IEEEFP_H_ 9 #define _IA64_IEEEFP_H_ 10 11 #include <sys/featuretest.h> 12 13 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE) 14 15 #include <ia64/fenv.h> 16 17 /* 18 * These bits match the fpcr as well as bits 12:11 19 * in fp operate instructions 20 */ 21 /* XXX remove since fenv.h now contains (but with different values)? */ 22 #if 0 23 #define FE_TOWARDZERO 0 /* round to zero (truncate) */ 24 #define FE_DOWNWARD 1 /* round toward negative infinity */ 25 #define FE_TONEAREST 2 /* round to nearest representable number */ 26 #define FE_UPWARD 3 /* round toward positive infinity */ 27 #endif 28 29 #if !defined(_ISOC99_SOURCE) 30 31 typedef int fp_except; 32 33 #define FP_X_INV FE_INVALID /* invalid operation exception */ 34 #define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ 35 #define FP_X_OFL FE_OVERFLOW /* overflow exception */ 36 #define FP_X_UFL FE_UNDERFLOW /* underflow exception */ 37 #define FP_X_IMP FE_INEXACT /* imprecise (prec. loss; "inexact") */ 38 #define FP_X_IOV FE_IOVERFLOW /* integer overflow */ 39 40 /* 41 * fp_rnd bits match the fpcr, below, as well as bits 12:11 42 * in fp operate instructions 43 */ 44 typedef enum { 45 FP_RZ = FE_TOWARDZERO, /* round to zero (truncate) */ 46 FP_RM = FE_DOWNWARD, /* round toward negative infinity */ 47 FP_RN = FE_TONEAREST, /* round to nearest representable number */ 48 FP_RP = FE_UPWARD, /* round toward positive infinity */ 49 _FP_DYNAMIC=FP_RP 50 } fp_rnd; 51 52 #endif /* !_ISOC99_SOURCE */ 53 54 #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */ 55 56 #endif /* _IA64_IEEEFP_H_ */ 57 58 59 60 61 62 63 64 65 66 67