Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260116125841.159839-2-alex@alexrp.com>
Date: Fri, 16 Jan 2026 13:58:42 +0100
From: Alex Rønne Petersen <alex@...xrp.com>
To: musl@...ts.openwall.com
Cc: Alex Rønne Petersen <alex@...xrp.com>
Subject: [PATCH v2] loongarch64: fix fenv for soft float

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.