aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorKito Cheng <kito.cheng@sifive.com>2024-01-05 22:08:34 +0800
committerKito Cheng <kito.cheng@sifive.com>2024-01-19 15:19:39 +0800
commit006ad3e7f7847eb53c837aa1a581af0f822b7616 (patch)
treebe5880d33549c426cb57a0ee47e0318990a7b196 /gcc/config
parent4e8fef35f7c4553529e92a0d9f501b94481ede0b (diff)
downloadgcc-006ad3e7f7847eb53c837aa1a581af0f822b7616.zip
gcc-006ad3e7f7847eb53c837aa1a581af0f822b7616.tar.gz
gcc-006ad3e7f7847eb53c837aa1a581af0f822b7616.tar.bz2
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.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/riscv/riscv-subset.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/config/riscv/riscv-subset.h b/gcc/config/riscv/riscv-subset.h
index c8117d8..a80f913 100644
--- a/gcc/config/riscv/riscv-subset.h
+++ b/gcc/config/riscv/riscv-subset.h
@@ -71,12 +71,12 @@ private:
const char *parse_std_ext (const char *);
- const char *parse_single_std_ext (const char *);
+ const char *parse_single_std_ext (const char *, bool);
const char *parse_multiletter_ext (const char *, const char *,
const char *);
const char *parse_single_multiletter_ext (const char *, const char *,
- const char *);
+ const char *, bool);
void handle_implied_ext (const char *);
bool check_implied_ext ();
@@ -101,7 +101,7 @@ public:
riscv_subset_list *clone () const;
static riscv_subset_list *parse (const char *, location_t);
- const char *parse_single_ext (const char *);
+ const char *parse_single_ext (const char *, bool exact_single_p = true);
const riscv_subset_t *begin () const {return m_head;};
const riscv_subset_t *end () const {return NULL;};