diff options
author | Nelson Chu <nelson.chu@sifive.com> | 2021-09-28 16:47:23 +0800 |
---|---|---|
committer | Nelson Chu <nelson.chu@sifive.com> | 2021-09-28 19:39:12 +0800 |
commit | 69a61890cb94746e5a564776081c3cefa8fca408 (patch) | |
tree | ed6d38097517c5b08a1af465815426a3733fc2e9 /gas | |
parent | 91f2597bd24d171c1337a4629f8237aa47c59082 (diff) | |
download | gdb-69a61890cb94746e5a564776081c3cefa8fca408.zip gdb-69a61890cb94746e5a564776081c3cefa8fca408.tar.gz gdb-69a61890cb94746e5a564776081c3cefa8fca408.tar.bz2 |
RISC-V: Allow to add numbers in the prefixed extension names.
We need to allow adding numbers in the prefixed extension names, since
the zve<32,64><d,f,x> extensions are included in the forzen rvv v1.0 spec
recently. But there are two restrictions as follows,
* The extension name ends with <number>p is invalid, since this may
be confused with extension with <number>.0 version. We report errors
for this case.
Invalid format: [z|h|s|zvm|x][0-9a-z]+[0-9]+p
* The extension name ends with numbers is valid, but the numbers will
be parsed as major version, so try to avoid naming extensions like this.
bfd/
* elfxx-riscv.c (riscv_recognized_prefixed_ext): Renamed from
riscv_valid_prefixed_ext/
(riscv_parsing_subset_version): The extensions end with <number>p
is forbidden, we already report the detailed errors in the
riscv_parse_prefixed_ext, so clean the code and unused parameters.
(riscv_parse_std_ext): Updated.
(riscv_parse_prefixed_ext): Rewrite the parser to allow numbers
in the prefixed extension names.
gas/
* testsuite/gas/riscv/march-fail-invalid-x-01.d: New testcases.
* testsuite/gas/riscv/march-fail-invalid-x-02.d: Likewise.
* testsuite/gas/riscv/march-fail-invalid-z-01.d: Likewise.
* testsuite/gas/riscv/march-fail-invalid-z-02.d: Likewise.
* testsuite/gas/riscv/march-fail-invalid.l: Likewise.
* testsuite/gas/riscv/march-fail-version-x.d: Removed.
* testsuite/gas/riscv/march-fail-version-z.d: Likewise.
* testsuite/gas/riscv/march-fail-version.l: Likewise.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-invalid-x-01.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-invalid-x-02.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-invalid-z-01.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-invalid-z-02.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-invalid.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-version-x.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-version-z.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-version.l | 3 |
8 files changed, 14 insertions, 9 deletions
diff --git a/gas/testsuite/gas/riscv/march-fail-invalid-x-01.d b/gas/testsuite/gas/riscv/march-fail-invalid-x-01.d new file mode 100644 index 0000000..929cfac --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-invalid-x-01.d @@ -0,0 +1,3 @@ +#as: -march=rv32i_zicsr2p0_xargle2p +#source: empty.s +#error_output: march-fail-invalid.l diff --git a/gas/testsuite/gas/riscv/march-fail-invalid-x-02.d b/gas/testsuite/gas/riscv/march-fail-invalid-x-02.d new file mode 100644 index 0000000..d85f16a --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-invalid-x-02.d @@ -0,0 +1,3 @@ +#as: -march=rv32i_zicsr2p0_xargle2p3p0 +#source: empty.s +#error_output: march-fail-invalid.l diff --git a/gas/testsuite/gas/riscv/march-fail-invalid-z-01.d b/gas/testsuite/gas/riscv/march-fail-invalid-z-01.d new file mode 100644 index 0000000..5ecc72a --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-invalid-z-01.d @@ -0,0 +1,3 @@ +#as: -march=rv32i_zicsr2p +#source: empty.s +#error_output: march-fail-invalid.l diff --git a/gas/testsuite/gas/riscv/march-fail-invalid-z-02.d b/gas/testsuite/gas/riscv/march-fail-invalid-z-02.d new file mode 100644 index 0000000..38e8def --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-invalid-z-02.d @@ -0,0 +1,3 @@ +#as: -march=rv32i_zicsr2p4p0 +#source: empty.s +#error_output: march-fail-invalid.l diff --git a/gas/testsuite/gas/riscv/march-fail-invalid.l b/gas/testsuite/gas/riscv/march-fail-invalid.l new file mode 100644 index 0000000..804c361 --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-invalid.l @@ -0,0 +1,2 @@ +.*Assembler messages: +.*Error: .*invalid prefixed ISA extension `[0-9a-z]+' ends with <number>p diff --git a/gas/testsuite/gas/riscv/march-fail-version-x.d b/gas/testsuite/gas/riscv/march-fail-version-x.d deleted file mode 100644 index 8e140e3..0000000 --- a/gas/testsuite/gas/riscv/march-fail-version-x.d +++ /dev/null @@ -1,3 +0,0 @@ -#as: -march=rv32i2p_zicsr2p0_xargle2p -#source: empty.s -#error_output: march-fail-version.l diff --git a/gas/testsuite/gas/riscv/march-fail-version-z.d b/gas/testsuite/gas/riscv/march-fail-version-z.d deleted file mode 100644 index 73ca579..0000000 --- a/gas/testsuite/gas/riscv/march-fail-version-z.d +++ /dev/null @@ -1,3 +0,0 @@ -#as: -march=rv32i2p_zicsr2p -#source: empty.s -#error_output: march-fail-version.l diff --git a/gas/testsuite/gas/riscv/march-fail-version.l b/gas/testsuite/gas/riscv/march-fail-version.l deleted file mode 100644 index c7f8a4d..0000000 --- a/gas/testsuite/gas/riscv/march-fail-version.l +++ /dev/null @@ -1,3 +0,0 @@ -.*Assembler messages: -.*Error: cannot find default versions of the ISA extension `p' -.*Error: .*expect number after `2p' |