From 38b26cf4242999fa7d8c550993ac0940cd03d55f Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 11 Jul 2020 02:52:38 -0300 Subject: [PATCH] Mask shift constants on x86 backend (#1382) * Mask shift constants on x86 backendd * Version bump --- ARMeilleure/CodeGen/X86/Assembler.cs | 4 ++++ ARMeilleure/Translation/PTC/Ptc.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ARMeilleure/CodeGen/X86/Assembler.cs b/ARMeilleure/CodeGen/X86/Assembler.cs index 62ca05b2..537c746c 100644 --- a/ARMeilleure/CodeGen/X86/Assembler.cs +++ b/ARMeilleure/CodeGen/X86/Assembler.cs @@ -882,6 +882,10 @@ namespace ARMeilleure.CodeGen.X86 source = null; } + else if (source.Kind == OperandKind.Constant) + { + source = source.With((uint)source.Value & (dest.Type == OperandType.I32 ? 0x1f : 0x3f)); + } WriteInstruction(dest, source, type, inst); } diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs index ced3d0d4..30a405e4 100644 --- a/ARMeilleure/Translation/PTC/Ptc.cs +++ b/ARMeilleure/Translation/PTC/Ptc.cs @@ -20,7 +20,7 @@ namespace ARMeilleure.Translation.PTC { private const string HeaderMagic = "PTChd"; - private const int InternalVersion = 5; //! To be incremented manually for each change to the ARMeilleure project. + private const int InternalVersion = 6; //! To be incremented manually for each change to the ARMeilleure project. private const string BaseDir = "Ryujinx";