123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- #ifndef _FENV_H
- # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
- #endif
- #include <features.h>
- #ifdef __CONFIG_E500__
- enum
- {
- FE_INEXACT = 1 << (63 - 42),
- #define FE_INEXACT FE_INEXACT
- FE_INVALID = 1 << (63 - 43),
- #define FE_INVALID FE_INVALID
- FE_DIVBYZERO = 1 << (63 - 44),
- #define FE_DIVBYZERO FE_DIVBYZERO
- FE_UNDERFLOW = 1 << (63 - 45),
- #define FE_UNDERFLOW FE_UNDERFLOW
- FE_OVERFLOW = 1 << (63 - 46)
- #define FE_OVERFLOW FE_OVERFLOW
- };
- #else
- enum
- {
- FE_INEXACT = 1 << (31 - 6),
- #define FE_INEXACT FE_INEXACT
- FE_DIVBYZERO = 1 << (31 - 5),
- #define FE_DIVBYZERO FE_DIVBYZERO
- FE_UNDERFLOW = 1 << (31 - 4),
- #define FE_UNDERFLOW FE_UNDERFLOW
- FE_OVERFLOW = 1 << (31 - 3),
- #define FE_OVERFLOW FE_OVERFLOW
-
- FE_INVALID = 1 << (31 - 2),
- #define FE_INVALID FE_INVALID
- #ifdef __USE_GNU
-
-
- FE_INVALID_SNAN = 1 << (31 - 7),
- # define FE_INVALID_SNAN FE_INVALID_SNAN
-
- FE_INVALID_ISI = 1 << (31 - 8),
- # define FE_INVALID_ISI FE_INVALID_ISI
-
- FE_INVALID_IDI = 1 << (31 - 9),
- # define FE_INVALID_IDI FE_INVALID_IDI
-
- FE_INVALID_ZDZ = 1 << (31 - 10),
- # define FE_INVALID_ZDZ FE_INVALID_ZDZ
-
- FE_INVALID_IMZ = 1 << (31 - 11),
- # define FE_INVALID_IMZ FE_INVALID_IMZ
-
- FE_INVALID_COMPARE = 1 << (31 - 12),
- # define FE_INVALID_COMPARE FE_INVALID_COMPARE
-
-
- FE_INVALID_SOFTWARE = 1 << (31 - 21),
- # define FE_INVALID_SOFTWARE FE_INVALID_SOFTWARE
-
-
- FE_INVALID_SQRT = 1 << (31 - 22),
- # define FE_INVALID_SQRT FE_INVALID_SQRT
-
- FE_INVALID_INTEGER_CONVERSION = 1 << (31 - 23)
- # define FE_INVALID_INTEGER_CONVERSION FE_INVALID_INTEGER_CONVERSION
- # define FE_ALL_INVALID \
- (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \
- | FE_INVALID_IMZ | FE_INVALID_COMPARE | FE_INVALID_SOFTWARE \
- | FE_INVALID_SQRT | FE_INVALID_INTEGER_CONVERSION)
- #endif
- };
- #endif
- #define FE_ALL_EXCEPT \
- (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
- enum
- {
- FE_TONEAREST = 0,
- #define FE_TONEAREST FE_TONEAREST
- FE_TOWARDZERO = 1,
- #define FE_TOWARDZERO FE_TOWARDZERO
- FE_UPWARD = 2,
- #define FE_UPWARD FE_UPWARD
- FE_DOWNWARD = 3
- #define FE_DOWNWARD FE_DOWNWARD
- };
- typedef unsigned int fexcept_t;
- typedef double fenv_t;
- extern const fenv_t __fe_dfl_env;
- #define FE_DFL_ENV (&__fe_dfl_env)
- #ifdef __USE_GNU
- extern const fenv_t __fe_enabled_env;
- # define FE_ENABLED_ENV (&__fe_enabled_env)
- extern const fenv_t __fe_nonieee_env;
- # define FE_NONIEEE_ENV (&__fe_nonieee_env)
- extern const fenv_t *__fe_nomask_env (void);
- # define FE_NOMASK_ENV (__fe_nomask_env ())
- #endif
|