Kaynağa Gözat

Do not emit StoreToContext before Return (#1537)

* Do not emit StoreToContext before Return

* Set PPTC version
FICTURE7 5 yıl önce
ebeveyn
işleme
4c7bebf3e6

+ 5 - 1
ARMeilleure/Instructions/InstEmitAluHelper.cs

@@ -118,9 +118,13 @@ namespace ARMeilleure.Instructions
 
             if (IsThumb(context.CurrOp))
             {
-                context.StoreToContext();
                 bool isReturn = IsA32Return(context);
 
+                if (!isReturn)
+                {
+                    context.StoreToContext();
+                }
+
                 Operand addr = context.BitwiseOr(value, Const(1));
 
                 InstEmitFlowHelper.EmitVirtualJump(context, addr, isReturn);

+ 4 - 1
ARMeilleure/Instructions/InstEmitHelper.cs

@@ -56,7 +56,10 @@ namespace ARMeilleure.Instructions
         {
             if (regIndex == RegisterAlias.Aarch32Pc)
             {
-                context.StoreToContext();
+                if (!IsA32Return(context))
+                {
+                    context.StoreToContext();
+                }
 
                 EmitBxWritePc(context, value);
             }

+ 1 - 1
ARMeilleure/Translation/PTC/Ptc.cs

@@ -21,7 +21,7 @@ namespace ARMeilleure.Translation.PTC
     {
         private const string HeaderMagic = "PTChd";
 
-        private const int InternalVersion = 1522; //! To be incremented manually for each change to the ARMeilleure project.
+        private const int InternalVersion = 1537; //! To be incremented manually for each change to the ARMeilleure project.
 
         private const string ActualDir = "0";
         private const string BackupDir = "1";