1 1.3.118.1 yamt /* $NetBSD: ieeefp.h,v 1.3.118.1 2009/05/04 08:11:51 yamt Exp $ */ 2 1.1 itojun 3 1.1 itojun /* 4 1.1 itojun * Written by J.T. Conklin, Apr 6, 1995 5 1.1 itojun * Public domain. 6 1.1 itojun */ 7 1.1 itojun 8 1.1 itojun #ifndef _SH3_IEEEFP_H_ 9 1.3 uch #define _SH3_IEEEFP_H_ 10 1.1 itojun 11 1.3.118.1 yamt #include <sys/featuretest.h> 12 1.3.118.1 yamt 13 1.3.118.1 yamt #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE) 14 1.3.118.1 yamt 15 1.3.118.1 yamt typedef int fenv_t; 16 1.3.118.1 yamt typedef int fexcept_t; 17 1.3.118.1 yamt 18 1.3.118.1 yamt #define FE_INVALID 0x01 /* invalid operation exception */ 19 1.3.118.1 yamt #define FE_DENORMAL 0x02 /* denormalization exception */ 20 1.3.118.1 yamt #define FE_DIVBYZERO 0x04 /* divide-by-zero exception */ 21 1.3.118.1 yamt #define FE_OVERFLOW 0x08 /* overflow exception */ 22 1.3.118.1 yamt #define FE_UNDERFLOW 0x10 /* underflow exception */ 23 1.3.118.1 yamt #define FE_INEXACT 0x20 /* imprecise (loss of precision) */ 24 1.3.118.1 yamt 25 1.3.118.1 yamt #define FE_ALL_EXCEPT 0x3f 26 1.3.118.1 yamt 27 1.3.118.1 yamt #define FE_TONEAREST 0 /* round to nearest representable number */ 28 1.3.118.1 yamt #define FE_DOWNWARD 1 /* round toward negative infinity */ 29 1.3.118.1 yamt #define FE_UPWARD 2 /* round toward positive infinity */ 30 1.3.118.1 yamt #define FE_TOWARDZERO 3 /* round to zero (truncate) */ 31 1.3.118.1 yamt 32 1.3.118.1 yamt #if defined(_NETBSD_SOURCE) 33 1.3.118.1 yamt 34 1.1 itojun typedef int fp_except; 35 1.3.118.1 yamt #define FP_X_INV FE_INVALID /* invalid operation exception */ 36 1.3.118.1 yamt #define FP_X_DNML FE_DENORMAL /* denormalization exception */ 37 1.3.118.1 yamt #define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */ 38 1.3.118.1 yamt #define FP_X_OFL FE_OVERFLOW /* overflow exception */ 39 1.3.118.1 yamt #define FP_X_UFL FE_UNDERFLOW /* underflow exception */ 40 1.3.118.1 yamt #define FP_X_IMP FE_INEXACT /* imprecise (loss of precision) */ 41 1.1 itojun 42 1.1 itojun typedef enum { 43 1.3.118.1 yamt FP_RN=FE_TONEAREST, /* round to nearest representable number */ 44 1.3.118.1 yamt FP_RM=FE_DOWNWARD, /* round toward negative infinity */ 45 1.3.118.1 yamt FP_RP=FE_UPWARD, /* round toward positive infinity */ 46 1.3.118.1 yamt FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */ 47 1.1 itojun } fp_rnd; 48 1.1 itojun 49 1.3.118.1 yamt #endif /* !_ISOC99_SOURCE */ 50 1.3.118.1 yamt 51 1.3.118.1 yamt #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */ 52 1.3.118.1 yamt 53 1.2 uch #endif /* !_SH3_IEEEFP_H_ */ 54