]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Aranym JIT updates. (Partial only, non-merged LSL/LSR part is not yet UAE compatible)
authorToni Wilen <twilen@winuae.net>
Sun, 3 Jun 2018 16:22:08 +0000 (19:22 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 3 Jun 2018 16:22:08 +0000 (19:22 +0300)
jit/compemu_midfunc_x86.cpp
jit/compemu_midfunc_x86.h
jit/compemu_support.cpp

index d5e2e053e0a5a27faeccd1b5a3c87b9ee27de7ca..38e8bc9370e2e43c2c9e9d3d37709cdf94a66a65 100644 (file)
@@ -119,6 +119,34 @@ MIDFUNC(0,duplicate_carry,(void))
 }
 MENDFUNC(0,duplicate_carry,(void))
 
+MIDFUNC(0, setcc_for_cntzero, (RR4))
+{
+       uae_u8 * branchadd;
+
+       evict(FLAGX);
+       make_flags_live_internal();
+
+       raw_pushfl();
+       /*
+        * shift count can only be in CL register; see shrl_b_rr
+        */
+       raw_test_b_rr(X86_CL, X86_CL);
+       /* if zero, leave X unaffected; carry flag will already be cleared */
+       raw_jz_b_oponly();
+       branchadd = get_target();
+       skip_byte();
+       raw_popfl();
+       raw_pushfl();
+#ifdef UAE
+       COMPCALL(setcc_m)((uintptr)live.state[FLAGX].mem + 1, NATIVE_CC_CS);
+#else
+       COMPCALL(setcc_m)((uintptr)live.state[FLAGX].mem, NATIVE_CC_CS);
+#endif
+       log_vwrite(FLAGX);
+       *branchadd = (uintptr)get_target() - ((uintptr)branchadd + 1);
+       raw_popfl();
+}
+
 MIDFUNC(0,restore_carry,(void))
 {
        if (!have_rat_stall) { /* Not a P6 core, i.e. no partial stalls */
index a0f5cf92c119dd6bab0fea9428844545776edd8a..a477f6edb285ee53f62f48239cb3583045ba851b 100644 (file)
@@ -185,6 +185,7 @@ DECLARE_MIDFUNC(xor_b(RW1 d, RR1 s));
 DECLARE_MIDFUNC(live_flags(void));
 DECLARE_MIDFUNC(dont_care_flags(void));
 DECLARE_MIDFUNC(duplicate_carry(void));
+DECLARE_MIDFUNC(setcc_for_cntzero(RR4 d));
 DECLARE_MIDFUNC(restore_carry(void));
 DECLARE_MIDFUNC(start_needflags(void));
 DECLARE_MIDFUNC(end_needflags(void));
index 3ca4d5fc40dc2e973de495775bc9fa228d938621..fc1eec21a68d815dd84a63389f02785344e70c1a 100644 (file)
@@ -224,7 +224,7 @@ static clock_t emul_end_time        = 0;
 #endif
 
 #ifdef PROFILE_UNTRANSLATED_INSNS
-static const int untranslated_top_ten = 20;
+static const int untranslated_top_ten = 50;
 static uae_u32 raw_cputbl_count[65536] = { 0, };
 static uae_u16 opcode_nums[65536];
 
@@ -2744,7 +2744,7 @@ void compiler_exit(void)
                opcode_nums[i] = i;
                untranslated_count += raw_cputbl_count[i];
        }
-       jit_log("Sorting out untranslated instructions count...");
+       bug("Sorting out untranslated instructions count...");
        qsort(opcode_nums, 65536, sizeof(uae_u16), untranslated_compfn);
        jit_log("Rank  Opc      Count Name");
        for (int i = 0; i < untranslated_top_ten; i++) {
@@ -2756,7 +2756,7 @@ void compiler_exit(void)
                dp = table68k + opcode_nums[i];
                for (lookup = lookuptab; lookup->mnemo != (instrmnem)dp->mnemo; lookup++)
                        ;
-               jit_log("%03d: %04x %10u %s", i, opcode_nums[i], count, lookup->name);
+               bug("%03d: %04x %10u %s", i, opcode_nums[i], count, lookup->name);
        }
 #endif