From 9923bf981e50b511fa274ecfa13cb844b2869699 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 2 Jan 2014 07:36:31 +0100 Subject: [PATCH] (Backport commit r4574) - JIT: - fix timings broke in r4561 --- Makefile.libretro | 2 +- src/arm_jit.cpp | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 55cd35d..8565173 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -220,7 +220,7 @@ SOURCES += \ utils/AsmJit/x86/x86func.cpp \ utils/AsmJit/x86/x86operand.cpp \ utils/AsmJit/x86/x86util.cpp -CPPFLAGS += -DHAVE_JIT +CPPFLAGS += -DHAVE_JIT -DASMJIT_POSIX endif DEBUG=0 diff --git a/src/arm_jit.cpp b/src/arm_jit.cpp index db1b7df..0f7fb1d 100644 --- a/src/arm_jit.cpp +++ b/src/arm_jit.cpp @@ -700,7 +700,7 @@ static void emit_MMU_aluMemCycles(int alu_cycles, GpVar mem_cycles, int populati if(REG_POS(i,12)==15) \ { \ S_DST_R15; \ - bb_constant_cycles += 2; \ + c.add(bb_total_cycles, 2); \ return 1; \ } \ SET_NZCV(!symmetric); \ @@ -712,7 +712,7 @@ static void emit_MMU_aluMemCycles(int alu_cycles, GpVar mem_cycles, int populati GpVar tmp = c.newGpVar(kX86VarTypeGpd); \ c.mov(tmp, reg_ptr(15)); \ c.mov(cpu_ptr(next_instruction), tmp); \ - bb_constant_cycles += 2; \ + c.add(bb_total_cycles, 2); \ } \ } \ return 1; @@ -728,7 +728,7 @@ static void emit_MMU_aluMemCycles(int alu_cycles, GpVar mem_cycles, int populati if(REG_POS(i,12)==15) \ { \ S_DST_R15; \ - bb_constant_cycles += 2; \ + c.add(bb_total_cycles, 2); \ return 1; \ } \ SET_NZCV(1); \ @@ -739,7 +739,7 @@ static void emit_MMU_aluMemCycles(int alu_cycles, GpVar mem_cycles, int populati { \ GpVar tmp = c.newGpVar(kX86VarTypeGpd); \ c.mov(cpu_ptr(next_instruction), lhs); \ - bb_constant_cycles += 2; \ + c.add(bb_total_cycles, 2); \ } \ } \ return 1; @@ -763,7 +763,7 @@ static void emit_MMU_aluMemCycles(int alu_cycles, GpVar mem_cycles, int populati if(REG_POS(i,12)==15) \ { \ S_DST_R15; \ - bb_constant_cycles += 2; \ + c.add(bb_total_cycles, 2); \ return 1; \ } \ SET_NZC; \ @@ -1097,7 +1097,7 @@ static int OP_MOV_IMM_VAL(const u32 i) { OP_MOV(IMM_VAL); } if(REG_POS(i,12)==15) \ { \ S_DST_R15; \ - bb_constant_cycles += 2; \ + c.add(bb_total_cycles, 2); \ return 1; \ } \ if(!rhs_is_imm) \ @@ -4116,8 +4116,14 @@ static u32 compile_basicblock() if(cycles == 0) { JIT_COMMENT("variable cycles"); - c.lea(bb_total_cycles, ptr(bb_total_cycles.r64(), bb_cycles.r64(), kScaleNone)); + c.lea(bb_total_cycles, ptr(bb_total_cycles.r64(), bb_cycles.r64(), kScaleNone, -1)); } + else + if (cycles > 1) + { + JIT_COMMENT("cycles (%d)", cycles); + c.lea(bb_total_cycles, ptr(bb_total_cycles.r64(), -1)); + } c.bind(skip); } else