]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
JIT: mov_l_rm_indexed changes (correct?) + flush_regs
authorFrode Solheim <frode@fs-uae.net>
Mon, 7 Sep 2015 19:24:15 +0000 (21:24 +0200)
committerFrode Solheim <frode@fs-uae.net>
Thu, 17 Sep 2015 17:18:09 +0000 (19:18 +0200)
jit/compemu_midfunc_x86.cpp
jit/compemu_midfunc_x86.h
jit/compemu_support.cpp

index eb33d08e830123bfbcec244084e608a98fbf03d5..c9bfcdf30bf6bcedc89d2ad2dbdd58c54ad8ffdf 100644 (file)
@@ -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))
index 440ccde801b593e94e4c4f28860ca6668c2882b2..aa3dc0677580e580a177934967e19a9726fa3888 100644 (file)
@@ -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));
index 47ad59ed4ed6ea5354af26957c1dcb250c23d91b..df80a41d5d14b2872c033831b41958da1bc47131 100644 (file)
@@ -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)&regs.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)) {