From: Frode Solheim Date: Sun, 6 Sep 2015 19:51:54 +0000 (+0200) Subject: JIT: DO_GET_OPCODE X-Git-Tag: 3200~79^2~31 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=fc5c7ec66beaf97e4b2e224b01a34e45be53c0c8;p=francis%2Fwinuae.git JIT: DO_GET_OPCODE --- diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 25a0845d..beb4a90a 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -3415,12 +3415,59 @@ void flush_icache(uaecptr ptr, int n) /* static void catastrophe(void) { - jit_abort(_T("catastprophe")); + jit_abort("catastprophe"); } */ int failure; +#define TARGET_M68K 0 +#define TARGET_POWERPC 1 +#define TARGET_X86 2 +#define TARGET_X86_64 3 +#define TARGET_ARM 4 +#if defined(CPU_i386) +#define TARGET_NATIVE TARGET_X86 +#endif +#if defined(CPU_powerpc) +#define TARGET_NATIVE TARGET_POWERPC +#endif +#if defined(CPU_x86_64) +#define TARGET_NATIVE TARGET_X86_64 +#endif +#if defined(CPU_arm) +#define TARGET_NATIVE TARGET_ARM +#endif + +#ifdef UAE +#else +void disasm_block(int /* target */, uint8 * /* start */, size_t /* length */) +{ + if (!JITDebug) + return; +} + +static inline void disasm_native_block(uint8 *start, size_t length) +{ + disasm_block(TARGET_NATIVE, start, length); +} + +static inline void disasm_m68k_block(uint8 *start, size_t length) +{ + disasm_block(TARGET_M68K, start, length); +} +#endif + +#ifdef UAE +#define DO_GET_OPCODE(a) (cft_map((uae_u16)*(a))) +#else +#ifdef HAVE_GET_WORD_UNSWAPPED +# define DO_GET_OPCODE(a) (do_get_mem_word_unswapped((uae_u16 *)(a))) +#else +# define DO_GET_OPCODE(a) (do_get_mem_word((uae_u16 *)(a))) +#endif +#endif + #ifdef JIT_DEBUG static uae_u8 *last_regs_pc_p = 0; static uae_u8 *last_compiled_block_addr = 0; @@ -3528,7 +3575,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) i=blocklen; while (i--) { uae_u16* currpcp=pc_hist[i].location; - int op=cft_map(*currpcp); + uae_u32 op=DO_GET_OPCODE(currpcp); #if USE_CHECKSUM_INFO trace_in_rom = trace_in_rom && isinrom((uintptr)currpcp); @@ -3609,9 +3656,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) get_target_noopt()