commit 081888286bcee495c4b9c3a9e45db6485c6bd367 (tree)
parent 171b1046408bca46508ed205ff4f9a3ee4c95d80
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Fri, 16 Jan 2026 13:29:34 +0100
musl: patch riscv bits/fenv.h for soft float
Diffstat:
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/libc/include/riscv32-linux-musl/bits/fenv.h b/lib/libc/include/riscv32-linux-musl/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,8 +14,9 @@
#define FE_DOWNWARD 2
#define FE_UPWARD 3
#define FE_TOWARDZERO 1
+#endif
typedef unsigned int fexcept_t;
typedef unsigned int fenv_t;
-#define FE_DFL_ENV ((const fenv_t *) -1)
-\ No newline at end of file
+#define FE_DFL_ENV ((const fenv_t *) -1)
diff --git a/lib/libc/include/riscv64-linux-musl/bits/fenv.h b/lib/libc/include/riscv64-linux-musl/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,8 +14,9 @@
#define FE_DOWNWARD 2
#define FE_UPWARD 3
#define FE_TOWARDZERO 1
+#endif
typedef unsigned int fexcept_t;
typedef unsigned int fenv_t;
-#define FE_DFL_ENV ((const fenv_t *) -1)
-\ No newline at end of file
+#define FE_DFL_ENV ((const fenv_t *) -1)