JitArm64: divwx - Special case dividend == 0

Zero divided by any number is still zero. For whatever reason,
this case shows up frequently too.
This commit is contained in:
JosJuice 2021-08-21 16:31:25 +02:00
parent 09cdb076a3
commit f8e97f5a8a
1 changed files with 7 additions and 0 deletions

View File

@ -1327,6 +1327,13 @@ void JitArm64::divwx(UGeckoInstruction inst)
if (inst.Rc)
ComputeRC0(imm_d);
}
else if (gpr.IsImm(a) && gpr.GetImm(a) == 0)
{
// Zero divided by anything is always zero
gpr.SetImmediate(d, 0);
if (inst.Rc)
ComputeRC0(0);
}
else if (gpr.IsImm(a))
{
const u32 dividend = gpr.GetImm(a);