JitArm64: MultiplyImmediate - Handle 0

Multiplication by zero always gives zero.

Before:
0x52800019   mov    w25, #0x0
0x1b197f5b   mul    w27, w26, w25

After:
Nothing!
This commit is contained in:
Bram Speeckaert 2022-11-01 19:26:34 +01:00
parent 080513284c
commit 51cb918aa5
1 changed files with 13 additions and 1 deletions

View File

@ -878,7 +878,19 @@ void JitArm64::addic(UGeckoInstruction inst)
bool JitArm64::MultiplyImmediate(u32 imm, int a, int d, bool rc)
{
return false;
if (imm == 0)
{
gpr.SetImmediate(d, 0);
if (rc)
ComputeRC0(gpr.GetImm(d));
}
else
{
// Immediate did not match any known special cases.
return false;
}
return true;
}
void JitArm64::mulli(UGeckoInstruction inst)