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