From f1460d549441f10d63bde9d7d36282cc007b4c7e Mon Sep 17 00:00:00 2001 From: merry Date: Tue, 22 Feb 2022 13:41:56 +0000 Subject: [PATCH] A32: Fix BLX and BXWritePC (#3151) --- ARMeilleure/Instructions/InstEmitFlow32.cs | 2 +- ARMeilleure/Instructions/InstEmitHelper.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ARMeilleure/Instructions/InstEmitFlow32.cs b/ARMeilleure/Instructions/InstEmitFlow32.cs index add66a425..2b0525050 100644 --- a/ARMeilleure/Instructions/InstEmitFlow32.cs +++ b/ARMeilleure/Instructions/InstEmitFlow32.cs @@ -71,7 +71,7 @@ namespace ARMeilleure.Instructions SetFlag(context, PState.TFlag, bitOne); - EmitVirtualCall(context, addr); + EmitBxWritePc(context, addr); } public static void Bx(ArmEmitterContext context) diff --git a/ARMeilleure/Instructions/InstEmitHelper.cs b/ARMeilleure/Instructions/InstEmitHelper.cs index d1b9de842..433b0831e 100644 --- a/ARMeilleure/Instructions/InstEmitHelper.cs +++ b/ARMeilleure/Instructions/InstEmitHelper.cs @@ -186,7 +186,7 @@ namespace ARMeilleure.Instructions SetFlag(context, PState.TFlag, mode); - Operand addr = context.ConditionalSelect(mode, pc, context.BitwiseAnd(pc, Const(~3))); + Operand addr = context.ConditionalSelect(mode, context.BitwiseAnd(pc, Const(~1)), context.BitwiseAnd(pc, Const(~3))); InstEmitFlowHelper.EmitVirtualJump(context, addr, isReturn); }