RISC-V: Use single h extension to control hypervisor CSRs and instructions.
authorNelson Chu <nelson.chu@sifive.com>
Wed, 22 Jun 2022 09:03:16 +0000 (17:03 +0800)
committerNelson Chu <nelson.chu@sifive.com>
Wed, 22 Jun 2022 10:13:37 +0000 (18:13 +0800)
commitc625f4ed05eb234d6a182201d14b3b1c64232afd
treefcf54d39b5153b02b4145cb22fc62ab53e796237
parent1176bc3876fdec6a700079ef216940f42a57f18a
RISC-V: Use single h extension to control hypervisor CSRs and instructions.

According to the picture 28.1 in the current ISA spec, h is no larger the
multi-letter extension, it is a single extension after v.  Therefore, this
patch fix the implementation, and use the single h to control hypervisor
CSRs and instructions, which we promised to do before.

bfd/
    * elfxx-riscv.c (riscv_supported_std_ext): Added h with version 1.0 after v.
    (riscv_supported_std_h_ext): Removed.
    (riscv_all_supported_ext): Updated since riscv_supported_std_h_ext is removed.
    (riscv_prefix_ext_class): Removed RV_ISA_CLASS_H.
    (parse_config): Updated since riscv_prefix_ext_class is removed.
    (riscv_recognized_prefixed_ext): Likewise.
    (riscv_get_default_ext_version): Likewise.
    (riscv_multi_subset_supports): Handle INSN_CLASS_H for hypervisor instructions.
    (riscv_multi_subset_supports_ext): Likewise.
gas/
    * config/tc-riscv.c (riscv_csr_class): Added CSR_CLASS_H and CSR_CLASS_H_32 for
    hypervisor CSRs.
    (riscv_csr_address): Likewise.
    * testsuite/gas/riscv/csr-version-1p10.d: Updated since hypervisor CSRs are
    controlled by single h extension for now.
    * testsuite/gas/riscv/csr-version-1p10.l: Likewise.
    * testsuite/gas/riscv/csr-version-1p11.d: Likewise.
    * testsuite/gas/riscv/csr-version-1p11.l: Likewise.
    * testsuite/gas/riscv/csr-version-1p12.d: Likewise.
    * testsuite/gas/riscv/csr-version-1p12.l: Likewise.
    * testsuite/gas/riscv/csr-version-1p9p1.d: Likewise.
    * testsuite/gas/riscv/csr-version-1p9p1.l: Likewise.
    * testsuite/gas/riscv/h-ext-32.d: Added h to architecture string.
    * testsuite/gas/riscv/h-ext-64.d: Likewise.
    * testsuite/gas/riscv/march-fail-single-prefix-h: Removed since h is no
    longer multi-letter extension.
    * testsuite/gas/riscv/march-fail-unknown-h.d: Likewise.
include/
    * opcode/riscv-opc.h: Control hypervisor CSRs by h extension, rather than
    the privileged spec verisons.
    * opcode/riscv.h (riscv_insn_class): Added INSN_CLASS_H.
opcodes/
    * riscv-opc.c (riscv_opcodes): Control hypervisor instructions by h extension.
16 files changed:
bfd/elfxx-riscv.c
gas/config/tc-riscv.c
gas/testsuite/gas/riscv/csr-version-1p10.d
gas/testsuite/gas/riscv/csr-version-1p10.l
gas/testsuite/gas/riscv/csr-version-1p11.d
gas/testsuite/gas/riscv/csr-version-1p11.l
gas/testsuite/gas/riscv/csr-version-1p12.l
gas/testsuite/gas/riscv/csr-version-1p9p1.d
gas/testsuite/gas/riscv/csr-version-1p9p1.l
gas/testsuite/gas/riscv/h-ext-32.d
gas/testsuite/gas/riscv/h-ext-64.d
gas/testsuite/gas/riscv/march-fail-single-prefix-h.d [deleted file]
gas/testsuite/gas/riscv/march-fail-unknown-h.d [deleted file]
include/opcode/riscv-opc.h
include/opcode/riscv.h
opcodes/riscv-opc.c