]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Relax the -march string for accept any order
authorKito Cheng <kito.cheng@sifive.com>
Fri, 5 Jan 2024 14:08:34 +0000 (22:08 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Fri, 19 Jan 2024 07:19:39 +0000 (15:19 +0800)
commit006ad3e7f7847eb53c837aa1a581af0f822b7616
treebe5880d33549c426cb57a0ee47e0318990a7b196
parent4e8fef35f7c4553529e92a0d9f501b94481ede0b
RISC-V: Relax the -march string for accept any order

-march was require canonical order before, however it's not easy for
most user when we have so many extension, so this patch is relax the
constraint, -march accept the ISA string in any order, it only has few
requirement:

1. Must start with rv[32|64][e|i|g].
2. Multi-letter and single letter extension must be separated by
   at least one underscore(`_`).

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc
(riscv_subset_list::parse_single_std_ext): New parameter.
(riscv_subset_list::parse_single_multiletter_ext): Ditto.
(riscv_subset_list::parse_single_ext): Ditto.
(riscv_subset_list::parse): Relax the order for the input of ISA
string.
* config/riscv/riscv-subset.h
(riscv_subset_list::parse_single_std_ext): New parameter.
(riscv_subset_list::parse_single_multiletter_ext): Ditto.
(riscv_subset_list::parse_single_ext): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/arch-33.c: New.
* gcc.target/riscv/arch-34.c: New.
gcc/common/config/riscv/riscv-common.cc
gcc/config/riscv/riscv-subset.h
gcc/testsuite/gcc.target/riscv/arch-33.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/arch-34.c [new file with mode: 0644]