From 51cb918aa5fbc26c1cdb78dc0193cb29e9df5201 Mon Sep 17 00:00:00 2001 From: Bram Speeckaert Date: Tue, 1 Nov 2022 19:26:34 +0100 Subject: [PATCH] JitArm64: MultiplyImmediate - Handle 0 Multiplication by zero always gives zero. Before: 0x52800019 mov w25, #0x0 0x1b197f5b mul w27, w26, w25 After: Nothing! --- .../Core/PowerPC/JitArm64/JitArm64_Integer.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp index a90bf24077..96e4325106 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp @@ -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)