Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InsnBytesAsUint24 and add Xtensa to InsnBytesAsUint24 #61

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading