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.
This commit is contained in:
JosJuice 2022-10-08 19:49:30 +02:00
parent cf094eb415
commit 4b8a720c9b
3 changed files with 10 additions and 17 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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)