aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
diff options
context:
space:
mode:
authorManolis Tsamis <manolis.tsamis@vrull.eu>2023-02-24 00:18:55 +0100
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>2023-02-24 00:35:37 +0100
commit7b79e8d45576e17daca4853deae40119615588b0 (patch)
treef6d417df2ea2ba9a90e902e112fe37610096aae2 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
parenta78805f3cb8dfdf93da759bfee420d89b85f66ef (diff)
downloadllvm-7b79e8d45576e17daca4853deae40119615588b0.zip
llvm-7b79e8d45576e17daca4853deae40119615588b0.tar.gz
llvm-7b79e8d45576e17daca4853deae40119615588b0.tar.bz2
[RISCV] Add vendor-defined XTheadFMemIdx (FP Indexed Memory Operations) extension
The vendor-defined XTHeadFMemIdx (no comparable standard extension exists at the time of writing) extension adds indexed load/store instructions for floating-point registers. 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=f511f80fa3fcaf6bcbe727fb902b8bd5ec8f9c20 Depends on D144249 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D144647
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r--llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp7
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 807d1e9..eccaa9d 100644
--- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
+++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
@@ -527,6 +527,13 @@ DecodeStatus RISCVDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
if (Result != MCDisassembler::Fail)
return Result;
}
+ if (STI.hasFeature(RISCV::FeatureVendorXTHeadFMemIdx)) {
+ LLVM_DEBUG(dbgs() << "Trying XTHeadFMemIdx custom opcode table:\n");
+ Result = decodeInstruction(DecoderTableTHeadFMemIdx32, MI, Insn, Address,
+ this, STI);
+ if (Result != MCDisassembler::Fail)
+ return Result;
+ }
if (STI.hasFeature(RISCV::FeatureVendorXTHeadMac)) {
LLVM_DEBUG(dbgs() << "Trying XTHeadMac custom opcode table:\n");
Result = decodeInstruction(DecoderTableTHeadMac32, MI, Insn, Address,