diff mbox series

RISC-V: Build soft-float divide routines for -mno-fdiv.

Message ID 20191101203549.21397-1-jimw@sifive.com
State New
Headers show
Series RISC-V: Build soft-float divide routines for -mno-fdiv. | expand

Commit Message

Jim Wilson Nov. 1, 2019, 8:35 p.m. UTC
Using -mno-fdiv gives linker errors unless we build the missing divide
routines in libgcc always.  There is at least one university project
designing RISC-V parts without FP divide that wants to use the option.

Tested by hand with single-float and double-float builds to verify that
the -mno-fdiv option works with the patch.  Also tested with rv32-newlib
and rv64-linux cross builds and make check, with no regressions.

Committed.

Jim

	libgcc/
	* config/riscv/t-softfp32 (softfp_extra): Add FP divide routines
---
 libgcc/config/riscv/t-softfp32 | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/libgcc/config/riscv/t-softfp32 b/libgcc/config/riscv/t-softfp32
index 1bd51e803d1..59be1df827e 100644
--- a/libgcc/config/riscv/t-softfp32
+++ b/libgcc/config/riscv/t-softfp32
@@ -12,7 +12,11 @@  softfp_float_modes := tf
 softfp_extensions := sftf dftf
 softfp_truncations := tfsf tfdf
 
+# Enable divide routines to make -mno-fdiv work.
+softfp_extras := divsf3 divdf3
+
 else
+# !ABI_DOUBLE
 
 softfp_float_modes := df tf
 softfp_extensions := sfdf sftf dftf
@@ -20,7 +24,20 @@  softfp_truncations := dfsf tfsf tfdf
 
 ifndef ABI_SINGLE
 softfp_float_modes += sf
+else
+# ABI_SINGLE
+
+# Enable divide routines to make -mno-fdiv work.
+softfp_extras := divsf3
+
 endif
 
 endif
+
+else
+# ABI_QUAD
+
+# Enable divide routines to make -mno-fdiv work.
+softfp_extras := divsf3 divdf3 divtf3
+
 endif