]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
JIT: can now successfully use USE_NEW_RTASM on x86 (32-bit)
authorFrode Solheim <frode@fs-uae.net>
Sun, 6 Sep 2015 21:45:12 +0000 (23:45 +0200)
committerFrode Solheim <frode@fs-uae.net>
Thu, 17 Sep 2015 17:18:09 +0000 (19:18 +0200)
jit/codegen_x86.cpp
jit/compemu_midfunc_x86.cpp
jit/compemu_support.cpp

index 04ef388d10ccdecf452177da93a13a92f1c90aeb..6535488f444c5d456fc9c8cbf18c7e3624ecf163 100644 (file)
@@ -166,6 +166,8 @@ static const uae_u8 need_to_preserve[]={1,1,1,1,0,1,1,1};
 #define CLOBBER_BT   clobber_flags()
 #define CLOBBER_BSF  clobber_flags()
 
+/* The older code generator is now deprecated.  */
+#define USE_NEW_RTASM 0
 
 #if USE_NEW_RTASM
 
@@ -192,9 +194,8 @@ static const uae_u8 need_to_preserve[]={1,1,1,1,0,1,1,1};
 
 static void jit_fail(const char *msg, const char *file, int line, const char *function)
 {
-       panicbug("JIT failure in function %s from file %s at line %d: %s",
+       jit_abort("failure in function %s from file %s at line %d: %s",
                        function, file, line, msg);
-       abort();
 }
 
 LOWFUNC(NONE,WRITE,1,raw_push_l_r,(R4 r))
@@ -532,7 +533,7 @@ LOWFUNC(READ,NONE,3,raw_cmov_l_rr,(RW4 d, R4 s, IMM cc))
        if (have_cmov)
                CMOVLrr(cc, s, d);
        else { /* replacement using branch and mov */
-               int8 *target_p = (int8 *)x86_get_target() + 1;
+               uae_s8 *target_p = (uae_s8 *)x86_get_target() + 1;
                JCCSii(cc^1, 0);
                MOVLrr(s, d);
                *target_p = (uintptr)x86_get_target() - ((uintptr)target_p + 1);
@@ -703,7 +704,7 @@ LOWFUNC(NONE,READ,5,raw_cmov_l_rm_indexed,(W4 d, IMM base, R4 index, IMM factor,
        if (have_cmov)
                ADDR32 CMOVLmr(cond, base, X86_NOREG, index, factor, d);
        else { /* replacement using branch and mov */
-               int8 *target_p = (int8 *)x86_get_target() + 1;
+               uae_s8 *target_p = (uae_s8 *)x86_get_target() + 1;
                JCCSii(cond^1, 0);
                ADDR32 MOVLmr(base, X86_NOREG, index, factor, d);
                *target_p = (uintptr)x86_get_target() - ((uintptr)target_p + 1);
@@ -716,7 +717,7 @@ LOWFUNC(NONE,READ,3,raw_cmov_l_rm,(W4 d, IMM mem, IMM cond))
        if (have_cmov)
                CMOVLmr(cond, mem, X86_NOREG, X86_NOREG, 1, d);
        else { /* replacement using branch and mov */
-               int8 *target_p = (int8 *)x86_get_target() + 1;
+               uae_s8 *target_p = (uae_s8 *)x86_get_target() + 1;
                JCCSii(cond^1, 0);
                MOVLmr(mem, X86_NOREG, X86_NOREG, 1, d);
                *target_p = (uintptr)x86_get_target() - ((uintptr)target_p + 1);
index b36df907aa3c0e0f93e9e4b36db0bfe3bf1442f3..347089f882af23cd4ca2b36164620e6a094dea30 100644 (file)
@@ -1292,7 +1292,11 @@ MIDFUNC(3,mov_l_rm_indexed,(W4 d, IMM base, RR4 index))
        base+=get_offset(indexreg)*4;
        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
        unlock2(index);
        unlock2(d);
 }
index f2c19eb84e15000ed433765f5038a4113d331144..bd586a089bbe58ecd36b01db300b82014304fd25 100644 (file)
@@ -1518,7 +1518,7 @@ static  int alloc_reg_hinted(int r, int size, int willclobber, int hint)
                        raw_zero_extend_16_rr(rr,rr);
                        raw_zero_extend_16_rr(bestreg,bestreg);
                        raw_bswap_32(bestreg);
-                       raw_lea_l_rr_indexed(rr,rr,bestreg);
+                       raw_lea_l_brr_indexed(rr,rr,bestreg,1,0);
                        live.state[r].validsize=4;
                        live.nat[rr].touched=touchcnt++;
                        return rr;
@@ -3160,10 +3160,18 @@ void calc_disp_ea_020(int base, uae_u32 dp, int target, int tmp)
        else { /* 68000 version */
                if ((dp & 0x800) == 0) { /* Sign extend */
                        sign_extend_16_rr(target,reg);
+#if USE_NEW_RTASM
+                       lea_l_brr_indexed(target,base,target,1<<regd_shift,(uae_s32)((uae_s8)dp));
+#else
                        lea_l_brr_indexed(target,base,target,regd_shift,(uae_s32)((uae_s8)dp));
+#endif
                }
                else {
+#if USE_NEW_RTASM
+                       lea_l_brr_indexed(target,base,reg,1<<regd_shift,(uae_s32)((uae_s8)dp));
+#else
                        lea_l_brr_indexed(target,base,reg,regd_shift,(uae_s32)((uae_s8)dp));
+#endif
                }
        }
        forget_about(tmp);
@@ -4407,7 +4415,11 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles)
                                        int r2 = (r==0) ? 1 : 0;
                                        raw_mov_l_ri(r2,(uintptr)popall_do_nothing);
                                        raw_sub_l_mi((uae_u32)&countdown,scaled_cycles(totcycles));
-                                       raw_cmov_l_rm_indexed(r2,(uae_u32)cache_tags,r,9);
+#if USE_NEW_RTASM
+                                       raw_cmov_l_rm_indexed(r2,(uintptr)cache_tags,r,SIZEOF_VOID_P,9);
+#else
+                                       raw_cmov_l_rm_indexed(r2,(uintptr)cache_tags,r,9);
+#endif
                                        raw_jmp_r(r2);
                                }
                                else if (was_comp && isconst(PC_P)) {
@@ -4433,7 +4445,11 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles)
                                        int r2 = (r==0) ? 1 : 0;
                                        raw_mov_l_ri(r2,(uintptr)popall_do_nothing);
                                        raw_sub_l_mi((uae_u32)&countdown,scaled_cycles(totcycles));
+#if USE_NEW_RTASM
+                                       raw_cmov_l_rm_indexed(r2,(uintptr)cache_tags,r,SIZEOF_VOID_P,9);
+#else
                                        raw_cmov_l_rm_indexed(r2,(uintptr)cache_tags,r,9);
+#endif
                                        raw_jmp_r(r2);
                                }
                        }