mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Jit64: Correctly handle NaNs for ps_mulsX
This commit is contained in:
parent
d3180e3516
commit
cbceae9176
@ -98,23 +98,26 @@ void Jit64::ps_muls(UGeckoInstruction inst)
|
||||
RCOpArg Ra = fpr.Use(a, RCMode::Read);
|
||||
RCOpArg Rc = fpr.Use(c, RCMode::Read);
|
||||
RCX64Reg Rd = fpr.Bind(d, RCMode::Write);
|
||||
RegCache::Realize(Ra, Rc, Rd);
|
||||
RCX64Reg Rc_duplicated = m_accurate_nans ? fpr.Scratch() : fpr.Scratch(XMM1);
|
||||
RegCache::Realize(Ra, Rc, Rd, Rc_duplicated);
|
||||
|
||||
switch (inst.SUBOP5)
|
||||
{
|
||||
case 12: // ps_muls0
|
||||
MOVDDUP(XMM1, Rc);
|
||||
MOVDDUP(Rc_duplicated, Rc);
|
||||
break;
|
||||
case 13: // ps_muls1
|
||||
avx_op(&XEmitter::VSHUFPD, &XEmitter::SHUFPD, XMM1, Rc, Rc, 3);
|
||||
avx_op(&XEmitter::VSHUFPD, &XEmitter::SHUFPD, Rc_duplicated, Rc, Rc, 3);
|
||||
break;
|
||||
default:
|
||||
PanicAlertFmt("ps_muls WTF!!!");
|
||||
}
|
||||
if (round_input)
|
||||
Force25BitPrecision(XMM1, R(XMM1), XMM0);
|
||||
Force25BitPrecision(XMM1, R(Rc_duplicated), XMM0);
|
||||
else if (XMM1 != Rc_duplicated)
|
||||
MOVAPD(XMM1, Rc_duplicated);
|
||||
MULPD(XMM1, Ra);
|
||||
HandleNaNs(inst, XMM1, XMM0, Ra, std::nullopt, Rc);
|
||||
HandleNaNs(inst, XMM1, XMM0, Ra, std::nullopt, Rc_duplicated);
|
||||
FinalizeSingleResult(Rd, R(XMM1));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user