]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Add stub support for existing extensions (vendor)
authorTsukasa OI <research_trasio@irq.a4lg.com>
Sat, 12 Aug 2023 00:38:18 +0000 (00:38 +0000)
committerTsukasa OI <research_trasio@irq.a4lg.com>
Tue, 29 Aug 2023 13:48:19 +0000 (13:48 +0000)
commitfea5442127daf8472966360279d402023dba3379
tree410d276457bb331fcff3f6e9ffc6e1b7b25dd153
parent4053d295fdd81d3e05c4977e3cd9c647e8cc6bc2
RISC-V: Add stub support for existing extensions (vendor)

After commit c283c4774d1c ("RISC-V: Throw compilation error for unknown
extensions") changed how do we handle unknown extensions, we have no
guarantee that we can share the same architectural string with Binutils
(specifically, the assembler).

To avoid compilation errors on shared Assembler-C/C++ projects or programs
with inline assembler, GCC should support almost all extensions that
Binutils support, even if the GCC itself does not touch a thing.

This commit adds stub supported vendor extensions to
riscv_ext_version_table (no riscv_implied_info entries to add; all
information is copied from Binutils' bfd/elfxx-riscv.c).

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_ext_version_table):
Add stub support for all vendor extensions supported by Binutils.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/predef-30.c: New test for a stub
vendor extension 'XVentanaCondOps'.
gcc/common/config/riscv/riscv-common.cc
gcc/testsuite/gcc.target/riscv/predef-30.c [new file with mode: 0644]