31__fenv_static
inline int
32feclearexcept(
int excepts)
36 excepts &= FE_ALL_EXCEPT;
38 fcsr &= ~(excepts | (excepts << _FCSR_CAUSE_SHIFT));
44__fenv_static
inline int
45fegetexceptflag(fexcept_t *flagp,
int excepts)
49 excepts &= FE_ALL_EXCEPT;
51 *flagp = fcsr & excepts;
56__fenv_static
inline int
57fesetexceptflag(
const fexcept_t *flagp,
int excepts)
61 excepts &= FE_ALL_EXCEPT;
64 fcsr |= *flagp & excepts;
70__fenv_static
inline int
71feraiseexcept(
int excepts)
75 excepts &= FE_ALL_EXCEPT;
77 fcsr |= excepts | (excepts << _FCSR_CAUSE_SHIFT);
83__fenv_static
inline int
84fetestexcept(
int excepts)
88 excepts &= FE_ALL_EXCEPT;
91 return (fcsr & excepts);
94__fenv_static
inline int
101 return (fcsr & _ROUND_MASK);
104__fenv_static
inline int
105fesetround(
int rounding_mode)
109 if (rounding_mode & ~_ROUND_MASK)
113 fcsr &= ~_ROUND_MASK;
114 fcsr |= rounding_mode;
120__fenv_static
inline int
121fegetenv(fenv_t *envp)
129__fenv_static
inline int
130feholdexcept(fenv_t *envp)
136 fcsr &= ~(FE_ALL_EXCEPT | _ENABLE_MASK);
142__fenv_static
inline int
143fesetenv(
const fenv_t *envp)
151__fenv_static
inline int
152feupdateenv(
const fenv_t *envp)
166#ifdef __mips_soft_float
167int feenableexcept(
int __mask);
168int fedisableexcept(
int __mask);
169int fegetexcept(
void);
172feenableexcept(
int __mask)
174 fenv_t __old_fcsr, __new_fcsr;
177 __new_fcsr = __old_fcsr | (__mask & FE_ALL_EXCEPT) << _ENABLE_SHIFT;
180 return ((__old_fcsr >> _ENABLE_SHIFT) & FE_ALL_EXCEPT);
184fedisableexcept(
int __mask)
186 fenv_t __old_fcsr, __new_fcsr;
189 __new_fcsr = __old_fcsr & ~((__mask & FE_ALL_EXCEPT) << _ENABLE_SHIFT);
192 return ((__old_fcsr >> _ENABLE_SHIFT) & FE_ALL_EXCEPT);
202 return ((fcsr & _ENABLE_MASK) >> _ENABLE_SHIFT);