1 1.3 joerg /* $NetBSD: fenv.h,v 1.3 2015/03/17 12:20:02 joerg 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.3 joerg #include <sys/cdefs.h> 12 1.3 joerg 13 1.2 matt #ifdef __ARM_PCS_AAPCS64 14 1.2 matt /* AArch64 split FPSCR into two registers FPCR and FPSR */ 15 1.2 matt typedef struct { 16 1.2 matt unsigned int __fpcr; 17 1.2 matt unsigned int __fpsr; 18 1.2 matt } fenv_t; 19 1.2 matt #else 20 1.2 matt typedef int fenv_t; /* FPSCR */ 21 1.2 matt #endif 22 1.1 matt typedef int fexcept_t; 23 1.1 matt 24 1.1 matt #define FE_INVALID 0x01 /* invalid operation exception */ 25 1.1 matt #define FE_DIVBYZERO 0x02 /* divide-by-zero exception */ 26 1.1 matt #define FE_OVERFLOW 0x04 /* overflow exception */ 27 1.1 matt #define FE_UNDERFLOW 0x08 /* underflow exception */ 28 1.1 matt #define FE_INEXACT 0x10 /* imprecise (loss of precision; "inexact") */ 29 1.1 matt 30 1.1 matt #define FE_ALL_EXCEPT 0x1f 31 1.1 matt 32 1.1 matt #define FE_TONEAREST 0 /* round to nearest representable number */ 33 1.1 matt #define FE_UPWARD 1 /* round toward positive infinity */ 34 1.1 matt #define FE_DOWNWARD 2 /* round toward negative infinity */ 35 1.1 matt #define FE_TOWARDZERO 3 /* round to zero (truncate) */ 36 1.1 matt 37 1.1 matt __BEGIN_DECLS 38 1.1 matt 39 1.1 matt /* Default floating-point environment */ 40 1.1 matt extern const fenv_t __fe_dfl_env; 41 1.1 matt #define FE_DFL_ENV (&__fe_dfl_env) 42 1.1 matt 43 1.1 matt __END_DECLS 44 1.1 matt 45 1.1 matt #endif /* _ARM_FENV_H_ */ 46