aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2023-05-05 10:08:43 -0700
committerCraig Topper <craig.topper@sifive.com>2023-05-05 10:08:43 -0700
commit7b3b178c825bfcf196685311bf33e4a5fa8ca8aa (patch)
tree9fcc84cba751280deea8228eae91dc6844c357b9 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
parentf9dba933c6de4083a1d68f649326982be8af0672 (diff)
downloadllvm-7b3b178c825bfcf196685311bf33e4a5fa8ca8aa.zip
llvm-7b3b178c825bfcf196685311bf33e4a5fa8ca8aa.tar.gz
llvm-7b3b178c825bfcf196685311bf33e4a5fa8ca8aa.tar.bz2
[RISCV] Add DecoderNamespace to Zcmt instructions.
The Zcmt instructions overlap encoding space with some C extension instructions. Isolate to a separate namespace. Reviewed By: VincentWu Differential Revision: https://reviews.llvm.org/D149891
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r--llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
index 7c7aad05..b5fc59e 100644
--- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
+++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
@@ -604,6 +604,14 @@ DecodeStatus RISCVDisassembler::getInstruction(MCInst &MI, uint64_t &Size,
if (Result != MCDisassembler::Fail)
return Result;
}
+ if (STI.hasFeature(RISCV::FeatureStdExtZcmt)) {
+ LLVM_DEBUG(
+ dbgs() << "Trying Zcmt table (16-bit Table Jump Instructions):\n");
+ Result = decodeInstruction(DecoderTableRVZcmt16, MI, Insn, Address,
+ this, STI);
+ if (Result != MCDisassembler::Fail)
+ return Result;
+ }
LLVM_DEBUG(dbgs() << "Trying RISCV_C table (16-bit Instruction):\n");
// Calling the auto-generated decoder function.