JitArm64_SystemRegisters: Optimize mtspr

No need to materialize the immediate if it is zero, we can just use WZR.

Before:
mov    w27, #0x0                 ; =0
str    w27, [x29, #0x1178]

After:
str    wzr, [x29, #0x1178]
This commit is contained in:
Sintendo 2024-10-10 22:16:25 +02:00
parent 8304ae3361
commit 0d9984b299
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ void JitArm64::mtspr(UGeckoInstruction inst)
}
// OK, this is easy.
ARM64Reg RD = gpr.R(inst.RD);
ARM64Reg RD = gpr.IsImm(inst.RD, 0) ? ARM64Reg::WZR : gpr.R(inst.RD);
STR(IndexType::Unsigned, RD, PPC_REG, PPCSTATE_OFF_SPR(iIndex));
}