Merge latest TomB version as of 22 August 2016

This commit is contained in:
Chips 2016-08-27 20:39:53 +02:00
parent 2d3da3d49e
commit 975a634a38
147 changed files with 16789 additions and 10817 deletions

View file

@ -103,17 +103,19 @@ uae_u8 call_saved[]={0,0,0,0, 1,1,1,1, 1,1,1,1, 0,1,1,1};
- Special registers (such like the stack pointer) should not be "preserved"
by pushing, even though they are "saved" across function calls
*/
static const uae_u8 need_to_preserve[]={0,0,0,0, 1,1,1,1, 1,1,1,1, 0,0,0,0};
/* Without save and restore R12, we sometimes get seg faults when entering gui...
Don't understand why. */
static const uae_u8 need_to_preserve[]={0,0,0,0, 1,1,1,1, 1,1,1,1, 1,0,0,0};
static const uae_u32 PRESERVE_MASK = ((1<<R4_INDEX)|(1<<R5_INDEX)|(1<<R6_INDEX)|(1<<R7_INDEX)|(1<<R8_INDEX)|(1<<R9_INDEX)
|(1<<R10_INDEX)|(1<<R11_INDEX));
|(1<<R10_INDEX)|(1<<R11_INDEX)|(1<<R12_INDEX));
#include "codegen_arm.h"
static inline void UNSIGNED8_IMM_2_REG(W4 r, IMM v) {
STATIC_INLINE void UNSIGNED8_IMM_2_REG(W4 r, IMM v) {
MOV_ri8(r, (uae_u8) v);
}
static inline void SIGNED8_IMM_2_REG(W4 r, IMM v) {
STATIC_INLINE void SIGNED8_IMM_2_REG(W4 r, IMM v) {
if (v & 0x80) {
MVN_ri8(r, (uae_u8) ~v);
} else {
@ -121,7 +123,7 @@ static inline void SIGNED8_IMM_2_REG(W4 r, IMM v) {
}
}
static inline void UNSIGNED16_IMM_2_REG(W4 r, IMM v) {
STATIC_INLINE void UNSIGNED16_IMM_2_REG(W4 r, IMM v) {
#ifdef ARMV6T2
MOVW_ri16(r, v);
#else
@ -130,7 +132,7 @@ static inline void UNSIGNED16_IMM_2_REG(W4 r, IMM v) {
#endif
}
static inline void SIGNED16_IMM_2_REG(W4 r, IMM v) {
STATIC_INLINE void SIGNED16_IMM_2_REG(W4 r, IMM v) {
#ifdef ARMV6T2
MOVW_ri16(r, v);
SXTH_rr(r, r);
@ -140,19 +142,19 @@ static inline void SIGNED16_IMM_2_REG(W4 r, IMM v) {
#endif
}
static inline void UNSIGNED8_REG_2_REG(W4 d, RR4 s) {
STATIC_INLINE void UNSIGNED8_REG_2_REG(W4 d, RR4 s) {
UXTB_rr(d, s);
}
static inline void SIGNED8_REG_2_REG(W4 d, RR4 s) {
STATIC_INLINE void SIGNED8_REG_2_REG(W4 d, RR4 s) {
SXTB_rr(d, s);
}
static inline void UNSIGNED16_REG_2_REG(W4 d, RR4 s) {
STATIC_INLINE void UNSIGNED16_REG_2_REG(W4 d, RR4 s) {
UXTH_rr(d, s);
}
static inline void SIGNED16_REG_2_REG(W4 d, RR4 s) {
STATIC_INLINE void SIGNED16_REG_2_REG(W4 d, RR4 s) {
SXTH_rr(d, s);
}
@ -378,7 +380,7 @@ LOWFUNC(WRITE,NONE,2,raw_sub_w_ri,(RW2 d, IMM i))
LENDFUNC(WRITE,NONE,2,raw_sub_w_ri,(RW2 d, IMM i))
static inline void raw_dec_sp(int off)
STATIC_INLINE void raw_dec_sp(int off)
{
if (off) {
if(CHECK32(off)) {
@ -393,7 +395,7 @@ static inline void raw_dec_sp(int off)
}
}
static inline void raw_inc_sp(int off)
STATIC_INLINE void raw_inc_sp(int off)
{
if (off) {
if(CHECK32(off)) {
@ -408,20 +410,20 @@ static inline void raw_inc_sp(int off)
}
}
static inline void raw_push_regs_to_preserve(void) {
STATIC_INLINE void raw_push_regs_to_preserve(void) {
PUSH_REGS(PRESERVE_MASK);
}
static inline void raw_pop_preserved_regs(void) {
STATIC_INLINE void raw_pop_preserved_regs(void) {
POP_REGS(PRESERVE_MASK);
}
static inline void raw_load_flagx(uae_u32 t, uae_u32 r)
STATIC_INLINE void raw_load_flagx(uae_u32 t, uae_u32 r)
{
LDR_rRI(t, R_REGSTRUCT, 17 * 4); // X flag are next to 8 Dregs, 8 Aregs and CPSR in struct regstruct
}
static inline void raw_flags_evicted(int r)
STATIC_INLINE void raw_flags_evicted(int r)
{
live.state[FLAGTMP].status = INMEM;
live.state[FLAGTMP].realreg = -1;
@ -433,22 +435,22 @@ static inline void raw_flags_evicted(int r)
live.nat[r].nholds = 0;
}
static inline void raw_flags_init(void) {
STATIC_INLINE void raw_flags_init(void) {
}
static inline void raw_flags_to_reg(int r)
STATIC_INLINE void raw_flags_to_reg(int r)
{
MRS_CPSR(r);
STR_rRI(r, R_REGSTRUCT, 16 * 4); // Flags are next to 8 Dregs and 8 Aregs in struct regstruct
raw_flags_evicted(r);
}
static inline void raw_reg_to_flags(int r)
STATIC_INLINE void raw_reg_to_flags(int r)
{
MSR_CPSRf_r(r);
}
static inline void raw_load_flagreg(uae_u32 t, uae_u32 r)
STATIC_INLINE void raw_load_flagreg(uae_u32 t, uae_u32 r)
{
LDR_rRI(t, R_REGSTRUCT, 16 * 4); // Flags are next to 8 Dregs and 8 Aregs in struct regstruct
}
@ -460,12 +462,12 @@ static inline void raw_load_flagreg(uae_u32 t, uae_u32 r)
#define FLAG_NREG1 -1
#define FLAG_NREG3 -1
static inline void raw_fflags_into_flags(int r)
STATIC_INLINE void raw_fflags_into_flags(int r)
{
jit_unimplemented("raw_fflags_into_flags %x", r);
}
static inline void raw_fp_init(void)
STATIC_INLINE void raw_fp_init(void)
{
#ifdef USE_JIT_FPU
int i;
@ -477,7 +479,7 @@ static inline void raw_fp_init(void)
}
// Verify
static inline void raw_fp_cleanup_drop(void)
STATIC_INLINE void raw_fp_cleanup_drop(void)
{
#ifdef USE_JIT_FPU
D(panicbug("raw_fp_cleanup_drop"));
@ -516,13 +518,13 @@ LOWFUNC(NONE,NONE,2,raw_fmov_rr,(FW d, FR s))
}
LENDFUNC(NONE,NONE,2,raw_fmov_rr,(FW d, FR s))
static inline void raw_emit_nop_filler(int nbytes)
STATIC_INLINE void raw_emit_nop_filler(int nbytes)
{
nbytes >>= 2;
while(nbytes--) { NOP(); }
}
static inline void raw_emit_nop(void)
STATIC_INLINE void raw_emit_nop(void)
{
NOP();
}
@ -872,7 +874,7 @@ LOWFUNC(WRITE,NONE,2,compemu_raw_test_l_rr,(RR4 d, RR4 s))
}
LENDFUNC(WRITE,NONE,2,compemu_raw_test_l_rr,(RR4 d, RR4 s))
static inline void compemu_raw_call(uae_u32 t)
STATIC_INLINE void compemu_raw_call(uae_u32 t)
{
#ifdef ARMV6T2
MOVW_ri16(REG_WORK1, t);
@ -886,14 +888,14 @@ static inline void compemu_raw_call(uae_u32 t)
POP(RLR_INDEX);
}
static inline void compemu_raw_call_r(RR4 r)
STATIC_INLINE void compemu_raw_call_r(RR4 r)
{
PUSH(RLR_INDEX);
BLX_r(r);
POP(RLR_INDEX);
}
static inline void compemu_raw_jcc_l_oponly(int cc)
STATIC_INLINE void compemu_raw_jcc_l_oponly(int cc)
{
switch (cc) {
case 9: // LS
@ -920,7 +922,7 @@ static inline void compemu_raw_jcc_l_oponly(int cc)
// emit of target will be done by caller
}
static inline void compemu_raw_jl(uae_u32 t)
STATIC_INLINE void compemu_raw_jl(uae_u32 t)
{
#ifdef ARMV6T2
MOVW_ri16(REG_WORK1, t);
@ -932,13 +934,13 @@ static inline void compemu_raw_jl(uae_u32 t)
#endif
}
static inline void compemu_raw_jmp(uae_u32 t)
STATIC_INLINE void compemu_raw_jmp(uae_u32 t)
{
LDR_rRI(RPC_INDEX, RPC_INDEX, -4);
emit_long(t);
}
static inline void compemu_raw_jmp_m_indexed(uae_u32 base, uae_u32 r, uae_u32 m)
STATIC_INLINE void compemu_raw_jmp_m_indexed(uae_u32 base, uae_u32 r, uae_u32 m)
{
int shft;
switch(m) {
@ -954,12 +956,12 @@ static inline void compemu_raw_jmp_m_indexed(uae_u32 base, uae_u32 r, uae_u32 m)
emit_long(base);
}
static inline void compemu_raw_jmp_r(RR4 r)
STATIC_INLINE void compemu_raw_jmp_r(RR4 r)
{
BX_r(r);
}
static inline void compemu_raw_jnz(uae_u32 t)
STATIC_INLINE void compemu_raw_jnz(uae_u32 t)
{
#ifdef ARMV6T2
BEQ_i(1);
@ -971,12 +973,12 @@ static inline void compemu_raw_jnz(uae_u32 t)
#endif
}
static inline void compemu_raw_jz_b_oponly(void)
STATIC_INLINE void compemu_raw_jz_b_oponly(void)
{
BEQ_i(0); // Real distance set by caller
}
static inline void compemu_raw_branch(IMM d)
STATIC_INLINE void compemu_raw_branch(IMM d)
{
B_i((d >> 2) - 1);
}

File diff suppressed because it is too large Load diff

View file

@ -463,7 +463,7 @@ MENDFUNC(2,arm_SUB_l_ri8,(RW4 d, IMM i))
// Other
static inline void flush_cpu_icache(void *start, void *stop)
STATIC_INLINE void flush_cpu_icache(void *start, void *stop)
{
register void *_beg __asm ("a1") = start;
register void *_end __asm ("a2") = stop;
@ -480,11 +480,11 @@ static inline void flush_cpu_icache(void *start, void *stop)
#endif
}
static inline void write_jmp_target(uae_u32* jmpaddr, cpuop_func* a) {
STATIC_INLINE void write_jmp_target(uae_u32* jmpaddr, cpuop_func* a) {
*(jmpaddr) = (uae_u32)a;
flush_cpu_icache((void *)jmpaddr, (void *)&jmpaddr[1]);
}
static inline void emit_jmp_target(uae_u32 a) {
STATIC_INLINE void emit_jmp_target(uae_u32 a) {
emit_long((uae_u32)a);
}

View file

@ -606,20 +606,20 @@ static HardBlockAllocator<blockinfo> BlockInfoAllocator;
static HardBlockAllocator<checksum_info> ChecksumInfoAllocator;
#endif
static inline checksum_info *alloc_checksum_info(void)
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)
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)
STATIC_INLINE void free_checksum_info_chain(checksum_info *csi)
{
while (csi != NULL) {
checksum_info *csi2 = csi->next;
@ -628,7 +628,7 @@ static inline void free_checksum_info_chain(checksum_info *csi)
}
}
static inline blockinfo *alloc_blockinfo(void)
STATIC_INLINE blockinfo *alloc_blockinfo(void)
{
blockinfo *bi = BlockInfoAllocator.acquire();
#if USE_CHECKSUM_INFO
@ -637,7 +637,7 @@ static inline blockinfo *alloc_blockinfo(void)
return bi;
}
static inline void free_blockinfo(blockinfo *bi)
STATIC_INLINE void free_blockinfo(blockinfo *bi)
{
#if USE_CHECKSUM_INFO
free_checksum_info_chain(bi->csi);
@ -736,7 +736,7 @@ static uae_u32 data_buffers_used = 0;
static uae_s32 data_natmem_pos = 0;
static inline void compemu_raw_branch(IMM d);
STATIC_INLINE void compemu_raw_branch(IMM d);
STATIC_INLINE void data_check_end(uae_s32 n, uae_s32 codesize)
{
@ -2746,7 +2746,7 @@ void compemu_reset(void)
}
// OPCODE is in big endian format, use cft_map() beforehand, if needed.
static inline void reset_compop(int opcode)
STATIC_INLINE void reset_compop(int opcode)
{
compfunctbl[opcode] = NULL;
nfcompfunctbl[opcode] = NULL;
@ -2771,7 +2771,7 @@ void build_comp(void)
for (opcode = 0; opcode < 65536; opcode++) {
reset_compop(opcode);
#ifdef NOFLAGS_SUPPORT
nfcpufunctbl[opcode] = op_illg;
nfcpufunctbl[opcode] = _op_illg;
#endif
prop[opcode].use_flags = 0x1f;
prop[opcode].set_flags = 0x1f;
@ -2920,7 +2920,7 @@ static void flush_icache_hard(uaecptr ptr, int n)
#endif
current_compile_p = compiled_code;
set_special(regs, 0); /* To get out of compiled code */
set_special(0); /* To get out of compiled code */
}
@ -2970,7 +2970,7 @@ STATIC_INLINE void flush_icache_lazy(uaecptr ptr, int n)
int failure;
static inline unsigned int get_opcode_cft_map(unsigned int f)
STATIC_INLINE unsigned int get_opcode_cft_map(unsigned int f)
{
return ((f >> 8) & 255) | ((f & 255) << 8);
}

View file

@ -1796,7 +1796,11 @@ extern const struct comptbl op_smalltbl_0_comp_ff[] = {
{ NULL, 0x00000000, 61424 }, /* BFINS */
{ NULL, 0x00000000, 61432 }, /* BFINS */
{ NULL, 0x00000000, 61433 }, /* BFINS */
{ NULL, 0x00000001, 61440 }, /* MMUOP030 */
{ NULL, 0x00000001, 61448 }, /* MMUOP030 */
{ NULL, 0x00000001, 61456 }, /* MMUOP030 */
{ NULL, 0x00000001, 61464 }, /* MMUOP030 */
{ NULL, 0x00000001, 61472 }, /* MMUOP030 */
{ NULL, 0x00000001, 61480 }, /* MMUOP030 */
{ NULL, 0x00000001, 61488 }, /* MMUOP030 */
{ NULL, 0x00000001, 61496 }, /* MMUOP030 */
@ -3665,7 +3669,11 @@ extern const struct comptbl op_smalltbl_0_comp_nf[] = {
{ NULL, 0x00000000, 61424 }, /* BFINS */
{ NULL, 0x00000000, 61432 }, /* BFINS */
{ NULL, 0x00000000, 61433 }, /* BFINS */
{ NULL, 0x00000001, 61440 }, /* MMUOP030 */
{ NULL, 0x00000001, 61448 }, /* MMUOP030 */
{ NULL, 0x00000001, 61456 }, /* MMUOP030 */
{ NULL, 0x00000001, 61464 }, /* MMUOP030 */
{ NULL, 0x00000001, 61472 }, /* MMUOP030 */
{ NULL, 0x00000001, 61480 }, /* MMUOP030 */
{ NULL, 0x00000001, 61488 }, /* MMUOP030 */
{ NULL, 0x00000001, 61496 }, /* MMUOP030 */

View file

@ -270,7 +270,7 @@ finish_braces(void)
close_brace();
}
static inline void gen_update_next_handler(void)
static __inline__ void gen_update_next_handler(void)
{
return; /* Can anything clever be done here? */
}
@ -3021,11 +3021,11 @@ generate_one_opcode(int rp, int noflags)
if (noflags) {
fprintf(stblfile, "{ op_%lx_%d_comp_nf, 0x%08x, %ld }, /* %s */\n", opcode, postfix, flags, opcode, name);
fprintf(headerfile, "extern compop_func op_%lx_%d_comp_nf;\n", opcode, postfix);
printf("unsigned long REGPARAM2 op_%lx_%d_comp_nf(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
printf("uae_u32 REGPARAM2 op_%lx_%d_comp_nf(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
} else {
fprintf(stblfile, "{ op_%lx_%d_comp_ff, 0x%08x, %ld }, /* %s */\n", opcode, postfix, flags, opcode, name);
fprintf(headerfile, "extern compop_func op_%lx_%d_comp_ff;\n", opcode, postfix);
printf("unsigned long REGPARAM2 op_%lx_%d_comp_ff(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
printf("uae_u32 REGPARAM2 op_%lx_%d_comp_ff(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
}
com_flush();
}