xref: /netbsd-src/sys/arch/arm/include/ieeefp.h (revision 23c8222edbfb0f0932d88a8351d3a0cf817dfb9e)
1 /*	$NetBSD: ieeefp.h,v 1.1 2001/01/10 19:02:06 bjh21 Exp $	*/
2 
3 /*
4  * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995
5  * Public domain.
6  */
7 
8 #ifndef _ARM32_IEEEFP_H_
9 #define _ARM32_IEEEFP_H_
10 
11 /* FP exception codes */
12 
13 #define FP_EXCEPT_INV	0
14 #define FP_EXCEPT_DZ	1
15 #define FP_EXCEPT_OFL	2
16 #define FP_EXCEPT_UFL	3
17 #define FP_EXCEPT_IMP	4
18 
19 /* Exception type (used by fpsetmask() et al.) */
20 
21 typedef int fp_except;
22 
23 /* Bit defines for fp_except */
24 
25 #define	FP_X_INV	(1 << FP_EXCEPT_INV)	/* invalid operation exception */
26 #define	FP_X_DZ		(1 << FP_EXCEPT_DZ)	/* divide-by-zero exception */
27 #define	FP_X_OFL	(1 << FP_EXCEPT_OFL)	/* overflow exception */
28 #define	FP_X_UFL	(1 << FP_EXCEPT_UFL)	/* underflow exception */
29 #define	FP_X_IMP	(1 << FP_EXCEPT_IMP)	/* imprecise (loss of precision; "inexact") */
30 
31 /* Rounding modes */
32 
33 typedef enum {
34     FP_RN=0,			/* round to nearest representable number */
35     FP_RP=1,			/* round toward positive infinity */
36     FP_RM=2,			/* round toward negative infinity */
37     FP_RZ=3			/* round to zero (truncate) */
38 } fp_rnd;
39 
40 #endif /* _ARM32_IEEEFP_H_ */
41