RISC-V: Handle implied extension for -march parser.
authorKito Cheng <kito.cheng@sifive.com>
Fri, 10 Apr 2020 09:20:19 +0000 (17:20 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 19 May 2020 06:31:58 +0000 (14:31 +0800)
commitf908b69cfd71b85a602424e9fea882108e02cb8a
tree606cae2c4bff55c2eb092bdccfd1ab1d3e38601a
parentca1a9763a1f635d2687ebd5009dd61d4fd0ab5fb
RISC-V: Handle implied extension for -march parser.

  - Implied rule are introduced into latest RISC-V ISA spec.

  - Only implemented D implied F-extension. Zicsr and Zifence are not
    implement yet, so the rule not included in this patch.

  - Pass preprocessed arch string to arch.

  - Verified with binutils 2.30 and 2.34.

gcc/ChangeLog

* common/config/riscv/riscv-common.c (riscv_implied_info_t): New.
(riscv_implied_info): New.
(riscv_subset_list): Add handle_implied_ext.
(riscv_subset_list::to_string): New parameter version_p to
control output format.
(riscv_subset_list::handle_implied_ext): New.
(riscv_subset_list::parse_std_ext): Call handle_implied_ext.
(riscv_arch_str): New parameter version_p to control output format.
(riscv_expand_arch): New.
* config/riscv/riscv-protos.h (riscv_arch_str): New parameter,
version_p.
* config/riscv/riscv.h (riscv_expand_arch): New,
(EXTRA_SPEC_FUNCTIONS): Define.
(ASM_SPEC): Transform -march= via riscv_expand_arch.

gcc/testsuite/ChangeLog

* gcc.target/riscv/arch-6.c: New.
* gcc.target/riscv/attribute-11.c: New.
* gcc.target/riscv/attribute-12.c: New.
gcc/ChangeLog
gcc/common/config/riscv/riscv-common.c
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/arch-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/attribute-11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/attribute-12.c [new file with mode: 0644]