--- uae/src/compiler.c 2018/04/24 16:46:19 1.1.1.5 +++ uae/src/compiler.c 2018/04/24 17:05:49 1.1.1.8 @@ -15,7 +15,6 @@ #include "gui.h" #include "memory.h" #include "custom.h" -#include "readcpu.h" #include "newcpu.h" #include "ersatz.h" #include "blitter.h" @@ -209,7 +208,7 @@ static void forget_block(struct hash_blo freelist_block = hb; if (hb->cpage != NULL) - fprintf(stderr, "Discarding block with code. Tsk.\n"); + write_log ("Discarding block with code. Tsk.\n"); do { struct hash_entry *next = h->next_same_block; @@ -234,7 +233,7 @@ static void lru_touch_block(struct hash_ lru_first_block.lru_prev = h; } -static __inline__ int check_block(struct hash_block *hb) +STATIC_INLINE int check_block(struct hash_block *hb) { #ifndef RELY_ON_LOADSEG_DETECTION struct hash_entry *h = hb->he_first; @@ -270,7 +269,7 @@ uae_u32 flush_icache(void) void possible_loadseg(void) { - fprintf(stderr, "Possible LoadSeg() detected\n"); + write_log ("Possible LoadSeg() detected\n"); flush_icache(); } @@ -403,7 +402,7 @@ void special_flush_hash(uaecptr addr) h->cacheflush = 1; } -static __inline__ void m68k_setpc_hash(uaecptr newpc) +STATIC_INLINE void m68k_setpc_hash(uaecptr newpc) { struct hash_entry *h = get_hash(newpc); @@ -425,7 +424,7 @@ static __inline__ void m68k_setpc_hash(u regs.pc_p = regs.pc_oldp = get_real_address(newpc); } -static __inline__ void m68k_setpc_nohash(uaecptr newpc) +STATIC_INLINE void m68k_setpc_nohash(uaecptr newpc) { #if 0 /* This is probably not too good for efficiency... FIXME */ @@ -493,7 +492,7 @@ static void code_init(void) #define CC68K_N 2 #define CC68K_X 1 -static __inline__ int cc_flagmask_68k(const int cc) +STATIC_INLINE int cc_flagmask_68k(const int cc) { switch(cc){ case 0: return 0; /* T */ @@ -517,7 +516,7 @@ static __inline__ int cc_flagmask_68k(co return 0; } -static __inline__ void translate_step_over_ea(uae_u8 **pcpp, amodes m, +STATIC_INLINE void translate_step_over_ea(uae_u8 **pcpp, amodes m, wordsizes size) { switch (m) { @@ -727,18 +726,18 @@ static int m68k_scan_func(struct hash_en if (h->block != NULL && h->block != found_block) { if (found_block == NULL) { if (h->block->cpage != NULL) - fprintf(stderr, "Found compiled code\n"); + write_log ("Found compiled code\n"); else found_block = h->block; } else { - fprintf(stderr, "Multiple blocks found.\n"); + write_log ("Multiple blocks found.\n"); if (h->block->cpage == NULL) forget_block(h->block); else if (found_block->cpage == NULL) { forget_block(found_block); found_block = h->block; } else - fprintf(stderr, "Bad case.\n"); + write_log ("Bad case.\n"); } } #endif @@ -931,7 +930,7 @@ static struct bb_info *find_bb(struct ha if (bb_stack[i].h == h) return bb_stack + i; if (!quiet_compile) - fprintf(stderr, "BB not found!\n"); + write_log ("BB not found!\n"); return NULL; } @@ -1109,7 +1108,7 @@ static int m68k_scan_block(struct hash_b current_live |= bb->bb_next2->flags_live_at_start; } else { if (bb->bb_next1 == NULL && bb->bb_next2 == NULL) - fprintf(stderr, "Can't happen\n"); + write_log ("Can't happen\n"); current_live = 0; if (bb->bb_next1 != NULL) current_live |= bb->bb_next1->flags_live_at_start; @@ -1124,7 +1123,7 @@ static int m68k_scan_block(struct hash_b } while (iip-- != bb->first_iip); if (bb->flags_live_at_start != current_live && !quiet_compile) - fprintf(stderr, "Fascinating %d!\n", round), changed = 1; + write_log ("Fascinating %d!\n", round), changed = 1; bb->flags_live_at_start = current_live; } round++; @@ -1187,7 +1186,7 @@ void m68k_do_bsr(uaecptr oldpc, uae_s32 static char *compile_current_addr; static char *compile_last_addr; -static __inline__ void assemble(uae_u8 a) +STATIC_INLINE void assemble(uae_u8 a) { if (compile_current_addr < compile_last_addr) { *compile_current_addr++ = a; @@ -1196,7 +1195,7 @@ static __inline__ void assemble(uae_u8 a } } -static __inline__ void assemble_ulong(uae_u32 a) +STATIC_INLINE void assemble_ulong(uae_u32 a) { assemble(a); assemble(a >> 8); @@ -1204,7 +1203,7 @@ static __inline__ void assemble_ulong(ua assemble(a >> 24); } -static __inline__ void assemble_ulong_68k(uae_u32 a) +STATIC_INLINE void assemble_ulong_68k(uae_u32 a) { assemble(a >> 24); assemble(a >> 16); @@ -1212,23 +1211,23 @@ static __inline__ void assemble_ulong_68 assemble(a); } -static __inline__ void assemble_uword(uae_u16 a) +STATIC_INLINE void assemble_uword(uae_u16 a) { assemble(a); assemble(a >> 8); } -static __inline__ void assemble_long(void *a) +STATIC_INLINE void assemble_long(void *a) { assemble_ulong((uae_u32)a); } -static __inline__ void compile_org(char *addr) +STATIC_INLINE void compile_org(char *addr) { compile_current_addr = addr; } -static __inline__ char *compile_here(void) +STATIC_INLINE char *compile_here(void) { return compile_current_addr; } @@ -1292,7 +1291,7 @@ static void compile_move_reg_reg(int dst && (((1 << dstreg) & DATA_X86_REGS) == 0 || ((1 << srcreg) & DATA_X86_REGS) == 0)) { - fprintf(stderr, "Moving wrong register types!\n"); + write_log ("Moving wrong register types!\n"); } if (size == sz_word) assemble(0x66); @@ -1313,7 +1312,7 @@ static void compile_move_between_reg_mem && ((1 << dstreg) & DATA_X86_REGS) == 0) || (size != sz_byte && (dstreg & 0x80) != 0)) { - fprintf(stderr, "Moving wrong register types!\n"); + write_log ("Moving wrong register types!\n"); } if (size == sz_word) assemble(0x66); @@ -2030,7 +2029,7 @@ static void compile_get_excl_lock(struct * 386 instruction. */ -static __inline__ int rmop_long(struct ea_info *eai) +STATIC_INLINE int rmop_long(struct ea_info *eai) { if (eai->data_reg == -2) printf("rmop for const\n"); @@ -2060,7 +2059,7 @@ static __inline__ int rmop_long(struct e return 0; } -static __inline__ int rmop_short(struct ea_info *eai) +STATIC_INLINE int rmop_short(struct ea_info *eai) { if (eai->data_reg == -2) printf("rmop_short for const\n"); @@ -2076,7 +2075,7 @@ static __inline__ int rmop_short(struct return 0; } -static __inline__ void rmop_finalize(struct ea_info *eai) +STATIC_INLINE void rmop_finalize(struct ea_info *eai) { if (eai->data_reg == -2) assemble_ulong(eai->data_const_off); @@ -3054,7 +3053,7 @@ static int compile_flush_cc_cache(struct live_at_end &= ~CC68K_X; if (status == CC_C_FROM_86C && (live_at_end & CC68K_C) != 0) - fprintf(stderr, "Shouldn't be needing C here!\n"); + write_log ("Shouldn't be needing C here!\n"); else if (live_at_end) { if ((live_at_end & CC68K_X) == 0) status &= ~CC_X_FROM_86C; @@ -4517,7 +4516,7 @@ static int m68k_compile_block(struct has while ((allocmask & hb->page_allocmask) != allocmask) allocmask <<= 1; if ((hb->page_allocmask & ~allocmask) != 0 && !quiet_compile) - fprintf(stderr, "Gaining some bits: %08lx\n", hb->page_allocmask & ~allocmask); + write_log ("Gaining some bits: %08lx\n", hb->page_allocmask & ~allocmask); hb->cpage->allocmask &= ~hb->page_allocmask; hb->page_allocmask = allocmask; hb->cpage->allocmask |= allocmask; @@ -4526,7 +4525,7 @@ static int m68k_compile_block(struct has oops: if (1 || !quiet_compile) - fprintf(stderr, "Compile failed!\n"); + write_log ("Compile failed!\n"); hb->cpage->allocmask &= ~hb->page_allocmask; hb->cpage = NULL; hb->untranslatable = 1;