From 0e76dabbbb771a0fd42d9d744a36f9a1a5d0143d Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 4 Aug 2021 21:39:22 +0200 Subject: [PATCH] Jit64: Always pass effective address to InvalidateICache() in dcbx. --- Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp index a8b26fb86b..63157a6747 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp @@ -239,15 +239,17 @@ void Jit64::dcbx(UGeckoInstruction inst) RCOpArg Ra = inst.RA ? gpr.Use(inst.RA, RCMode::Read) : RCOpArg::Imm32(0); RCOpArg Rb = gpr.Use(inst.RB, RCMode::Read); RCX64Reg tmp = gpr.Scratch(); - RegCache::Realize(Ra, Rb, tmp); + RCX64Reg effective_address = gpr.Scratch(); + RegCache::Realize(Ra, Rb, tmp, effective_address); // Translate effective address to physical address. MOV_sum(32, value, Ra, Rb); FixupBranch bat_lookup_failed; + MOV(32, R(effective_address), R(value)); if (MSR.IR) { - MOV(32, R(addr), R(value)); bat_lookup_failed = BATAddressLookup(value, tmp, PowerPC::ibat_table.data()); + MOV(32, R(addr), R(effective_address)); AND(32, R(addr), Imm32(0x0001ffff)); AND(32, R(value), Imm32(0xfffe0000)); OR(32, R(value), R(addr)); @@ -264,14 +266,14 @@ void Jit64::dcbx(UGeckoInstruction inst) SwitchToFarCode(); SetJumpTarget(invalidate_needed); - SHL(32, R(addr), Imm8(5)); if (MSR.IR) SetJumpTarget(bat_lookup_failed); BitSet32 registersInUse = CallerSavedRegistersInUse(); registersInUse[X64Reg(tmp)] = false; + registersInUse[X64Reg(effective_address)] = false; ABI_PushRegistersAndAdjustStack(registersInUse, 0); - MOV(32, R(ABI_PARAM1), R(addr)); + MOV(32, R(ABI_PARAM1), R(effective_address)); MOV(32, R(ABI_PARAM2), Imm32(32)); XOR(32, R(ABI_PARAM3), R(ABI_PARAM3)); ABI_CallFunction(JitInterface::InvalidateICache);