From 4b8a720c9b4a3ec8b438173f216c9528387e970b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 8 Oct 2022 19:49:30 +0200 Subject: [PATCH] Jit64: Remove HandleNaNs's xmm_out parameter All HandleNaNs does with the xmm_out parameter is emit MOVAPD at the end if xmm_out != xmm. The caller might as well do that themselves. --- Source/Core/Core/PowerPC/Jit64/Jit.h | 3 +-- .../Core/PowerPC/Jit64/Jit_FloatingPoint.cpp | 16 +++++----------- Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.h b/Source/Core/Core/PowerPC/Jit64/Jit.h index 359a2b53cc..2b4a1592ff 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.h +++ b/Source/Core/Core/PowerPC/Jit64/Jit.h @@ -126,8 +126,7 @@ public: void FinalizeSingleResult(Gen::X64Reg output, const Gen::OpArg& input, bool packed = true, bool duplicate = false); void FinalizeDoubleResult(Gen::X64Reg output, const Gen::OpArg& input); - void HandleNaNs(UGeckoInstruction inst, Gen::X64Reg xmm_out, Gen::X64Reg xmm_in, - Gen::X64Reg clobber); + void HandleNaNs(UGeckoInstruction inst, Gen::X64Reg xmm, Gen::X64Reg clobber); void MultiplyImmediate(u32 imm, int a, int d, bool overflow); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp index 40999cadcc..17c52c42cf 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp @@ -92,7 +92,7 @@ void Jit64::FinalizeDoubleResult(X64Reg output, const OpArg& input) SetFPRFIfNeeded(input, false); } -void Jit64::HandleNaNs(UGeckoInstruction inst, X64Reg xmm_out, X64Reg xmm, X64Reg clobber) +void Jit64::HandleNaNs(UGeckoInstruction inst, X64Reg xmm, X64Reg clobber) { // | PowerPC | x86 // ---------------------+----------+--------- @@ -103,11 +103,7 @@ void Jit64::HandleNaNs(UGeckoInstruction inst, X64Reg xmm_out, X64Reg xmm, X64Re // to be positive, so we'll have to handle them manually. if (!m_accurate_nans) - { - if (xmm_out != xmm) - MOVAPD(xmm_out, R(xmm)); return; - } ASSERT(xmm != clobber); @@ -200,8 +196,6 @@ void Jit64::HandleNaNs(UGeckoInstruction inst, X64Reg xmm_out, X64Reg xmm, X64Re SetJumpTarget(done); } } - if (xmm_out != xmm) - MOVAPD(xmm_out, R(xmm)); } void Jit64::fp_arith(UGeckoInstruction inst) @@ -259,11 +253,11 @@ void Jit64::fp_arith(UGeckoInstruction inst) avx_op(avxOp, sseOp, dest, Rop1, Rop2, packed, reversible); } - HandleNaNs(inst, Rd, dest, XMM0); + HandleNaNs(inst, dest, XMM0); if (single) - FinalizeSingleResult(Rd, Rd, packed, true); + FinalizeSingleResult(Rd, R(dest), packed, true); else - FinalizeDoubleResult(Rd, Rd); + FinalizeDoubleResult(Rd, R(dest)); }; switch (inst.SUBOP5) @@ -482,7 +476,7 @@ void Jit64::fmaddXX(UGeckoInstruction inst) result_xmm = Rd; } - HandleNaNs(inst, result_xmm, result_xmm, XMM0); + HandleNaNs(inst, result_xmm, XMM0); if (single) FinalizeSingleResult(Rd, R(result_xmm), packed, true); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp index f0b525d323..74ae5ba584 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Paired.cpp @@ -77,8 +77,8 @@ void Jit64::ps_sum(UGeckoInstruction inst) default: PanicAlertFmt("ps_sum WTF!!!"); } - HandleNaNs(inst, Rd, tmp, tmp == XMM1 ? XMM0 : XMM1); - FinalizeSingleResult(Rd, Rd); + HandleNaNs(inst, tmp, tmp == XMM1 ? XMM0 : XMM1); + FinalizeSingleResult(Rd, R(tmp)); } void Jit64::ps_muls(UGeckoInstruction inst) @@ -112,8 +112,8 @@ void Jit64::ps_muls(UGeckoInstruction inst) if (round_input) Force25BitPrecision(XMM1, R(XMM1), XMM0); MULPD(XMM1, Ra); - HandleNaNs(inst, Rd, XMM1, XMM0); - FinalizeSingleResult(Rd, Rd); + HandleNaNs(inst, XMM1, XMM0); + FinalizeSingleResult(Rd, R(XMM1)); } void Jit64::ps_mergeXX(UGeckoInstruction inst)