Home | History | Annotate | Line # | Download | only in include
ieeefp.h revision 1.3.16.1
      1  1.3.16.1  pgoyette /*	$NetBSD: ieeefp.h,v 1.3.16.1 2017/04/26 02:53:00 pgoyette Exp $	*/
      2       1.1     bjh21 
      3       1.1     bjh21 /*
      4       1.1     bjh21  * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995
      5       1.1     bjh21  * Public domain.
      6       1.1     bjh21  */
      7       1.1     bjh21 
      8       1.3      matt #ifndef _ARM_IEEEFP_H_
      9       1.3      matt #define _ARM_IEEEFP_H_
     10       1.1     bjh21 
     11       1.2      matt #include <sys/featuretest.h>
     12       1.1     bjh21 
     13       1.2      matt #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
     14       1.2      matt 
     15       1.3      matt #include <arm/fenv.h>
     16       1.2      matt 
     17       1.2      matt #if !defined(_ISOC99_SOURCE)
     18       1.1     bjh21 
     19       1.1     bjh21 /* Exception type (used by fpsetmask() et al.) */
     20       1.1     bjh21 
     21       1.1     bjh21 typedef int fp_except;
     22       1.1     bjh21 
     23  1.3.16.1  pgoyette /* adjust for FP_* and FE_* value differences */
     24  1.3.16.1  pgoyette #define	__FPE(x) (x)
     25  1.3.16.1  pgoyette #define	__FEE(x) (x)
     26  1.3.16.1  pgoyette #define	__FPR(x) (x)
     27  1.3.16.1  pgoyette #define	__FER(x) (x)
     28  1.3.16.1  pgoyette 
     29       1.1     bjh21 /* Bit defines for fp_except */
     30       1.1     bjh21 
     31       1.2      matt #define	FP_X_INV	FE_INVALID	/* invalid operation exception */
     32       1.2      matt #define	FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
     33       1.2      matt #define	FP_X_OFL	FE_OVERFLOW	/* overflow exception */
     34       1.2      matt #define	FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
     35       1.2      matt #define	FP_X_IMP	FE_INEXACT	/* imprecise (prec. loss; "inexact") */
     36       1.1     bjh21 
     37       1.1     bjh21 /* Rounding modes */
     38       1.1     bjh21 
     39       1.1     bjh21 typedef enum {
     40       1.2      matt     FP_RN=FE_TONEAREST,		/* round to nearest representable number */
     41       1.2      matt     FP_RP=FE_UPWARD,		/* round toward positive infinity */
     42       1.2      matt     FP_RM=FE_DOWNWARD,		/* round toward negative infinity */
     43       1.2      matt     FP_RZ=FE_TOWARDZERO		/* round to zero (truncate) */
     44       1.1     bjh21 } fp_rnd;
     45       1.1     bjh21 
     46       1.2      matt #endif /* !_ISOC99_SOURCE */
     47       1.2      matt 
     48       1.2      matt #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
     49       1.2      matt 
     50       1.3      matt #endif /* _ARM_IEEEFP_H_ */
     51