RISC-V: Add T-Head MemIdx vendor extension
authorChristoph Müllner <christoph.muellner@vrull.eu>
Tue, 28 Jun 2022 15:45:14 +0000 (17:45 +0200)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Thu, 22 Sep 2022 16:06:09 +0000 (18:06 +0200)
commit27cfd142d0a7e378d19aa9a1278e2137f849b71b
tree24085d28b88f38be9763c9384c0dfd4029fff548
parentf511f80fa3fcaf6bcbe727fb902b8bd5ec8f9c20
RISC-V: Add T-Head MemIdx vendor extension

T-Head has a range of vendor-specific instructions.
Therefore it makes sense to group them into smaller chunks
in form of vendor extensions.

This patch adds the XTheadMemIdx extension, a collection of T-Head specific
GPR memory access instructions.
The 'th' prefix and the "XTheadMemIdx" extension are documented in a PR
for the RISC-V toolchain conventions ([1]).

In total XTheadCmo introduces the following 44 instructions
(BU,HU,WU only for loads (zero-extend instead of sign-extend)):

* {L,S}{D,W,WU,H,HU,B,BU}{IA,IB} rd, rs1, imm5, imm2
* {L,S}R{D,W,WU,H,HU,B,BU} rd, rs1, rs2, imm2
* {L,S}UR{D,W,WU,H,HU,B,BU} rd, rs1, rs2, imm2

[1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19

Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
bfd/elfxx-riscv.c
gas/doc/c-riscv.texi
gas/testsuite/gas/riscv/x-thead-memidx-fail.d [new file with mode: 0644]
gas/testsuite/gas/riscv/x-thead-memidx-fail.l [new file with mode: 0644]
gas/testsuite/gas/riscv/x-thead-memidx-fail.s [new file with mode: 0644]
gas/testsuite/gas/riscv/x-thead-memidx.d [new file with mode: 0644]
gas/testsuite/gas/riscv/x-thead-memidx.s [new file with mode: 0644]
include/opcode/riscv-opc.h
include/opcode/riscv.h
opcodes/riscv-opc.c