From a499e21453e9a3df85730d971f4e64e71f9f11b0 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 15 Dec 2023 13:46:46 +1000 Subject: [PATCH] CPU/CodeCache: Don't try to compile direct double branches Invalidation nightmare. --- src/core/cpu_code_cache.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index d5eac4954..285e40eb5 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -973,9 +973,10 @@ bool CPU::CodeCache::ReadBlockInstructions(u32 start_pc, BlockInstructionList* i return false; } - // change the pc for the second branch's delay slot, it comes from the first branch - pc = GetDirectBranchTarget(prev.first, prev.second.pc); - Log_DevPrintf("Double branch at %08X, using delay slot from %08X -> %08X", info.pc, prev.second.pc, pc); + // we _could_ fetch the delay slot from the first branch's target, but it's probably in a different + // page, and that's an invalidation nightmare. so just fallback to the int, this is very rare anyway. + Log_WarningPrintf("Direct branch in delay slot at %08X, skipping block", info.pc); + return false; } // instruction is decoded now