diff --git a/Core/MIPS/ARM64/Arm64CompLoadStore.cpp b/Core/MIPS/ARM64/Arm64CompLoadStore.cpp index 1a724b2bf8..284d5b0024 100644 --- a/Core/MIPS/ARM64/Arm64CompLoadStore.cpp +++ b/Core/MIPS/ARM64/Arm64CompLoadStore.cpp @@ -352,11 +352,12 @@ namespace MIPSComp { gpr.MapRegAsPointer(rs); Arm64Gen::ARM64Reg ar; - if (rt != MIPS_REG_ZERO) { + if (gpr.IsImm(rt) && gpr.GetImm(rt) == 0) { + // Can just store from the zero register directly. + ar = WZR; + } else { gpr.MapReg(rt, load ? MAP_NOINIT : 0); ar = gpr.R(rt); - } else { - ar = WZR; } switch (o) { case 35: LDR(INDEX_UNSIGNED, ar, gpr.RPtr(rs), offset); break;