From: Toni Wilen Date: Sun, 3 Jun 2018 16:22:08 +0000 (+0300) Subject: Aranym JIT updates. (Partial only, non-merged LSL/LSR part is not yet UAE compatible) X-Git-Tag: 4000~30 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=7ad77e516fc7ff2ac2b1af1e52f24f059a14aa5d;p=francis%2Fwinuae.git Aranym JIT updates. (Partial only, non-merged LSL/LSR part is not yet UAE compatible) --- diff --git a/jit/compemu_midfunc_x86.cpp b/jit/compemu_midfunc_x86.cpp index d5e2e053..38e8bc93 100644 --- a/jit/compemu_midfunc_x86.cpp +++ b/jit/compemu_midfunc_x86.cpp @@ -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 */ diff --git a/jit/compemu_midfunc_x86.h b/jit/compemu_midfunc_x86.h index a0f5cf92..a477f6ed 100644 --- a/jit/compemu_midfunc_x86.h +++ b/jit/compemu_midfunc_x86.h @@ -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)); diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 3ca4d5fc..fc1eec21 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -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