RISC-V: Generalize -march support, add ELF attribute support

Programming / Compilers / GCC - wilson [138bc75d-0d04-0410-961f-82ee72b054a4] - 2 March 2019 00:36 EST

Kito Cheng Monk Chiang

gcc/
- common/config/riscv/riscv-common.c: Include sstream. (riscv_subset_list::to_string): New. (riscv_arch_str): Likewise.
- config.gcc (riscv*-*-*): Handle --with-riscv-attribute=
- config.in: Regen.
- config/riscv/riscv-protos.h (riscv_arch_str): New.
- config/riscv/riscv.c (INCLUDE_STRING): Defined. (riscv_emit_attribute): New. (riscv_file_start): Emit attribute if needed. (riscv_option_override): Init riscv_emit_attribute_p.
- config/riscv/riscv.opt (mriscv-attribute): New option.
- configure.ac (riscv*-*-*): Check binutils is supporting ELF
- configure: Regen.
- doc/install.texi: Document --with-riscv-attribute.
- doc/invoke.texi: Document -mriscv-attribute.

- common/config/riscv/riscv-common.c: Include config/riscv/riscv-protos.h. (INCLUDE_STRING): Defined. (RISCV_DONT_CARE_VERSION): Defined. (riscv_subset_t): Declare. (riscv_subset_t::riscv_subset_t): New. (riscv_subset_list): Declare. (riscv_subset_list::riscv_subset_list): New. (riscv_subset_list::~riscv_subset_list): Likewise. (riscv_subset_list::parsing_subset_version): Likewise. (riscv_subset_list::parse_std_ext): Likewise. (riscv_subset_list::parse_sv_or_non_std_ext): Likewise. (riscv_subset_list::add): Likewise. (riscv_subset_list::lookup): Likewise. (riscv_subset_list::xlen): Likewise. (riscv_subset_list::parse): Likewise. (riscv_supported_std_ext): Likewise. (current_subset_list): Likewise. (riscv_parse_arch_string): Using riscv_subset_list::parse to parse.

gcc/testsuite/
- gcc.target/riscv/attribute-1.c: New.
- gcc.target/riscv/attribute-2.c: Likewise.
- gcc.target/riscv/attribute-3.c: Likewise.
- gcc.target/riscv/attribute-4.c: Likewise.
- gcc.target/riscv/attribute-5.c: Likewise.
- gcc.target/riscv/attribute-6.c: Likewise.
- gcc.target/riscv/attribute-7.c: Likewise.
- gcc.target/riscv/attribute-8.c: Likewise.
- gcc.target/riscv/attribute-9.c: Likewise.

- gcc.target/riscv/arch-1.c: New.
- gcc.target/riscv/arch-2.c: Likewise.
- gcc.target/riscv/arch-3.c: Likewise.
- gcc.target/riscv/arch-4.c: Likewise.

93b27baab53 RISC-V: Generalize -march support, add ELF attribute support.
gcc/ChangeLog | 40 ++
gcc/common/config/riscv/riscv-common.c | 563 ++++++++++++++++++++++++---
gcc/config.gcc | 26 +-
gcc/config.in | 6 +
gcc/config/riscv/riscv-protos.h | 3 +
gcc/config/riscv/riscv.c | 29 ++
gcc/config/riscv/riscv.opt | 4 +
gcc/configure | 37 ++
gcc/configure.ac | 7 +
gcc/doc/install.texi | 7 +
gcc/doc/invoke.texi | 7 +-
gcc/testsuite/ChangeLog | 18 +
gcc/testsuite/gcc.target/riscv/arch-1.c | 6 +
gcc/testsuite/gcc.target/riscv/arch-2.c | 5 +
gcc/testsuite/gcc.target/riscv/arch-3.c | 5 +
gcc/testsuite/gcc.target/riscv/arch-4.c | 5 +
gcc/testsuite/gcc.target/riscv/attribute-1.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-2.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-3.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-4.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-5.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-6.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-7.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-8.c | 6 +
gcc/testsuite/gcc.target/riscv/attribute-9.c | 6 +
25 files changed, 763 insertions(+), 59 deletions(-)

Upstream: gcc.gnu.org


  • Share