aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2022-11-08 17:11:04 -0500
committerJames Y Knight <jyknight@google.com>2022-12-07 14:37:08 -0500
commit372240dfe3d5a933d9585663e15c4b6173ff23c8 (patch)
treee35f5c344bcf8f3d9ee4696df3e26c5ad6bfe19f /llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
parentb12fe0d429aa369665decd4f32175c63b542a4a1 (diff)
downloadllvm-372240dfe3d5a933d9585663e15c4b6173ff23c8.zip
llvm-372240dfe3d5a933d9585663e15c4b6173ff23c8.tar.gz
llvm-372240dfe3d5a933d9585663e15c4b6173ff23c8.tar.bz2
[TableGen] More named sub-operands work.
Commit a538d1f13a13 first added support for named sub-operands in CodeEmitterGen. We now add a few more features to that, enabling further target cleanups. 1. Adds support for handling an EncoderMethod in a sub-operand in CodeEmitterGen. Previously, the specified encoder of a sub-operand was ignored, and only the default used. 2. Adds support for sub-operands in DecoderEmitter, along with support for tied sub-operands. The changes to the decoder required a few minor tweaks to a few targets, where existing brokeness was exposed. In order to keep this patch small, I left FIXMEs which will be addressed in upcoming patches. (Except MIPS16, since its object file emission/decoding is totally broken). Differential Revision: https://reviews.llvm.org/D137653
Diffstat (limited to 'llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp')
-rw-r--r--llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp b/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
index ef1f623..6a132ed 100644
--- a/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
+++ b/llvm/lib/Target/Sparc/Disassembler/SparcDisassembler.cpp
@@ -306,6 +306,9 @@ static DecodeStatus DecodeSWAP(MCInst &Inst, unsigned insn, uint64_t Address,
const MCDisassembler *Decoder);
static DecodeStatus DecodeTRAP(MCInst &Inst, unsigned insn, uint64_t Address,
const MCDisassembler *Decoder);
+static DecodeStatus DecodeFIXMEInstruction(MCInst &MI, unsigned insn,
+ uint64_t Address,
+ const MCDisassembler *Decoder);
#include "SparcGenDisassemblerTables.inc"
@@ -591,6 +594,15 @@ static DecodeStatus DecodeReturn(MCInst &MI, unsigned insn, uint64_t Address,
return MCDisassembler::Success;
}
+// This instruction does not have a working decoder, and needs to be
+// fixed. This "fixme" function was introduced to keep the backend compiling,
+// while making changes to tablegen code.
+static DecodeStatus DecodeFIXMEInstruction(MCInst &Inst, unsigned Insn,
+ uint64_t Address,
+ const MCDisassembler *Decoder) {
+ return MCDisassembler::Fail;
+}
+
static DecodeStatus DecodeSWAP(MCInst &MI, unsigned insn, uint64_t Address,
const MCDisassembler *Decoder) {