aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFICTURE7 <FICTURE7@gmail.com>2020-09-07 06:52:17 +0400
committerGitHub <noreply@github.com>2020-09-07 12:52:17 +1000
commit4c7bebf3e691f356eaa595ee395690d740162e2f (patch)
treeddc54db803bcfc7aa0806adfb2a3a2b95b7e5821
parent6aef27166101a0f733f9bfdfeb268fdc45048550 (diff)
Do not emit StoreToContext before Return (#1537)
* Do not emit StoreToContext before Return * Set PPTC version
-rw-r--r--ARMeilleure/Instructions/InstEmitAluHelper.cs6
-rw-r--r--ARMeilleure/Instructions/InstEmitHelper.cs5
-rw-r--r--ARMeilleure/Translation/PTC/Ptc.cs2
3 files changed, 10 insertions, 3 deletions
diff --git a/ARMeilleure/Instructions/InstEmitAluHelper.cs b/ARMeilleure/Instructions/InstEmitAluHelper.cs
index 12fa1bf1..8c71d4cb 100644
--- a/ARMeilleure/Instructions/InstEmitAluHelper.cs
+++ b/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);
diff --git a/ARMeilleure/Instructions/InstEmitHelper.cs b/ARMeilleure/Instructions/InstEmitHelper.cs
index a4227543..d1bbe3f1 100644
--- a/ARMeilleure/Instructions/InstEmitHelper.cs
+++ b/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);
}
diff --git a/ARMeilleure/Translation/PTC/Ptc.cs b/ARMeilleure/Translation/PTC/Ptc.cs
index 8ca83583..eebf8075 100644
--- a/ARMeilleure/Translation/PTC/Ptc.cs
+++ b/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";