From e737070f4827368b49879695bf375d9885e9a2b7 Mon Sep 17 00:00:00 2001 From: Peter Goodman Date: Mon, 11 Oct 2021 09:51:40 -0400 Subject: [PATCH] Mark some instructions as NOPs (#553) --- lib/Arch/AArch32/Decode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Arch/AArch32/Decode.cpp b/lib/Arch/AArch32/Decode.cpp index a687f8206..afadb3316 100644 --- a/lib/Arch/AArch32/Decode.cpp +++ b/lib/Arch/AArch32/Decode.cpp @@ -2410,13 +2410,18 @@ static bool TryMoveSpecialRegisterAndHintsI(Instruction &inst, uint32_t bits) { return false; } + if (strstr(instruction, "NOP") || strstr(instruction, "HINT")) { + inst.category = Instruction::kCategoryNoOp; + } else { + inst.category = Instruction::kCategoryNormal; + } + // A NOP is still conditional: // if ConditionPassed() then // EncodingSpecificOperations(); // // Do nothing inst.function = instruction; DecodeCondition(inst, enc.cond); - inst.category = Instruction::kCategoryNormal; return true; }