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