From a3744c3c26276434106435f13f86779b5d5308ce Mon Sep 17 00:00:00 2001 From: Sintendo Date: Wed, 5 Jun 2019 23:33:02 +0200 Subject: [PATCH] DSPJitUtil: Use round_long_acc in get_long_prod_round_prodl Identical, except that this used a temporary register as scratch instead of RCX. round_long_acc now no longer needs scratch, so we can deduplicate the logic. --- Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp index 5899387df9..00bfe715a3 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitUtil.cpp @@ -665,28 +665,12 @@ void DSPEmitter::get_long_prod(X64Reg long_prod) } // Returns s64 in RAX -// Clobbers RCX void DSPEmitter::get_long_prod_round_prodl(X64Reg long_prod) { // s64 prod = dsp_get_long_prod(); get_long_prod(long_prod); - X64Reg tmp = m_gpr.GetFreeXReg(); - // if (prod & 0x10000) prod = (prod + 0x8000) & ~0xffff; - TEST(32, R(long_prod), Imm32(0x10000)); - FixupBranch jump = J_CC(CC_Z); - ADD(64, R(long_prod), Imm32(0x8000)); - MOV(64, R(tmp), Imm64(~0xffff)); - AND(64, R(long_prod), R(tmp)); - FixupBranch _ret = J(); - // else prod = (prod + 0x7fff) & ~0xffff; - SetJumpTarget(jump); - ADD(64, R(long_prod), Imm32(0x7fff)); - MOV(64, R(tmp), Imm64(~0xffff)); - AND(64, R(long_prod), R(tmp)); - SetJumpTarget(_ret); - // return prod; - m_gpr.PutXReg(tmp); + round_long_acc(long_prod); } // For accurate emulation, this is wrong - but the real prod registers behave