xref: /netbsd-src/sys/arch/sh3/include/ieeefp.h (revision 9616dacfef448e70e3fbbd865bddf60d54b656c5)
1 /* $NetBSD: ieeefp.h,v 1.6 2016/08/25 12:29:14 christos Exp $ */
2 
3 /*
4  * Written by J.T. Conklin, Apr 6, 1995
5  * Public domain.
6  */
7 
8 #ifndef _SH3_IEEEFP_H_
9 #define	_SH3_IEEEFP_H_
10 
11 #include <sys/featuretest.h>
12 
13 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
14 
15 #include <fenv.h>
16 
17 #if defined(_NETBSD_SOURCE)
18 
19 typedef int fp_except;
20 
21 #define	FP_X_INV	FE_INVALID	/* invalid operation exception */
22 #define	FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
23 #define	FP_X_OFL	FE_OVERFLOW	/* overflow exception */
24 #define	FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
25 #define	FP_X_IMP	FE_INEXACT	/* imprecise (loss of precision) */
26 
27 typedef enum {
28 	FP_RN=FE_TONEAREST,	/* round to nearest representable number */
29 	FP_RM=FE_DOWNWARD,      /* round toward negative infinity */
30 	FP_RP=FE_UPWARD,        /* round toward positive infinity */
31 	FP_RZ=FE_TOWARDZERO	/* round to zero (truncate) */
32 } fp_rnd;
33 
34 #endif /* !_ISOC99_SOURCE */
35 
36 #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
37 
38 #endif /* !_SH3_IEEEFP_H_ */
39