riscv: elf-multilib: add rv32iafc to defaults

Message ID 20220815054753.3796727-1-pmarheine@chromium.org
State New, archived
Headers
Series riscv: elf-multilib: add rv32iafc to defaults |

Commit Message

Peter Marheine Aug. 15, 2022, 5:47 a.m. UTC
  rv32iafc-ilp32 is compatible with rv32iac-ilp32 for library
implementation, so add a reuse rule allowing the default configuration
to support rv32iafc.

-IAFC is an unusual configuration (much less common than -IMAFC), but
multilib reuse has essentially no cost: this change is useful to users
of platforms that support hardware floating-point but cannot use
hardware multiply/divide for any reason. To avoid generating a new set
of libraries this is limited to the soft-float ABI.

Tested by verifying that `gcc -march=rv32iafc -mabi=ilp32
--print-search-dirs` refers to the rv32iac/ilp32 library directory as
expected, rather than just the root library directory as occurs when an
unsupported target is selected (for instance, rv32id).

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
---
 gcc/config/riscv/t-elf-multilib | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Peter Marheine Aug. 30, 2022, 12:38 a.m. UTC | #1
Ping; any comments on this?

> rv32iafc-ilp32 is compatible with rv32iac-ilp32 for library
> implementation, so add a reuse rule allowing the default configuration
> to support rv32iafc.
  
Palmer Dabbelt Aug. 30, 2022, 1:37 a.m. UTC | #2
On Mon, 29 Aug 2022 17:38:08 PDT (-0700), gcc-patches@gcc.gnu.org wrote:
> Ping; any comments on this?

It looks fine to me, having an extra reuse pattern is pretty much free.

>
>> rv32iafc-ilp32 is compatible with rv32iac-ilp32 for library
>> implementation, so add a reuse rule allowing the default configuration
>> to support rv32iafc.
  

Patch

diff --git a/gcc/config/riscv/t-elf-multilib b/gcc/config/riscv/t-elf-multilib
index 19f9434616c..6e74b1811be 100644
--- a/gcc/config/riscv/t-elf-multilib
+++ b/gcc/config/riscv/t-elf-multilib
@@ -1,11 +1,12 @@ 
 # This file was generated by multilib-generator with the command:
-#  ./multilib-generator rv32i-ilp32--c rv32im-ilp32--c rv32iac-ilp32-- rv32imac-ilp32-- rv32imafc-ilp32f-rv32imafdc- rv64imac-lp64-- rv64imafdc-lp64d--
-MULTILIB_OPTIONS = march=rv32i/march=rv32ic/march=rv32im/march=rv32imc/march=rv32iac/march=rv32imac/march=rv32imafc/march=rv32imafdc/march=rv32gc/march=rv64imac/march=rv64imafdc/march=rv64gc mabi=ilp32/mabi=ilp32f/mabi=lp64/mabi=lp64d
+#  ./multilib-generator rv32i-ilp32--c rv32im-ilp32--c rv32iac-ilp32--f rv32imac-ilp32-- rv32imafc-ilp32f-rv32imafdc- rv64imac-lp64-- rv64imafdc-lp64d--
+MULTILIB_OPTIONS = march=rv32i/march=rv32ic/march=rv32im/march=rv32imc/march=rv32iac/march=rv32iafc/march=rv32imac/march=rv32imafc/march=rv32imafdc/march=rv32gc/march=rv64imac/march=rv64imafdc/march=rv64gc mabi=ilp32/mabi=ilp32f/mabi=lp64/mabi=lp64d
 MULTILIB_DIRNAMES = rv32i \
 rv32ic \
 rv32im \
 rv32imc \
 rv32iac \
+rv32iafc \
 rv32imac \
 rv32imafc \
 rv32imafdc \
@@ -25,6 +26,7 @@  march=rv64imac/mabi=lp64 \
 march=rv64imafdc/mabi=lp64d
 MULTILIB_REUSE = march.rv32i/mabi.ilp32=march.rv32ic/mabi.ilp32 \
 march.rv32im/mabi.ilp32=march.rv32imc/mabi.ilp32 \
+march.rv32iac/mabi.ilp32=march.rv32iafc/mabi.ilp32 \
 march.rv32imafc/mabi.ilp32f=march.rv32imafdc/mabi.ilp32f \
 march.rv32imafc/mabi.ilp32f=march.rv32gc/mabi.ilp32f \
 march.rv64imafdc/mabi.lp64d=march.rv64gc/mabi.lp64d