mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] riscv: don't define fenv macros for soft float
@ 2026-01-16 12:57 Alex Rønne Petersen
  0 siblings, 0 replies; only message in thread
From: Alex Rønne Petersen @ 2026-01-16 12:57 UTC (permalink / raw)
  To: musl; +Cc: Alex Rønne Petersen

As is done for all other soft float ports.
---
 arch/riscv32/bits/fenv.h | 5 +++++
 arch/riscv64/bits/fenv.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/arch/riscv32/bits/fenv.h b/arch/riscv32/bits/fenv.h
index 806ec40f..2c126e6b 100644
--- a/arch/riscv32/bits/fenv.h
+++ b/arch/riscv32/bits/fenv.h
@@ -1,3 +1,7 @@
+#ifdef __riscv_float_abi_soft
+#define FE_ALL_EXCEPT   0
+#define FE_TONEAREST    0
+#else
 #define FE_INVALID      16
 #define FE_DIVBYZERO    8
 #define FE_OVERFLOW     4
@@ -10,6 +14,7 @@
 #define FE_DOWNWARD     2
 #define FE_UPWARD       3
 #define FE_TOWARDZERO   1
+#endif
 
 typedef unsigned int fexcept_t;
 typedef unsigned int fenv_t;
diff --git a/arch/riscv64/bits/fenv.h b/arch/riscv64/bits/fenv.h
index 806ec40f..2c126e6b 100644
--- a/arch/riscv64/bits/fenv.h
+++ b/arch/riscv64/bits/fenv.h
@@ -1,3 +1,7 @@
+#ifdef __riscv_float_abi_soft
+#define FE_ALL_EXCEPT   0
+#define FE_TONEAREST    0
+#else
 #define FE_INVALID      16
 #define FE_DIVBYZERO    8
 #define FE_OVERFLOW     4
@@ -10,6 +14,7 @@
 #define FE_DOWNWARD     2
 #define FE_UPWARD       3
 #define FE_TOWARDZERO   1
+#endif
 
 typedef unsigned int fexcept_t;
 typedef unsigned int fenv_t;
-- 
2.51.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-16 12:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 12:57 [musl] [PATCH] riscv: don't define fenv macros for soft float Alex Rønne Petersen

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).