From: Stafford Horne <shorne@gmail.com>
To: GLIBC patches <libc-alpha@sourceware.org>
Cc: Linux OpenRISC <linux-openrisc@vger.kernel.org>,
Stafford Horne <shorne@gmail.com>
Subject: [PATCH 3/4] or1k: Only define fpu rouding and exceptions with hard-float
Date: Tue, 19 Mar 2024 21:42:43 +0000 [thread overview]
Message-ID: <20240319214244.736981-4-shorne@gmail.com> (raw)
In-Reply-To: <20240319214244.736981-1-shorne@gmail.com>
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.
---
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;
--
2.44.0
next prev parent reply other threads:[~2024-03-19 21:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 21:42 [PATCH 0/4] OpenRISC fixes for 2.39 Stafford Horne
2024-03-19 21:42 ` [PATCH 1/4] or1k: Fix Linux user space signal ABI Stafford Horne
2024-03-20 13:24 ` Adhemerval Zanella Netto
2024-03-20 14:13 ` Stafford Horne
2024-03-20 20:12 ` Adhemerval Zanella Netto
2024-03-19 21:42 ` [PATCH 2/4] or1k: Update libm test ulps Stafford Horne
2024-03-19 21:42 ` Stafford Horne [this message]
2024-03-19 21:42 ` [PATCH 4/4] or1k: Add prctl wrapper to unwrap variadic args Stafford Horne
2024-03-20 13:28 ` Adhemerval Zanella Netto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240319214244.736981-4-shorne@gmail.com \
--to=shorne@gmail.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-openrisc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.