From 06a70e4b0a541f863d4a87329693e6743e98a0f6 Mon Sep 17 00:00:00 2001 From: mtabachenko Date: Thu, 18 Jul 2013 12:56:30 +0000 Subject: [PATCH] JIT: - a bit optimized OP_BX_THUMB (with Rm=R15); --- desmume/src/arm_jit.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/desmume/src/arm_jit.cpp b/desmume/src/arm_jit.cpp index 03ff39563..77f0d6524 100644 --- a/desmume/src/arm_jit.cpp +++ b/desmume/src/arm_jit.cpp @@ -3760,13 +3760,11 @@ static int op_bx_thumb(Mem srcreg, bool blx, bool test_thumb) static int op_bx_thumbR15() { - GpVar dst = c.newGpVar(kX86VarTypeGpd); - GpVar thumb = c.newGpVar(kX86VarTypeGpd); - c.mov(dst, bb_r15); + const u32 r15 = (bb_r15 & 0xFFFFFFFC); + c.mov(cpu_ptr(instruct_adr), Imm(r15)); + c.mov(reg_ptr(15), Imm(r15)); c.and_(cpu_ptr(CPSR), (u32)~(1<< 5)); - c.and_(dst, 0xFFFFFFFC); - c.mov(reg_ptr(15), dst); - c.mov(cpu_ptr(instruct_adr), dst); + return 1; }