diff options
author | Manolis Tsamis <manolis.tsamis@vrull.eu> | 2023-02-24 00:04:08 +0100 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@vrull.eu> | 2023-02-24 00:17:58 +0100 |
commit | f6262201d8fd52260c205f7426cb22b18ee06ac7 (patch) | |
tree | e7e44ad7f78ce61aca7b9d439e409af85fa28b49 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | 91610433907ebc335576f0da286f0c8a7793e3a9 (diff) | |
download | llvm-f6262201d8fd52260c205f7426cb22b18ee06ac7.zip llvm-f6262201d8fd52260c205f7426cb22b18ee06ac7.tar.gz llvm-f6262201d8fd52260c205f7426cb22b18ee06ac7.tar.bz2 |
[RISCV] Add vendor-defined XTheadMemIdx (Indexed Memory Operations) extension
The vendor-defined XTHeadMemIdx (no comparable standard extension exists
at the time of writing) extension adds indexed load/store instructions
as well as load/store and update register instructions.
It is supported by the C9xx cores (e.g., found in the wild in the
Allwinner D1) by Alibaba T-Head.
The current (as of this commit) public documentation for this
extension is available at:
https://github.com/T-head-Semi/thead-extension-spec/releases/download/2.2.2/xthead-2023-01-30-2.2.2.pdf
Support for these instructions has already landed in GNU Binutils:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=27cfd142d0a7e378d19aa9a1278e2137f849b71b
Depends on D144002
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D144249
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp index e278edc..807d1e9 100644 --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp +++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp @@ -534,6 +534,13 @@ DecodeStatus RISCVDisassembler::getInstruction(MCInst &MI, uint64_t &Size, if (Result != MCDisassembler::Fail) return Result; } + if (STI.hasFeature(RISCV::FeatureVendorXTHeadMemIdx)) { + LLVM_DEBUG(dbgs() << "Trying XTHeadMemIdx custom opcode table:\n"); + Result = decodeInstruction(DecoderTableTHeadMemIdx32, MI, Insn, Address, + this, STI); + if (Result != MCDisassembler::Fail) + return Result; + } if (STI.hasFeature(RISCV::FeatureVendorXTHeadMemPair)) { LLVM_DEBUG(dbgs() << "Trying XTHeadMemPair custom opcode table:\n"); Result = decodeInstruction(DecoderTableTHeadMemPair32, MI, Insn, Address, |