libm: riscv support

issue #4312
This commit is contained in:
Sebastian Sumpf 2021-12-01 10:04:05 +01:00 committed by Norman Feske
parent 7c976a83e0
commit a4d67c3262
4 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,10 @@
LIBM_LD128 = yes
include $(REP_DIR)/lib/mk/libm.inc
#
# RISC-V specific
#
SRC_C += msun/riscv/fenv.c
vpath msun/riscv/fenv.c $(LIBC_DIR)/lib

View File

@ -175,12 +175,15 @@ fabsl T
fdim T
fdimf T
fdiml T
feclearexcept T
fedisableexcept T
feenableexcept T
fegetenv T
feholdexcept T
feraiseexcept T
fesetexceptflag T
fesetround T
fetestexcept T
feupdateenv T
floor T
floorf T

View File

@ -1 +1 @@
130633868713e5f3e0dac32775bfcb8a1731f6ad
392389f9e1323249c044ba6b7fea6ea3d73100c5

View File

@ -0,0 +1,27 @@
Enable PREC 113 for RISC-V
--- src/lib/libc/lib/libc/riscv/_fpmath.h
+++ src/lib/libc/lib/libc/riscv/_fpmath.h
@@ -46,6 +46,7 @@ union IEEEl2bits {
#define LDBL_IMPLICIT_NBIT
#define mask_nbit_l(u) ((void)0)
+#if 0
#define LDBL_MANH_SIZE 20
#define LDBL_MANL_SIZE 32
@@ -53,12 +54,13 @@ union IEEEl2bits {
(a)[0] = (uint32_t)(u).bits.manl; \
(a)[1] = (uint32_t)(u).bits.manh; \
} while(0)
+#endif
/*
* TODO: Due to compiler problem we are temporary using
* LDBL_PREC == 53. Use code below for LDBL_PREC == 113
*/
-#if 0
+#if 1
#define LDBL_MANH_SIZE 48
#define LDBL_MANL_SIZE 64