svn commit: r230367 - in head/lib: libc/arm/gen msun/arm
David Schultz
das at FreeBSD.org
Fri Jan 20 06:54:30 UTC 2012
Author: das
Date: Fri Jan 20 06:54:30 2012
New Revision: 230367
URL: http://svn.freebsd.org/changeset/base/230367
Log:
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.
Modified:
head/lib/libc/arm/gen/flt_rounds.c
head/lib/msun/arm/Symbol.map
head/lib/msun/arm/fenv.c
head/lib/msun/arm/fenv.h
Modified: head/lib/libc/arm/gen/flt_rounds.c
==============================================================================
--- head/lib/libc/arm/gen/flt_rounds.c Fri Jan 20 06:51:41 2012 (r230366)
+++ head/lib/libc/arm/gen/flt_rounds.c Fri Jan 20 06:54:30 2012 (r230367)
@@ -30,6 +30,8 @@ __FBSDID("$FreeBSD$");
#include <fenv.h>
#include <float.h>
+#include "softfloat-for-gcc.h"
+#include "milieu.h"
#include "softfloat.h"
int
Modified: head/lib/msun/arm/Symbol.map
==============================================================================
--- head/lib/msun/arm/Symbol.map Fri Jan 20 06:51:41 2012 (r230366)
+++ head/lib/msun/arm/Symbol.map Fri Jan 20 06:54:30 2012 (r230367)
@@ -5,8 +5,13 @@ FBSD_1.0 {
};
FBSD_1.3 {
+ feclearexcept;
+ fegetexceptflag;
fesetexceptflag;
feraiseexcept;
+ fetestexcept;
+ fegetround;
+ fesetround;
fegetenv;
feholdexcept;
feupdateenv;
Modified: head/lib/msun/arm/fenv.c
==============================================================================
--- head/lib/msun/arm/fenv.c Fri Jan 20 06:51:41 2012 (r230366)
+++ head/lib/msun/arm/fenv.c Fri Jan 20 06:54:30 2012 (r230367)
@@ -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
Modified: head/lib/msun/arm/fenv.h
==============================================================================
--- head/lib/msun/arm/fenv.h Fri Jan 20 06:51:41 2012 (r230366)
+++ head/lib/msun/arm/fenv.h Fri Jan 20 06:54:30 2012 (r230367)
@@ -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 */
More information about the svn-src-head
mailing list