xref: /netbsd-src/sys/arch/x86/include/ieeefp.h (revision 254ee22cb104505bc3c87c73db8da299d461e5cc)
1*254ee22cSchristos /*	$NetBSD: ieeefp.h,v 1.4 2011/03/26 19:52:20 christos Exp $	*/
28375b2d9Sfvdl 
38375b2d9Sfvdl /*
48375b2d9Sfvdl  * Written by J.T. Conklin, Apr 6, 1995
58375b2d9Sfvdl  * Public domain.
68375b2d9Sfvdl  */
78375b2d9Sfvdl 
88375b2d9Sfvdl #ifndef _X86_IEEEFP_H_
98375b2d9Sfvdl #define _X86_IEEEFP_H_
108375b2d9Sfvdl 
1191d4704cSmatt #include <sys/featuretest.h>
127f1183f2Sjoerg #include <machine/fenv.h>
1391d4704cSmatt 
148375b2d9Sfvdl typedef int fp_except;
1591d4704cSmatt #define FP_X_INV	FE_INVALID	/* invalid operation exception */
1691d4704cSmatt #define FP_X_DNML	FE_DENORMAL	/* denormalization exception */
1791d4704cSmatt #define FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
1891d4704cSmatt #define FP_X_OFL	FE_OVERFLOW	/* overflow exception */
1991d4704cSmatt #define FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
2091d4704cSmatt #define FP_X_IMP	FE_INEXACT	/* imprecise (loss of precision) */
218375b2d9Sfvdl 
228375b2d9Sfvdl typedef enum {
23*254ee22cSchristos 	FP_RN=FE_TONEAREST,		/* round to nearest representable num */
2491d4704cSmatt 	FP_RM=FE_DOWNWARD,		/* round toward negative infinity */
2591d4704cSmatt 	FP_RP=FE_UPWARD,		/* round toward positive infinity */
2691d4704cSmatt 	FP_RZ=FE_TOWARDZERO		/* round to zero (truncate) */
278375b2d9Sfvdl } fp_rnd;
288375b2d9Sfvdl 
29*254ee22cSchristos typedef enum {
30*254ee22cSchristos 	FP_PS = 0,			/* 24 bit (single-precision) */
31*254ee22cSchristos 	FP_PRS,				/* reserved */
32*254ee22cSchristos 	FP_PD,				/* 53 bit (double-precision) */
33*254ee22cSchristos 	FP_PE				/* 64 bit (extended-precision) */
34*254ee22cSchristos } fp_prec;
35*254ee22cSchristos 
36*254ee22cSchristos 
378375b2d9Sfvdl #endif /* _X86_IEEEFP_H_ */
38