Skip to content

Commit

Permalink
Add InsnBytesAsUint24 and add Xtensa to InsnBytesAsUint24
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow authored and Rot127 committed Sep 27, 2024
1 parent 2361b73 commit c0bc1e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions llvm/utils/TableGen/PrinterCapstone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ void PrinterCapstone::decoderEmitterEmitDecodeInstruction(
<< "}\n\n";

std::set<std::string> InsnBytesAsUint16 = {"ARM"};
std::set<std::string> InsnBytesAsUint24 = {"Xtensa"};
std::set<std::string> InsnBytesAsUint32 = {"ARM", "AArch64", "LoongArch", "Alpha", "Mips"};
std::set<std::string> InsnBytesAsUint64 = {"SystemZ"};
bool MacroDefined = false;
Expand All @@ -1090,6 +1091,13 @@ void PrinterCapstone::decoderEmitterEmitDecodeInstruction(
"decodeToMCInst_2, uint16_t)\n\n";
MacroDefined = true;
}
if (InsnBytesAsUint24.find(TargetName) != InsnBytesAsUint24.end()) {
OS << "FieldFromInstruction(fieldFromInstruction_3, uint32_t)\n"
<< "DecodeToMCInst(decodeToMCInst_3, fieldFromInstruction_3, uint32_t)\n"
<< "DecodeInstruction(decodeInstruction_3, fieldFromInstruction_3, "
"decodeToMCInst_3, uint32_t)\n\n";
MacroDefined = true;
}
if (InsnBytesAsUint32.find(TargetName) != InsnBytesAsUint32.end()) {
OS << "FieldFromInstruction(fieldFromInstruction_4, uint32_t)\n"
<< "DecodeToMCInst(decodeToMCInst_4, fieldFromInstruction_4, uint32_t)\n"
Expand Down

0 comments on commit c0bc1e2

Please sign in to comment.