diff --git a/repos/libports/lib/mk/spec/riscv/libm.mk b/repos/libports/lib/mk/spec/riscv/libm.mk new file mode 100644 index 0000000000..1455baa609 --- /dev/null +++ b/repos/libports/lib/mk/spec/riscv/libm.mk @@ -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 diff --git a/repos/libports/lib/symbols/libm b/repos/libports/lib/symbols/libm index 0943ecb217..b42a23df34 100644 --- a/repos/libports/lib/symbols/libm +++ b/repos/libports/lib/symbols/libm @@ -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 diff --git a/repos/libports/ports/libc.hash b/repos/libports/ports/libc.hash index bceb2ae93e..d3b2511e5a 100644 --- a/repos/libports/ports/libc.hash +++ b/repos/libports/ports/libc.hash @@ -1 +1 @@ -130633868713e5f3e0dac32775bfcb8a1731f6ad +392389f9e1323249c044ba6b7fea6ea3d73100c5 diff --git a/repos/libports/src/lib/libc/patches/fpmath_riscv.patch b/repos/libports/src/lib/libc/patches/fpmath_riscv.patch new file mode 100644 index 0000000000..aac94fea1d --- /dev/null +++ b/repos/libports/src/lib/libc/patches/fpmath_riscv.patch @@ -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 +