From: Frode Solheim Date: Sun, 6 Sep 2015 20:26:19 +0000 (+0200) Subject: JIT: merge a bit more code, added compemu_midfunc_x86.h X-Git-Tag: 3200~79^2~19 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=0a9180f12e76302d58f43e4834dcd34c493350b3;p=francis%2Fwinuae.git JIT: merge a bit more code, added compemu_midfunc_x86.h --- diff --git a/jit/codegen_x86.cpp b/jit/codegen_x86.cpp index 5a38cc2e..ae2e6071 100644 --- a/jit/codegen_x86.cpp +++ b/jit/codegen_x86.cpp @@ -3149,6 +3149,7 @@ static inline void raw_inc_sp(int off) #include "exception_handler.cpp" #endif +static void compiler_status() { jit_log("compiled code starts at %p, current at %08x", compiled_code, (unsigned int)(current_compile_p - compiled_code)); } @@ -3403,6 +3404,7 @@ raw_init_cpu(void) if (tune_alignment) { align_loops = x86_alignments[c->x86_processor].align_loop; #ifdef UAE + /* FIXME: using hard-coded align_jumps right now */ #else align_jumps = x86_alignments[c->x86_processor].align_jump; #endif diff --git a/jit/compemu.h b/jit/compemu.h index 3716ea8d..dca34dcf 100644 --- a/jit/compemu.h +++ b/jit/compemu.h @@ -98,6 +98,15 @@ extern void alloc_cache(void); extern void compile_block(cpu_history* pc_hist, int blocklen, int totcyles); extern int check_for_cache_miss(void); +static inline void flush_icache(int n) +{ + flush_icache(0, n); +} + +static inline void flush_icache_hard(int n) +{ + flush_icache(0, n); +} #define scaled_cycles(x) (currprefs.m68k_speed<0?(((x)/SCALE)?(((x)/SCALE BlockInfoAllocator; +static LazyBlockAllocator ChecksumInfoAllocator; +#else +static HardBlockAllocator BlockInfoAllocator; +static HardBlockAllocator ChecksumInfoAllocator; +#endif + +static inline checksum_info *alloc_checksum_info(void) +{ + checksum_info *csi = ChecksumInfoAllocator.acquire(); + csi->next = NULL; + return csi; +} + +static inline void free_checksum_info(checksum_info *csi) +{ + csi->next = NULL; + ChecksumInfoAllocator.release(csi); +} + +static inline void free_checksum_info_chain(checksum_info *csi) +{ + while (csi != NULL) { + checksum_info *csi2 = csi->next; + free_checksum_info(csi); + csi = csi2; + } +} + +static inline blockinfo *alloc_blockinfo(void) +{ + blockinfo *bi = BlockInfoAllocator.acquire(); +#if USE_CHECKSUM_INFO + bi->csi = NULL; +#endif + return bi; +} + +static inline void free_blockinfo(blockinfo *bi) +{ +#if USE_CHECKSUM_INFO + free_checksum_info_chain(bi->csi); + bi->csi = NULL; +#endif + BlockInfoAllocator.release(bi); +} static inline void alloc_blockinfos(void) { @@ -1103,6 +1151,7 @@ static uae_s8 nstate[N_REGS]; #ifdef UAE static inline void big_to_small_state(bigstate* b, smallstate* s) { + /* FIXME: replace with ARAnyM version */ int i; int count=0; @@ -2260,6 +2309,7 @@ static void fflags_into_flags_internal(uae_u32 tmp) ********************************************************************/ #ifdef UAE +/* FIXME: implement */ #else void set_zero(int r, int tmp) { @@ -2317,13 +2367,24 @@ static inline const char *str_on_off(bool b) return b ? "on" : "off"; } +static void compiler_init(void) { static bool initialized = false; if (initialized) return; + +#if PROFILE_UNTRANSLATED_INSNS + panicbug(" : gather statistics on untranslated insns count"); +#endif + +#if PROFILE_COMPILE_TIME + panicbug(" : gather statistics on translation time"); + emul_start_time = clock(); +#endif } +static void compiler_exit(void) { #if PROFILE_COMPILE_TIME @@ -2404,6 +2465,11 @@ void init_comp(void) uae_u8* cw=can_word; uae_u8* au=always_used; +#ifdef RECORD_REGISTER_USAGE + for (i=0;i<16;i++) + reg_count_local[i] = 0; +#endif + for (i=0;i