diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 8e6a1eee00..78a80e80a2 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -757,6 +757,16 @@ bool PPCAnalyzer::IsBusyWaitLoop(CodeBlock* block, CodeOp* code, size_t instruct return false; } +static bool CanCauseGatherPipeInterruptCheck(const CodeOp& op) +{ + // eieio + if (op.inst.OPCD == 31 && op.inst.SUBOP10 == 854) + return true; + + return op.opinfo->type == OpType::Store || op.opinfo->type == OpType::StoreFP || + op.opinfo->type == OpType::StorePS; +} + u32 PPCAnalyzer::Analyze(u32 address, CodeBlock* block, CodeBuffer* buffer, std::size_t block_size) const { @@ -952,6 +962,14 @@ u32 PPCAnalyzer::Analyze(u32 address, CodeBlock* block, CodeBuffer* buffer, { CodeOp& op = code[i]; + if (CanCauseGatherPipeInterruptCheck(op)) + { + // If we're doing a gather pipe interrupt check after this instruction, we need to + // be able to flush all registers, so we can't have any discarded registers. + gprDiscardable = BitSet32{}; + fprDiscardable = BitSet32{}; + } + const BitSet8 opWantsCR = op.wantsCR; const bool opWantsFPRF = op.wantsFPRF; const bool opWantsCA = op.wantsCA;