Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / x86 / ieeefp.h @ 14

History | View | Annotate | Download (1.07 KB)

1
/*        $NetBSD: ieeefp.h,v 1.4 2011/03/26 19:52:20 christos Exp $        */
2

    
3
/* 
4
 * Written by J.T. Conklin, Apr 6, 1995
5
 * Public domain.
6
 */
7

    
8
#ifndef _X86_IEEEFP_H_
9
#define _X86_IEEEFP_H_
10

    
11
#include <sys/featuretest.h>
12
#include <machine/fenv.h>
13

    
14
typedef int fp_except;
15
#define FP_X_INV        FE_INVALID        /* invalid operation exception */
16
#define FP_X_DNML        FE_DENORMAL        /* denormalization exception */
17
#define FP_X_DZ                FE_DIVBYZERO        /* divide-by-zero exception */
18
#define FP_X_OFL        FE_OVERFLOW        /* overflow exception */
19
#define FP_X_UFL        FE_UNDERFLOW        /* underflow exception */
20
#define FP_X_IMP        FE_INEXACT        /* imprecise (loss of precision) */
21

    
22
typedef enum {
23
        FP_RN=FE_TONEAREST,                /* round to nearest representable num */
24
        FP_RM=FE_DOWNWARD,                /* round toward negative infinity */
25
        FP_RP=FE_UPWARD,                /* round toward positive infinity */
26
        FP_RZ=FE_TOWARDZERO                /* round to zero (truncate) */
27
} fp_rnd;
28

    
29
typedef enum {
30
        FP_PS = 0,                        /* 24 bit (single-precision) */
31
        FP_PRS,                                /* reserved */
32
        FP_PD,                                /* 53 bit (double-precision) */
33
        FP_PE                                /* 64 bit (extended-precision) */
34
} fp_prec;
35

    
36

    
37
#endif /* _X86_IEEEFP_H_ */