Don't inline fenv.h functions on arm for now. Inlining makes sense:

the function bodies require only 2 to 10 instructions.  However, it
leads to application binaries that refer to a private ABI, namely, the
softfloat innards in libc.  This could complicate future changes in
the implementation of the floating-point emulation layer, so it seems
best to have programs refer to the official fe* entry points in libm.
This commit is contained in:
David Schultz 2012-01-20 06:54:30 +00:00
parent 9fa03ecd01
commit 7082a2cf72
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230367
4 changed files with 33 additions and 13 deletions

View File

@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$");
#include <fenv.h>
#include <float.h>
#include "softfloat-for-gcc.h"
#include "milieu.h"
#include "softfloat.h"
int

View File

@ -5,8 +5,13 @@ FBSD_1.0 {
};
FBSD_1.3 {
feclearexcept;
fegetexceptflag;
fesetexceptflag;
feraiseexcept;
fetestexcept;
fegetround;
fesetround;
fegetenv;
feholdexcept;
feupdateenv;

View File

@ -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

View File

@ -65,19 +65,18 @@ extern const fenv_t __fe_dfl_env;
#define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT)
#ifndef ARM_HARD_FLOAT
/*
* 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>
int feclearexcept(int __excepts);
int fegetexceptflag(fexcept_t *__flagp, int __excepts);
int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
int feraiseexcept(int __excepts);
int fetestexcept(int __excepts);
int fegetround(void);
int fesetround(int __round);
int fegetenv(fenv_t *__envp);
int feholdexcept(fenv_t *__envp);
int fesetenv(const fenv_t *__envp);
int feupdateenv(const fenv_t *__envp);
#else /* ARM_HARD_FLOAT */