From fd511a689f5acb9cb563f6f267da836e7ad4f37b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 14 Feb 2022 19:03:34 +0100 Subject: [PATCH] Jit: Skip redundant flushes This makes codegen faster (by perhaps 10-20% in the case of Jit64, I didn't measure too closely), which helps speed up NBA Live 2005 a little. But the game still has serious performance issues. --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 4 ++-- Source/Core/Core/PowerPC/JitArm64/Jit.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 903bc826fbf2..f43d25855f84 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -1184,8 +1184,8 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC) gpr.Discard(op.gprDiscardable); fpr.Discard(op.fprDiscardable); } - gpr.Flush(~op.gprInUse); - fpr.Flush(~op.fprInUse); + gpr.Flush(~op.gprInUse & (op.regsIn | op.regsOut)); + fpr.Flush(~op.fprInUse & (op.fregsIn | op.GetFregsOut())); if (opinfo->flags & FL_LOADSTORE) ++js.numLoadStoreInst; diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 113c8e0043b0..3be81d2c713e 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -971,8 +971,8 @@ bool JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC) gpr.DiscardRegisters(op.gprDiscardable); fpr.DiscardRegisters(op.fprDiscardable); } - gpr.StoreRegisters(~op.gprInUse); - fpr.StoreRegisters(~op.fprInUse); + gpr.StoreRegisters(~op.gprInUse & (op.regsIn | op.regsOut)); + fpr.StoreRegisters(~op.fprInUse & (op.fregsIn | op.GetFregsOut())); if (opinfo->flags & FL_LOADSTORE) ++js.numLoadStoreInst;