Home | History | Annotate | Line # | Download | only in include
ieeefp.h revision 1.8
      1  1.8  christos /*	$NetBSD: ieeefp.h,v 1.8 2015/12/25 06:03:06 christos Exp $	*/
      2  1.3     perry 
      3  1.1   mycroft /*
      4  1.1   mycroft  * Written by J.T. Conklin, Apr 6, 1995
      5  1.4   thorpej  * Modified by Jason R. Thorpe, June 22, 2003
      6  1.1   mycroft  * Public domain.
      7  1.1   mycroft  */
      8  1.1   mycroft 
      9  1.1   mycroft #ifndef _M68K_IEEEFP_H_
     10  1.1   mycroft #define _M68K_IEEEFP_H_
     11  1.1   mycroft 
     12  1.6      matt #include <sys/featuretest.h>
     13  1.6      matt 
     14  1.6      matt #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
     15  1.6      matt 
     16  1.8  christos #include <m68k/fenv.h>
     17  1.6      matt 
     18  1.6      matt #if !defined(_ISOC99_SOURCE)
     19  1.6      matt 
     20  1.1   mycroft typedef int fp_except;
     21  1.6      matt 
     22  1.6      matt #define FP_X_IMP	FE_INEXACT	/* imprecise (loss of precision) */
     23  1.6      matt #define FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
     24  1.6      matt #define FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
     25  1.6      matt #define FP_X_OFL	FE_OVERFLOW	/* overflow exception */
     26  1.6      matt #define FP_X_INV	FE_INVALID	/* invalid operation exception */
     27  1.1   mycroft 
     28  1.1   mycroft typedef enum {
     29  1.6      matt     FP_RN=FE_TONEAREST,		/* round to nearest representable number */
     30  1.6      matt     FP_RZ=FE_TOWARDZERO,	/* round to zero (truncate) */
     31  1.6      matt     FP_RM=FE_DOWNWARD,		/* round toward negative infinity */
     32  1.6      matt     FP_RP=FE_UPWARD		/* round toward positive infinity */
     33  1.1   mycroft } fp_rnd;
     34  1.1   mycroft 
     35  1.4   thorpej typedef enum {
     36  1.4   thorpej     FP_PE=0,			/* extended-precision (64-bit) */
     37  1.4   thorpej     FP_PS=1,			/* single-precision (24-bit) */
     38  1.4   thorpej     FP_PD=2			/* double-precision (53-bit) */
     39  1.4   thorpej } fp_prec;
     40  1.4   thorpej 
     41  1.8  christos #endif /* !_ISOC99_SOURCE */
     42  1.6      matt 
     43  1.4   thorpej #define	__HAVE_FP_PREC
     44  1.4   thorpej 
     45  1.6      matt #endif	/* _NETBSD_SOURCE || _ISOC99_SOURCE */
     46  1.6      matt 
     47  1.1   mycroft #endif /* _M68K_IEEEFP_H_ */
     48