1 1.2 matt /* $NetBSD: fenv.h,v 1.2 2014/01/29 00:22:09 matt Exp $ */ 2 1.1 matt 3 1.1 matt /* 4 1.1 matt * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 5 1.1 matt * Public domain. 6 1.1 matt */ 7 1.1 matt 8 1.1 matt #ifndef _ARM_FENV_H_ 9 1.1 matt #define _ARM_FENV_H_ 10 1.1 matt 11 1.2 matt #ifdef __ARM_PCS_AAPCS64 12 1.2 matt /* AArch64 split FPSCR into two registers FPCR and FPSR */ 13 1.2 matt typedef struct { 14 1.2 matt unsigned int __fpcr; 15 1.2 matt unsigned int __fpsr; 16 1.2 matt } fenv_t; 17 1.2 matt #else 18 1.2 matt typedef int fenv_t; /* FPSCR */ 19 1.2 matt #endif 20 1.1 matt typedef int fexcept_t; 21 1.1 matt 22 1.1 matt #define FE_INVALID 0x01 /* invalid operation exception */ 23 1.1 matt #define FE_DIVBYZERO 0x02 /* divide-by-zero exception */ 24 1.1 matt #define FE_OVERFLOW 0x04 /* overflow exception */ 25 1.1 matt #define FE_UNDERFLOW 0x08 /* underflow exception */ 26 1.1 matt #define FE_INEXACT 0x10 /* imprecise (loss of precision; "inexact") */ 27 1.1 matt 28 1.1 matt #define FE_ALL_EXCEPT 0x1f 29 1.1 matt 30 1.1 matt #define FE_TONEAREST 0 /* round to nearest representable number */ 31 1.1 matt #define FE_UPWARD 1 /* round toward positive infinity */ 32 1.1 matt #define FE_DOWNWARD 2 /* round toward negative infinity */ 33 1.1 matt #define FE_TOWARDZERO 3 /* round to zero (truncate) */ 34 1.1 matt 35 1.1 matt __BEGIN_DECLS 36 1.1 matt 37 1.1 matt /* Default floating-point environment */ 38 1.1 matt extern const fenv_t __fe_dfl_env; 39 1.1 matt #define FE_DFL_ENV (&__fe_dfl_env) 40 1.1 matt 41 1.1 matt __END_DECLS 42 1.1 matt 43 1.1 matt #endif /* _ARM_FENV_H_ */ 44