public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] or1k: Only define fpu rouding and exceptions with hard-float
@ 2024-03-22 15:44 Stafford Horne
0 siblings, 0 replies; only message in thread
From: Stafford Horne @ 2024-03-22 15:44 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=df7e29e2a4aadc7e19669eaf953cee1bcf8b156f
commit df7e29e2a4aadc7e19669eaf953cee1bcf8b156f
Author: Stafford Horne <shorne@gmail.com>
Date: Tue Mar 19 20:53:37 2024 +0000
or1k: Only define fpu rouding and exceptions with hard-float
This test failure:
math/test-fenv
If rounding mode and exception macros are defined then the fenv tests
run and always fail. This patch adds an ifdef using the
__or1k_hard_float__ macro provided by gcc to avoid defining these fenv
macros when they cnnot be used. This is similar to what is done in csky.
Note, I will post the or1k hard-float support soon. So, I prefer to
leave the hard-float bits here for now.
Diff:
---
sysdeps/or1k/bits/fenv.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/sysdeps/or1k/bits/fenv.h b/sysdeps/or1k/bits/fenv.h
index 587039ca03..01267805e6 100644
--- a/sysdeps/or1k/bits/fenv.h
+++ b/sysdeps/or1k/bits/fenv.h
@@ -21,6 +21,7 @@
# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
#endif
+#ifdef __or1k_hard_float__
/* Define bits representing exceptions in the FPCSR status word. */
enum
{
@@ -51,6 +52,24 @@ enum
#define FE_UPWARD (0x2 << 1)
#define FE_DOWNWARD (0x3 << 1)
+#else
+
+/* In the soft-float case only rounding to nearest is supported, with
+ no exceptions. */
+
+enum
+ {
+ __FE_UNDEFINED = -1,
+
+ FE_TONEAREST =
+# define FE_TONEAREST 0x0
+ FE_TONEAREST
+ };
+
+# define FE_ALL_EXCEPT 0
+
+#endif /* __or1k_hard_float__ */
+
/* Type representing exception flags. */
typedef unsigned int fexcept_t;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-22 15:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 15:44 [glibc] or1k: Only define fpu rouding and exceptions with hard-float Stafford Horne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).