RISC-V: Add support for the 'Zihintntl' extension
authorTsukasa OI <research_trasio@irq.a4lg.com>
Mon, 24 Jul 2023 02:45:29 +0000 (02:45 +0000)
committerTsukasa OI <research_trasio@irq.a4lg.com>
Tue, 15 Aug 2023 06:45:26 +0000 (06:45 +0000)
commit2266f8631806ec65a9a9ff8a7c68a56c83eae81d
tree99f645bb913d2f6441d0833b19316c78aa660710
parent02a63525ef02bac47fa750e89db0996bc96697d3
RISC-V: Add support for the 'Zihintntl' extension

This commit adds 'Zihintntl' extension and its hint instructions.

This is based on:
<https://github.com/riscv/riscv-isa-manual/commit/0dc91f505e6da7791d5a733c553e6e2506ddcab5>,
the first ISA Manual noting that the 'Zihintntl' extension is ratified.

Note that compressed 'Zihintntl' hints require either 'C' or
'Zca' extension.

Co-authored-by: Nelson Chu <nelson@rivosinc.com>
bfd/ChangeLog:

* elfxx-riscv.c (riscv_supported_std_z_ext): Add 'Zihintntl'
standard hint 'Z' extension.
(riscv_multi_subset_supports): Support new instruction classes.
(riscv_multi_subset_supports_ext): Likewise.

gas/ChangeLog:

* testsuite/gas/riscv/zihintntl.s: New test for 'Zihintntl'
including auto-compression without C prefix and explicit C prefix.
* testsuite/gas/riscv/zihintntl.d: Likewise.
* testsuite/gas/riscv/zihintntl-na.d: Likewise.
* testsuite/gas/riscv/zihintntl-base.s: New test for correspondence
between 'Zihintntl' and base 'I' or 'C' instructions.
* testsuite/gas/riscv/zihintntl-base.d: Likewise.

include/ChangeLog:

* opcode/riscv.h (enum riscv_insn_class): Add new instruction
classes: INSN_CLASS_ZIHINTNTL and INSN_CLASS_ZIHINTNTL_AND_C.
(MASK_NTL_P1, MATCH_NTL_P1, MASK_NTL_PALL,
MATCH_NTL_PALL, MASK_NTL_S1, MATCH_NTL_S1, MASK_NTL_ALL,
MATCH_NTL_ALL, MASK_C_NTL_P1, MATCH_C_NTL_P1, MASK_C_NTL_PALL,
MATCH_C_NTL_PALL, MASK_C_NTL_S1, MATCH_C_NTL_S1, MASK_C_NTL_ALL,
MATCH_C_NTL_ALL): New.

opcodes/ChangeLog:

* riscv-opc.c (riscv_opcodes): Add instructions from the
'Zihintntl' extension.
bfd/elfxx-riscv.c
gas/testsuite/gas/riscv/zihintntl-base.d [new file with mode: 0644]
gas/testsuite/gas/riscv/zihintntl-base.s [new file with mode: 0644]
gas/testsuite/gas/riscv/zihintntl-na.d [new file with mode: 0644]
gas/testsuite/gas/riscv/zihintntl.d [new file with mode: 0644]
gas/testsuite/gas/riscv/zihintntl.s [new file with mode: 0644]
include/opcode/riscv-opc.h
include/opcode/riscv.h
opcodes/riscv-opc.c