From 20f3db8da1cff15edcb2167f3d68e2a43e8eae48 Mon Sep 17 00:00:00 2001 From: Frode Solheim Date: Mon, 7 Sep 2015 21:24:15 +0200 Subject: [PATCH] JIT: mov_l_rm_indexed changes (correct?) + flush_regs --- jit/compemu_midfunc_x86.cpp | 16 ++++++---------- jit/compemu_midfunc_x86.h | 1 - jit/compemu_support.cpp | 14 ++++++++------ 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/jit/compemu_midfunc_x86.cpp b/jit/compemu_midfunc_x86.cpp index eb33d08e..c9bfcdf3 100644 --- a/jit/compemu_midfunc_x86.cpp +++ b/jit/compemu_midfunc_x86.cpp @@ -1228,30 +1228,26 @@ MIDFUNC(5,mov_b_brrm_indexed,(W1 d, IMM base, RR4 baser, RR4 index, IMM factor)) } MENDFUNC(5,mov_b_brrm_indexed,(W1 d, IMM base, RR4 baser, RR4 index, IMM factor)) -/* Read a long from base+4*index */ -MIDFUNC(3,mov_l_rm_indexed,(W4 d, IMM base, RR4 index)) +/* Read a long from base+factor*index */ +MIDFUNC(4,mov_l_rm_indexed,(W4 d, IMM base, RR4 index, IMM factor)) { int indexreg=index; if (isconst(index)) { - COMPCALL(mov_l_rm)(d,base+4*live.state[index].val); + COMPCALL(mov_l_rm)(d,base+factor*live.state[index].val); return; } CLOBBER_MOV; index=readreg_offset(index,4); - base+=get_offset(indexreg)*4; + base+=get_offset(indexreg)*factor; d=writereg(d,4); -#if USE_NEW_RTASM - raw_mov_l_rm_indexed(d,base,index,4); -#else - raw_mov_l_rm_indexed(d,base,index); -#endif + raw_mov_l_rm_indexed(d,base,index,factor); unlock2(index); unlock2(d); } -MENDFUNC(3,mov_l_rm_indexed,(W4 d, IMM base, RR4 index)) +MENDFUNC(4,mov_l_rm_indexed,(W4 d, IMM base, RR4 index, IMM factor)) /* read the long at the address contained in s+offset and store in d */ MIDFUNC(3,mov_l_rR,(W4 d, RR4 s, IMM offset)) diff --git a/jit/compemu_midfunc_x86.h b/jit/compemu_midfunc_x86.h index 440ccde8..aa3dc067 100644 --- a/jit/compemu_midfunc_x86.h +++ b/jit/compemu_midfunc_x86.h @@ -109,7 +109,6 @@ DECLARE_MIDFUNC(mov_l_bmrr_indexed(IMM base, RR4 baser, RR4 index, IMM factor, R DECLARE_MIDFUNC(mov_w_bmrr_indexed(IMM base, RR4 baser, RR4 index, IMM factor, RR2 s)); DECLARE_MIDFUNC(mov_b_bmrr_indexed(IMM base, RR4 baser, RR4 index, IMM factor, RR1 s)); DECLARE_MIDFUNC(mov_l_brrm_indexed(W4 d, IMM base, RR4 baser, RR4 index, IMM factor)); -DECLARE_MIDFUNC(mov_l_rm_indexed(W4 d, IMM base, RR4 index)); DECLARE_MIDFUNC(mov_w_brrm_indexed(W2 d, IMM base, RR4 baser, RR4 index, IMM factor)); DECLARE_MIDFUNC(mov_b_brrm_indexed(W1 d, IMM base, RR4 baser, RR4 index, IMM factor)); DECLARE_MIDFUNC(mov_l_rm_indexed(W4 d, IMM base, RR4 index, IMM factor)); diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 47ad59ed..df80a41d 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -2894,7 +2894,7 @@ static void writemem_real(int address, int source, int size, int tmp, int clobbe mov_l_rr(f,address); shrl_l_ri(f,16); /* The index into the baseaddr table */ - mov_l_rm_indexed(f,uae_p32(baseaddr),f); + mov_l_rm_indexed(f,uae_p32(baseaddr),f,SIZEOF_VOID_P); /* FIXME: is SIZEOF_VOID_P correct? */ if (address==source) { /* IBrowse does this! */ if (size > 1) { @@ -2922,7 +2922,7 @@ static inline void writemem(int address, int source, int offset, int size, int t mov_l_rr(f,address); shrl_l_ri(f,16); /* The index into the mem bank table */ - mov_l_rm_indexed(f,uae_p32(mem_banks),f); + mov_l_rm_indexed(f,uae_p32(mem_banks),f,SIZEOF_VOID_P); /* FIXME: is SIZEOF_VOID_P correct? */ /* Now f holds a pointer to the actual membank */ mov_l_rR(f,f,offset); /* Now f holds the address of the b/w/lput function */ @@ -3004,7 +3004,7 @@ static void readmem_real(int address, int dest, int size, int tmp) mov_l_rr(f,address); shrl_l_ri(f,16); /* The index into the baseaddr table */ - mov_l_rm_indexed(f,uae_p32(baseaddr),f); + mov_l_rm_indexed(f,uae_p32(baseaddr),f,SIZEOF_VOID_P); /* FIXME: is SIZEOF_VOID_P correct? */ /* f now holds the offset */ switch(size) { @@ -3023,7 +3023,7 @@ static inline void readmem(int address, int dest, int offset, int size, int tmp) mov_l_rr(f,address); shrl_l_ri(f,16); /* The index into the mem bank table */ - mov_l_rm_indexed(f,uae_p32(mem_banks),f); + mov_l_rm_indexed(f,uae_p32(mem_banks),f,SIZEOF_VOID_P); /* FIXME: is SIZEOF_VOID_P correct? */ /* Now f holds a pointer to the actual membank */ mov_l_rR(f,f,offset); /* Now f holds the address of the b/w/lget function */ @@ -3092,7 +3092,7 @@ void get_n_addr(int address, int dest, int tmp) mov_l_rr(f,address); mov_l_rr(dest,address); // gb-- nop if dest==address shrl_l_ri(f,16); - mov_l_rm_indexed(f,uae_p32(baseaddr),f); + mov_l_rm_indexed(f,uae_p32(baseaddr),f,SIZEOF_VOID_P); /* FIXME: is SIZEOF_VOID_P correct? */ add_l(dest,f); forget_about(tmp); } @@ -3109,7 +3109,7 @@ void get_n_addr_jmp(int address, int dest, int tmp) f=dest; mov_l_rr(f,address); shrl_l_ri(f,16); /* The index into the baseaddr bank table */ - mov_l_rm_indexed(dest,uae_p32(baseaddr),f); + mov_l_rm_indexed(dest,uae_p32(baseaddr),f,SIZEOF_VOID_P); /* FIXME: is SIZEOF_VOID_P correct? */ add_l(dest,address); and_l_ri (dest, ~1); forget_about(tmp); @@ -4437,6 +4437,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) tba=(uae_u32*)get_target(); emit_jmp_target(get_handler(t1)); raw_mov_l_mi((uintptr)®s.pc_p,t1); + flush_reg_count(); raw_jmp((uintptr)popall_do_nothing); create_jmpdep(bi,0,tba,t1); @@ -4462,6 +4463,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) if (was_comp) { flush(1); } + flush_reg_count(); /* Let's find out where next_handler is... */ if (was_comp && isinreg(PC_P)) { -- 2.47.3