From ca07088b26bd3a17e543f8b4176166ce052e5cfd Mon Sep 17 00:00:00 2001 From: Rot127 Date: Mon, 26 Aug 2024 04:51:09 -0500 Subject: [PATCH] Add SystemZ decoder macro. --- llvm/utils/TableGen/PrinterCapstone.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/llvm/utils/TableGen/PrinterCapstone.cpp b/llvm/utils/TableGen/PrinterCapstone.cpp index 172c70cf02e5..94e616b6e4a8 100644 --- a/llvm/utils/TableGen/PrinterCapstone.cpp +++ b/llvm/utils/TableGen/PrinterCapstone.cpp @@ -1080,7 +1080,8 @@ void PrinterCapstone::decoderEmitterEmitDecodeInstruction( << "}\n\n"; std::set InsnBytesAsUint16 = {"ARM"}; - std::set InsnBytesAsUint32 = {"ARM", "PPC", "AArch64", "LoongArch", "Alpha", "Mips"}; + std::set InsnBytesAsUint32 = {"ARM", "AArch64", "LoongArch", "Alpha", "Mips"}; + std::set InsnBytesAsUint64 = {"SystemZ"}; bool MacroDefined = false; if (InsnBytesAsUint16.find(TargetName) != InsnBytesAsUint16.end()) { OS << "FieldFromInstruction(fieldFromInstruction_2, uint16_t)\n" @@ -1096,6 +1097,13 @@ void PrinterCapstone::decoderEmitterEmitDecodeInstruction( "decodeToMCInst_4, uint32_t)\n"; MacroDefined = true; } + if (InsnBytesAsUint64.find(TargetName) != InsnBytesAsUint64.end()) { + OS << "FieldFromInstruction(fieldFromInstruction_8, uint64_t)\n" + << "DecodeToMCInst(decodeToMCInst_8, fieldFromInstruction_8, uint64_t)\n" + << "DecodeInstruction(decodeInstruction_8, fieldFromInstruction_8, " + "decodeToMCInst_4, uint64_t)\n"; + MacroDefined = true; + } // Special case: The LLVM disassembler uses uint64_t values for decoding. // Although PPC instructions are 4 bytes wide.