mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-28 04:23:41 +01:00
fenv: provide environment primitives
This commit is contained in:
parent
1cf5a91b46
commit
08f772e6ab
2 changed files with 8 additions and 3 deletions
|
@ -55,7 +55,6 @@
|
||||||
extern int __softfloat_float_exception_flags;
|
extern int __softfloat_float_exception_flags;
|
||||||
extern int __softfloat_float_exception_mask;
|
extern int __softfloat_float_exception_mask;
|
||||||
extern int __softfloat_float_rounding_mode;
|
extern int __softfloat_float_rounding_mode;
|
||||||
void __softfloat_float_raise(int);
|
|
||||||
|
|
||||||
__fenv_static inline int
|
__fenv_static inline int
|
||||||
feclearexcept(int __excepts)
|
feclearexcept(int __excepts)
|
||||||
|
@ -86,7 +85,7 @@ __fenv_static inline int
|
||||||
feraiseexcept(int __excepts)
|
feraiseexcept(int __excepts)
|
||||||
{
|
{
|
||||||
|
|
||||||
__softfloat_float_raise(__excepts);
|
__softfloat_float_exception_flags |= __excepts;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#define __fenv_static
|
#define __fenv_static
|
||||||
#include "openlibm_fenv.h"
|
#include "openlibm_fenv.h"
|
||||||
|
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#ifdef __GNUC_GNU_INLINE__
|
#ifdef __GNUC_GNU_INLINE__
|
||||||
#error "This file must be compiled with C99 'inline' semantics"
|
#error "This file must be compiled with C99 'inline' semantics"
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,6 +41,10 @@
|
||||||
*/
|
*/
|
||||||
const fenv_t __fe_dfl_env = 0;
|
const fenv_t __fe_dfl_env = 0;
|
||||||
|
|
||||||
|
int __softfloat_float_exception_flags = 0;
|
||||||
|
int __softfloat_float_exception_mask = 0;
|
||||||
|
int __softfloat_float_rounding_mode = FLT_ROUNDS;
|
||||||
|
|
||||||
#define __set_env(env, flags, mask, rnd) env = ((flags) \
|
#define __set_env(env, flags, mask, rnd) env = ((flags) \
|
||||||
| (mask)<<_FPUSW_SHIFT \
|
| (mask)<<_FPUSW_SHIFT \
|
||||||
| (rnd) << 24)
|
| (rnd) << 24)
|
||||||
|
|
Loading…
Reference in a new issue