This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tile: Ignore feraiseexcept() internally.


Recent changes to the math directory have exposed a lot of calls to
feraiseexcept() without the traditional "#ifndef FE_INVALID" guards
around them.  Such changes clean up the code, though it's arguably not
maximally standards-conformant, since implementations aren't required
to provide any specific floating-point exceptions.

And, in fact, the Tilera chips don't provide a facility for raising
floating-point exceptions; TILEPro has only softfloat support, and
TILE-Gx provides simplified floating-point hardware that operates on
the integer registers, but doesn't support FP exceptions.

To keep the glibc source code clean internally but still allow the math
code to build for tile, this change adds a tile-specific #define for
feraiseexcept() that ignores the (undefined) argument.

A previous version of this change was under an #ifdef in include/fenv.h;
this version localizes the fix to just the tile sysdep directory, for
glibc's internal use only.

 ChangeLog.tile              |    4 ++++
 sysdeps/tile/math_private.h |   12 ++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 sysdeps/tile/math_private.h

diff --git a/ChangeLog.tile b/ChangeLog.tile
index 8842f16..aded10d 100644
--- a/ChangeLog.tile
+++ b/ChangeLog.tile
@@ -1,3 +1,7 @@
+2012-01-31  Chris Metcalf  <cmetcalf@tilera.com>
+
+	* sysdeps/tile/math_private.h: Ignore feraiseexcept() internally.
+
 2012-01-30  Chris Metcalf  <cmetcalf@tilera.com>
 
 	* sysdeps/tile/sysdep.h: Don't check HAVE_ELF or NO_UNDERSCORES.
diff --git a/sysdeps/tile/math_private.h b/sysdeps/tile/math_private.h
new file mode 100644
index 0000000..ea4c8ea
--- /dev/null
+++ b/sysdeps/tile/math_private.h
@@ -0,0 +1,12 @@
+#ifndef _MATH_PRIVATE_H
+
+#include <math/math_private.h>
+
+/* We have no exception support, so feraiseexcept() must be a no-op.
+   And since we don't define FE_INVALID, FE_DIVBYZERO, etc., we
+   must ignore the argument of feraiseexcept() as well.  we return
+   "1" to indicate we failed to raise an exception, though none of
+   the callers in glibc actually care.  */
+#define feraiseexcept(excepts) 1
+
+#endif
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]