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]

SH: SH4AL-DSP/SH4A-nofpu


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

Attachment: pgp00000.pgp
Description: PGP signature


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