diff options
author | Nelson Chu <nelson@rivosinc.com> | 2022-12-21 11:22:06 +0800 |
---|---|---|
committer | Nelson Chu <nelson@rivosinc.com> | 2022-12-23 10:00:37 +0800 |
commit | fa6f3b911fedef433c92b65798638c04ad7556d1 (patch) | |
tree | 9815b2f38241dbbe3b758ed47f151e329dbb4cfa /gas | |
parent | 11e25f766e533b77538b2618b4ef3e2bc2fb5780 (diff) | |
download | fsf-binutils-gdb-fa6f3b911fedef433c92b65798638c04ad7556d1.zip fsf-binutils-gdb-fa6f3b911fedef433c92b65798638c04ad7556d1.tar.gz fsf-binutils-gdb-fa6f3b911fedef433c92b65798638c04ad7556d1.tar.bz2 |
RISC-V: Relax the order checking for the architecture string
* riscv-toolchain-conventions,
PR, https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14
Issue, https://github.com/riscv-non-isa/riscv-toolchain-conventions/issues/11
* Refer to the commit afc41ffb,
RISC-V: Reorder the prefixed extensions which are out of order.
In the past we only allow to reorder the prefixed extensions. But according
to the PR 14 in the riscv-toolchain-convention, we can also relax the order
checking to allow the whole extensions be written out of orders, including
the single standard extensions and the prefixed multi-letter extensions.
Just that we still need to follow the following rules as usual,
1. prefixed extensions need to be seperated with `_'.
2. prefixed extensions need complete <major>.<minor> version if set.
Please see the details in the march-ok-reorder gas testcase.
Passed the riscv-gnu-toolchain regressions.
bfd/
* elfxx-riscv.c (enum riscv_prefix_ext_class): Changed RV_ISA_CLASS_UNKNOWN
to RV_ISA_CLASS_SINGLE, since everything that does not belong to the
multi-keyword will possible be a single extension for the current parser.
(parse_config): Likewise.
(riscv_get_prefix_class): Likewise.
(riscv_compare_subsets): Likewise.
(riscv_parse_std_ext): Removed, and merged with riscv_parse_prefixed_ext
into riscv_parse_extensions.
(riscv_parse_prefixed_ext): Likewise.
(riscv_parse_subset): Only need to call riscv_parse_extensions to parse
both single standard and prefixed extensions.
gas/
* testsuite/gas/riscv/march-fail-order-std.d: Removed since the relaxed
order checking.
* testsuite/gas/riscv/march-fail-order-std.l: Likewise.
* testsuite/gas/riscv/march-fail-order-x-std.d: Likewise.
* testsuite/gas/riscv/march-fail-order-z-std.d: Likewise.
* testsuite/gas/riscv/march-fail-order-zx-std.l: Likewise.
* testsuite/gas/riscv/march-fail-unknown-std.l: Updated.
* testsuite/gas/riscv/march-ok-reorder.d: New testcase.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-order-std.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-order-std.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-order-x-std.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-order-z-std.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-order-zx-std.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-fail-unknown-std.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/march-ok-reorder.d | 7 |
7 files changed, 8 insertions, 14 deletions
diff --git a/gas/testsuite/gas/riscv/march-fail-order-std.d b/gas/testsuite/gas/riscv/march-fail-order-std.d deleted file mode 100644 index b9c7e09..0000000 --- a/gas/testsuite/gas/riscv/march-fail-order-std.d +++ /dev/null @@ -1,3 +0,0 @@ -#as: -march=rv32iamfd -#source: empty.s -#error_output: march-fail-order-std.l diff --git a/gas/testsuite/gas/riscv/march-fail-order-std.l b/gas/testsuite/gas/riscv/march-fail-order-std.l deleted file mode 100644 index 9e3ce5e..0000000 --- a/gas/testsuite/gas/riscv/march-fail-order-std.l +++ /dev/null @@ -1,2 +0,0 @@ -.*Assembler messages: -.*Error: .*standard ISA extension `m' is not in canonical order diff --git a/gas/testsuite/gas/riscv/march-fail-order-x-std.d b/gas/testsuite/gas/riscv/march-fail-order-x-std.d deleted file mode 100644 index 4762f3d..0000000 --- a/gas/testsuite/gas/riscv/march-fail-order-x-std.d +++ /dev/null @@ -1,3 +0,0 @@ -#as: -march=rv32i_xargle2p0_mafd -#source: empty.s -#error_output: march-fail-order-zx-std.l diff --git a/gas/testsuite/gas/riscv/march-fail-order-z-std.d b/gas/testsuite/gas/riscv/march-fail-order-z-std.d deleted file mode 100644 index 42526de..0000000 --- a/gas/testsuite/gas/riscv/march-fail-order-z-std.d +++ /dev/null @@ -1,3 +0,0 @@ -#as: -march=rv32i_zicsr2p0_mafd -#source: empty.s -#error_output: march-fail-order-zx-std.l diff --git a/gas/testsuite/gas/riscv/march-fail-order-zx-std.l b/gas/testsuite/gas/riscv/march-fail-order-zx-std.l deleted file mode 100644 index 4f6b98c..0000000 --- a/gas/testsuite/gas/riscv/march-fail-order-zx-std.l +++ /dev/null @@ -1,2 +0,0 @@ -.*Assembler messages: -.*Error: .*unknown prefix class for the ISA extension `mafd' diff --git a/gas/testsuite/gas/riscv/march-fail-unknown-std.l b/gas/testsuite/gas/riscv/march-fail-unknown-std.l index 834a485..1de7a42 100644 --- a/gas/testsuite/gas/riscv/march-fail-unknown-std.l +++ b/gas/testsuite/gas/riscv/march-fail-unknown-std.l @@ -1,2 +1,2 @@ .*Assembler messages: -.*Error: .*unknown standard ISA extension `y' +.*Error: .*unknown standard ISA extension or prefix class `y' diff --git a/gas/testsuite/gas/riscv/march-ok-reorder.d b/gas/testsuite/gas/riscv/march-ok-reorder.d new file mode 100644 index 0000000..030f8b1 --- /dev/null +++ b/gas/testsuite/gas/riscv/march-ok-reorder.d @@ -0,0 +1,7 @@ +#as: -misa-spec=20191213 -march=rv32i2azicsr_fc2p0dxfoo2p0_m1_xbar2p0_zba +#source: empty.s +#readelf: -A + +Attribute Section: riscv +File Attributes + Tag_RISCV_arch: "rv32i2p0_m1p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zba1p0_xbar2p0_xfoo2p0" |