From ee0f9b03a4a28bc27351cda9f6e2f7a921ad1fd5 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 19 Dec 2022 14:45:58 -0300 Subject: [PATCH] Eliminate zero-extension moves in more cases on 32-bit games (#4140) * Eliminate zero-extension moves in more cases on 32-bit games * PPTC version bump * Revert X86Optimizer changes --- ARMeilleure/CodeGen/X86/CodeGenerator.cs | 6 ++++++ ARMeilleure/Translation/PTC/Ptc.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ARMeilleure/CodeGen/X86/CodeGenerator.cs b/ARMeilleure/CodeGen/X86/CodeGenerator.cs index 8d8d3b0a..e589da14 100644 --- a/ARMeilleure/CodeGen/X86/CodeGenerator.cs +++ b/ARMeilleure/CodeGen/X86/CodeGenerator.cs @@ -1587,6 +1587,12 @@ namespace ARMeilleure.CodeGen.X86 Debug.Assert(dest.Type.IsInteger() && source.Type.IsInteger()); + // We can eliminate the move if source is already 32-bit and the registers are the same. + if (dest.Value == source.Value && source.Type == OperandType.I32) + { + return; + } + context.Assembler.Mov(dest, source, OperandType.I32); } diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs index 70f6e012..db373bfc 100644 --- a/ARMeilleure/Translation/PTC/Ptc.cs +++ b/ARMeilleure/Translation/PTC/Ptc.cs @@ -27,7 +27,7 @@ namespace ARMeilleure.Translation.PTC private const string OuterHeaderMagicString = "PTCohd\0\0"; private const string InnerHeaderMagicString = "PTCihd\0\0"; - private const uint InternalVersion = 3713; //! To be incremented manually for each change to the ARMeilleure project. + private const uint InternalVersion = 4140; //! To be incremented manually for each change to the ARMeilleure project. private const string ActualDir = "0"; private const string BackupDir = "1";