diff options
Diffstat (limited to 'lib/msun/arm/fenv.c')
-rw-r--r-- | lib/msun/arm/fenv.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/msun/arm/fenv.c b/lib/msun/arm/fenv.c index a5a5c03..c94f9b4 100644 --- a/lib/msun/arm/fenv.c +++ b/lib/msun/arm/fenv.c @@ -29,6 +29,20 @@ #define __fenv_static #include "fenv.h" +/* + * The following macros map between the softfloat emulator's flags and + * the hardware's FPSR. The hardware this file was written for doesn't + * have rounding control bits, so we stick those in the system ID byte. + */ +#define __set_env(env, flags, mask, rnd) env = ((flags) \ + | (mask)<<_FPUSW_SHIFT \ + | (rnd) << 24) +#define __env_flags(env) ((env) & FE_ALL_EXCEPT) +#define __env_mask(env) (((env) >> _FPUSW_SHIFT) \ + & FE_ALL_EXCEPT) +#define __env_round(env) (((env) >> 24) & _ROUND_MASK) +#include "fenv-softfloat.h" + #ifdef __GNUC_GNU_INLINE__ #error "This file must be compiled with C99 'inline' semantics" #endif |