xref: /netbsd-src/sys/arch/sparc/include/ieeefp.h (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1 /*	$NetBSD: ieeefp.h,v 1.9 2015/01/03 18:12:12 martin Exp $	*/
2 
3 /*
4  * Written by J.T. Conklin, Apr 6, 1995
5  * Public domain.
6  */
7 
8 #ifndef _SPARC_IEEEFP_H_
9 #define _SPARC_IEEEFP_H_
10 
11 #include <sys/featuretest.h>
12 
13 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
14 
15 #define	FE_TONEAREST	0	/* round to nearest representable number */
16 #define	FE_TOWARDZERO	1	/* round to zero (truncate) */
17 #define	FE_UPWARD	2	/* round toward positive infinity */
18 #define	FE_DOWNWARD	3	/* round toward negative infinity */
19 
20 #if !defined(_ISOC99_SOURCE)
21 
22 typedef unsigned int fp_except;
23 #define FP_X_IMP	0x01		/* imprecise (loss of precision) */
24 #define FP_X_DZ		0x02		/* divide-by-zero exception */
25 #define FP_X_UFL	0x04		/* underflow exception */
26 #define FP_X_OFL	0x08		/* overflow exception */
27 #define FP_X_INV	0x10		/* invalid operation exception */
28 
29 typedef enum {
30     FP_RN=0,			/* round to nearest representable number */
31     FP_RZ=1,			/* round to zero (truncate) */
32     FP_RP=2,			/* round toward positive infinity */
33     FP_RM=3			/* round toward negative infinity */
34 } fp_rnd;
35 
36 #endif /* !_ISOC99_SOURCE */
37 
38 #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */
39 
40 #endif /* _SPARC_IEEEFP_H_ */
41