summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2012-01-20 06:54:30 +0000
committerdas <das@FreeBSD.org>2012-01-20 06:54:30 +0000
commit062863058064f1d7107e2f981a810d25709ae8ef (patch)
tree5d27cd4fbd998f557b2eb9d944ced1092fe39a96
parenteb8ecc65f7fa5c02118488dbceb9bc57176e4867 (diff)
downloadFreeBSD-src-062863058064f1d7107e2f981a810d25709ae8ef.zip
FreeBSD-src-062863058064f1d7107e2f981a810d25709ae8ef.tar.gz
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.
-rw-r--r--lib/libc/arm/gen/flt_rounds.c2
-rw-r--r--lib/msun/arm/Symbol.map5
-rw-r--r--lib/msun/arm/fenv.c14
-rw-r--r--lib/msun/arm/fenv.h25
4 files changed, 33 insertions, 13 deletions
diff --git a/lib/libc/arm/gen/flt_rounds.c b/lib/libc/arm/gen/flt_rounds.c
index defb535..81ab08b 100644
--- a/lib/libc/arm/gen/flt_rounds.c
+++ b/lib/libc/arm/gen/flt_rounds.c
@@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$");
#include <fenv.h>
#include <float.h>
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
#include "softfloat.h"
int
diff --git a/lib/msun/arm/Symbol.map b/lib/msun/arm/Symbol.map
index 971112e..c43d8cf 100644
--- a/lib/msun/arm/Symbol.map
+++ b/lib/msun/arm/Symbol.map
@@ -5,8 +5,13 @@ FBSD_1.0 {
};
FBSD_1.3 {
+ feclearexcept;
+ fegetexceptflag;
fesetexceptflag;
feraiseexcept;
+ fetestexcept;
+ fegetround;
+ fesetround;
fegetenv;
feholdexcept;
feupdateenv;
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
diff --git a/lib/msun/arm/fenv.h b/lib/msun/arm/fenv.h
index 7bcef6b..e245fb0 100644
--- a/lib/msun/arm/fenv.h
+++ b/lib/msun/arm/fenv.h
@@ -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 */
OpenPOWER on IntegriCloud