SH: SH4AL-DSP/SH4A-nofpu

Thomas Schwinge thomas@codesourcery.com
Thu Jun 14 10:48:00 GMT 2012


Hi!

Here is the patch we've been using for FPU-less SH configurations.  We're
no longer supporting/testing such configurations, so I'm posting this
only for posterity, unless someone want me to apply the patch.

diff -Nru e/math_private.h sysdeps/sh/nofpu/math_private.h
--- /dev/null	1970-01-01 01:00:00.000000000 +0100
+++ sysdeps/sh/nofpu/math_private.h	2012-03-15 18:16:46.060913937 +0100
@@ -0,0 +1,20 @@
+#ifndef _MATH_PRIVATE_H
+
+#include_next <math_private.h>
+
+/* Include this one now, so that we don't get any clashes if the compiler first
+   encounters the following two #defines, and then the two function's real
+   prototypes.  TODO.  Is this kosher?  */
+#include <fenv.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
+
+/* Same for fesetround.  */
+#define fesetround(r) 1
+
+#endif
diff -Nru e/s_fma.c sysdeps/sh/nofpu/s_fma.c
--- e/s_fma.c	1970-01-01 01:00:00.000000000 +0100
+++ sysdeps/sh/nofpu/s_fma.c	2012-03-15 17:27:09.841478954 +0100
@@ -0,0 +1,2 @@
+/* We don't have exceptions and rounding mode support for FPU-less SH.  */
+#include <math/s_fma.c>
diff -Nru e/s_fmaf.c sysdeps/sh/nofpu/s_fmaf.c
--- e/s_fmaf.c	1970-01-01 01:00:00.000000000 +0100
+++ sysdeps/sh/nofpu/s_fmaf.c	2012-03-15 17:27:28.461311435 +0100
@@ -0,0 +1,2 @@
+/* We don't have exceptions and rounding mode support for FPU-less SH.  */
+#include <math/s_fmaf.c>

(Should probably get additional changes as per glibc-ports
fa12ed1f6126db0f52d4145d29094c4013829ce3.)


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120614/6cc5b1ff/attachment.sig>


More information about the Libc-alpha mailing list