Home | History | Annotate | Line # | Download | only in include
ieeefp.h revision 1.7.16.2
      1  1.7.16.2     skrll /*	$NetBSD: ieeefp.h,v 1.7.16.2 2017/08/28 17:51:45 skrll Exp $	*/
      2       1.3     perry 
      3       1.4    simonb /*
      4       1.1       jtc  * Written by J.T. Conklin, Apr 11, 1995
      5       1.1       jtc  * Public domain.
      6       1.1       jtc  */
      7       1.1       jtc 
      8       1.2  jonathan #ifndef _MIPS_IEEEFP_H_
      9       1.2  jonathan #define _MIPS_IEEEFP_H_
     10       1.1       jtc 
     11       1.5      matt #include <sys/featuretest.h>
     12       1.5      matt 
     13       1.5      matt #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
     14       1.5      matt 
     15  1.7.16.1     skrll #include <mips/fenv.h>
     16       1.5      matt 
     17       1.5      matt #if !defined(_ISOC99_SOURCE)
     18       1.5      matt 
     19       1.7      matt typedef unsigned int fp_except;
     20  1.7.16.2     skrll 
     21  1.7.16.2     skrll /* adjust for FP_* and FE_* value differences */
     22  1.7.16.2     skrll #define	__FPE(x) ((x) >> 2)
     23  1.7.16.2     skrll #define	__FEE(x) ((x) << 2)
     24  1.7.16.2     skrll #define	__FPR(x) ((x))
     25  1.7.16.2     skrll #define	__FER(x) ((x))
     26  1.7.16.2     skrll 
     27  1.7.16.2     skrll #define FP_X_IMP	__FPE(FE_INEXACT)	/* imprecise (loss of precision) */
     28  1.7.16.2     skrll #define FP_X_UFL	__FPE(FE_UNDERFLOW)	/* underflow exception */
     29  1.7.16.2     skrll #define FP_X_OFL	__FPE(FE_OVERFLOW)	/* overflow exception */
     30  1.7.16.2     skrll #define FP_X_DZ		__FPE(FE_DIVBYZERO)	/* divide-by-zero exception */
     31  1.7.16.2     skrll #define FP_X_INV	__FPE(FE_INVALID)	/* invalid operation exception */
     32       1.1       jtc 
     33       1.1       jtc typedef enum {
     34       1.5      matt     FP_RN=FE_TONEAREST,		/* round to nearest representable number */
     35       1.5      matt     FP_RZ=FE_TOWARDZERO,	/* round to zero (truncate) */
     36       1.5      matt     FP_RP=FE_UPWARD,		/* round toward positive infinity */
     37       1.5      matt     FP_RM=FE_DOWNWARD		/* round toward negative infinity */
     38       1.1       jtc } fp_rnd;
     39       1.1       jtc 
     40       1.5      matt #endif /* !_ISOC99_SOURCE */
     41       1.5      matt 
     42       1.5      matt #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
     43       1.5      matt 
     44       1.2  jonathan #endif /* _MIPS_IEEEFP_H_ */
     45