From d87436c57db1e10087f7f006ec571622f1f5ac20 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 15 Oct 2018 21:01:52 +0100 Subject: [PATCH] Jit_LoadStorePaired: psq_lXX --- .../PowerPC/Jit64/Jit_LoadStorePaired.cpp | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp index 5e30f701f7..05bbfd6e6c 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStorePaired.cpp @@ -131,17 +131,17 @@ void Jit64::psq_lXX(UGeckoInstruction inst) bool gqrIsConstant = it != js.constantGqr.end(); u32 gqrValue = gqrIsConstant ? it->second >> 16 : 0; - gpr.Lock(a, b); + RCX64Reg scratch_guard = gpr.Scratch(RSCRATCH_EXTRA); + RCX64Reg Ra = gpr.Bind(a, update ? RCMode::ReadWrite : RCMode::Read); + RCOpArg Rb = indexed ? gpr.Use(b, RCMode::Read) : RCOpArg::Imm32((u32)offset); + RCX64Reg Rs = fpr.Bind(s, RCMode::Write); + RegCache::Realize(scratch_guard, Ra, Rb, Rs); - gpr.FlushLockX(RSCRATCH_EXTRA); - gpr.BindToRegister(a, true, update); - fpr.BindToRegister(s, false, true); - - MOV_sum(32, RSCRATCH_EXTRA, gpr.R(a), indexed ? gpr.R(b) : Imm32((u32)offset)); + MOV_sum(32, RSCRATCH_EXTRA, Ra, Rb); // In memcheck mode, don't update the address until the exception check if (update && !jo.memcheck) - MOV(32, gpr.R(a), R(RSCRATCH_EXTRA)); + MOV(32, Ra, R(RSCRATCH_EXTRA)); if (gqrIsConstant) { @@ -165,15 +165,9 @@ void Jit64::psq_lXX(UGeckoInstruction inst) CALLptr(MatR(RSCRATCH)); } - CVTPS2PD(fpr.RX(s), R(XMM0)); + CVTPS2PD(Rs, R(XMM0)); if (update && jo.memcheck) { - if (indexed) - ADD(32, gpr.R(a), gpr.R(b)); - else - ADD(32, gpr.R(a), Imm32((u32)offset)); + ADD(32, Ra, Rb); } - - gpr.UnlockAll(); - gpr.UnlockAllX(); }