From dd04cef47ea3e006788e8d10f5e79035e11ca139 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Mon, 15 Jul 2019 19:17:10 +0200 Subject: [PATCH] jit: fix BLX_reg with rn=lr --- src/ARMJIT_x64/ARMJIT_Branch.cpp | 3 ++- src/ARM_InstrInfo.cpp | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ARMJIT_x64/ARMJIT_Branch.cpp b/src/ARMJIT_x64/ARMJIT_Branch.cpp index 05c8ec69..1f95a900 100644 --- a/src/ARMJIT_x64/ARMJIT_Branch.cpp +++ b/src/ARMJIT_x64/ARMJIT_Branch.cpp @@ -187,9 +187,10 @@ void Compiler::A_Comp_BranchImm() void Compiler::A_Comp_BranchXchangeReg() { OpArg rn = MapReg(CurInstr.A_Reg(0)); + MOV(32, R(RSCRATCH), rn); if ((CurInstr.Instr & 0xF0) == 0x30) // BLX_reg MOV(32, MapReg(14), Imm32(R15 - 4)); - Comp_JumpTo(rn.GetSimpleReg()); + Comp_JumpTo(RSCRATCH); } void Compiler::T_Comp_BCOND() diff --git a/src/ARM_InstrInfo.cpp b/src/ARM_InstrInfo.cpp index b8dff00b..c36d6c1e 100644 --- a/src/ARM_InstrInfo.cpp +++ b/src/ARM_InstrInfo.cpp @@ -359,10 +359,7 @@ Info Decode(bool thumb, u32 num, u32 instr) } if (data & A_Link) - { res.DstRegs |= 1 << 14; - res.SrcRegs |= 1 << 15; - } if (res.Kind == ak_LDM) res.DstRegs |= instr & (1 << 15); // this is right