* [musl] [PATCH v2] loongarch64: fix fenv for soft float
@ 2026-01-16 12:58 Alex Rønne Petersen
0 siblings, 0 replies; only message in thread
From: Alex Rønne Petersen @ 2026-01-16 12:58 UTC (permalink / raw)
To: musl; +Cc: Alex Rønne Petersen
See: https://github.com/ziglang/zig/issues/25367
---
arch/loongarch64/bits/fenv.h | 5 +++++
src/fenv/loongarch64/fenv-sf.c | 3 +++
2 files changed, 8 insertions(+)
create mode 100644 src/fenv/loongarch64/fenv-sf.c
diff --git a/arch/loongarch64/bits/fenv.h b/arch/loongarch64/bits/fenv.h
index 264cafb5..6f98053a 100644
--- a/arch/loongarch64/bits/fenv.h
+++ b/arch/loongarch64/bits/fenv.h
@@ -1,3 +1,7 @@
+#ifdef __loongarch_soft_float
+#define FE_ALL_EXCEPT 0
+#define FE_TONEAREST 0
+#else
#define FE_INEXACT 0x010000
#define FE_UNDERFLOW 0x020000
#define FE_OVERFLOW 0x040000
@@ -10,6 +14,7 @@
#define FE_TOWARDZERO 0x100
#define FE_UPWARD 0x200
#define FE_DOWNWARD 0x300
+#endif
typedef unsigned fexcept_t;
diff --git a/src/fenv/loongarch64/fenv-sf.c b/src/fenv/loongarch64/fenv-sf.c
new file mode 100644
index 00000000..41154673
--- /dev/null
+++ b/src/fenv/loongarch64/fenv-sf.c
@@ -0,0 +1,3 @@
+#ifdef __loongarch_soft_float
+#include "../fenv.c"
+#endif
--
2.51.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-16 12:59 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:58 [musl] [PATCH v2] loongarch64: fix fenv 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).