From 2204a789e4238b5ee0802866b4de7be963f43d19 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Sun, 14 Jun 2026 00:10:09 +0200 Subject: [PATCH] PPCAnalyst: In `IsBusyWaitLoop`, ignore `nop` Found out when attempting to make a speed hack to help Dolphin detect an idle loop. The inserted `nop` was preventing it from considering it an idle loop. --- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 40b974b0d8..bb978213ee 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -757,6 +757,12 @@ bool PPCAnalyzer::IsBusyWaitLoop(CodeBlock* block, CodeOp* code, size_t instruct if (code[i].branchTo == block->m_address && i == instructions) return true; } + // A `nop` is actually a `ori r0, r0, 0`, which would violate the rules (unless `r0` was written + // earlier). + else if (code[i].inst.hex == 0x60000000) + { + continue; + } else if (code[i].opinfo->type != OpType::Integer && code[i].opinfo->type != OpType::Load) { // In the future, some subsets of other instruction types might get