Move GPF and early exit routines out of individual code blocks and into the common helper block.

This commit is contained in:
SarahW 2019-01-13 12:57:32 +00:00
commit 8998024225
21 changed files with 213 additions and 213 deletions

View file

@ -317,7 +317,7 @@ static int codegen_CALL_INSTRUCTION_FUNC(codeblock_t *block, uop_t *uop)
{
host_arm_call(block, uop->p);
host_arm_TST_REG(block, REG_R0, REG_R0);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -848,7 +848,7 @@ static int codegen_FP_ENTER(codeblock_t *block, uop_t *uop)
host_arm_STR_IMM(block, REG_TEMP, REG_CPUSTATE, (uintptr_t)&cpu_state.oldpc - (uintptr_t)&cpu_state);
host_arm_MOV_IMM(block, REG_ARG0, 7);
host_arm_call(block, x86_int);
host_arm_B(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_B(block, (uintptr_t)codegen_exit_rout);
*branch_ptr |= ((((uintptr_t)&block_write_data[block_pos] - (uintptr_t)branch_ptr) - 8) & 0x3fffffc) >> 2;
@ -869,7 +869,7 @@ static int codegen_MMX_ENTER(codeblock_t *block, uop_t *uop)
host_arm_STR_IMM(block, REG_TEMP, REG_CPUSTATE, (uintptr_t)&cpu_state.oldpc - (uintptr_t)&cpu_state);
host_arm_MOV_IMM(block, REG_ARG0, 7);
host_arm_call(block, x86_int);
host_arm_B(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_B(block, (uintptr_t)codegen_exit_rout);
*branch_ptr |= ((((uintptr_t)&block_write_data[block_pos] - (uintptr_t)branch_ptr) - 8) & 0x3fffffc) >> 2;
@ -951,7 +951,7 @@ static int codegen_LOAD_SEG(codeblock_t *block, uop_t *uop)
host_arm_MOV_IMM(block, REG_ARG1, (uint32_t)uop->p);
host_arm_call(block, loadseg);
host_arm_TST_REG(block, REG_R0, REG_R0);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -977,7 +977,7 @@ static int codegen_MEM_LOAD_ABS(codeblock_t *block, uop_t *uop)
else
fatal("MEM_LOAD_ABS - %02x\n", uop->dest_reg_a_real);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
if (REG_IS_B(dest_size))
{
host_arm_BFI(block, dest_reg, REG_R0, 0, 8);
@ -1025,7 +1025,7 @@ static int codegen_MEM_LOAD_REG(codeblock_t *block, uop_t *uop)
else
fatal("MEM_LOAD_REG - %02x\n", uop->dest_reg_a_real);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
if (REG_IS_B(dest_size))
{
host_arm_BFI(block, dest_reg, REG_R0, 0, 8);
@ -1062,7 +1062,7 @@ static int codegen_MEM_LOAD_SINGLE(codeblock_t *block, uop_t *uop)
host_arm_ADD_IMM(block, REG_R0, REG_R0, uop->imm_data);
host_arm_BL(block, (uintptr_t)codegen_mem_load_single);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
host_arm_VCVT_D_S(block, dest_reg, REG_D_TEMP);
return 0;
@ -1080,7 +1080,7 @@ static int codegen_MEM_LOAD_DOUBLE(codeblock_t *block, uop_t *uop)
host_arm_ADD_IMM(block, REG_R0, REG_R0, uop->imm_data);
host_arm_BL(block, (uintptr_t)codegen_mem_load_double);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
host_arm_VMOV_D_D(block, dest_reg, REG_D_TEMP);
return 0;
@ -1110,7 +1110,7 @@ static int codegen_MEM_STORE_ABS(codeblock_t *block, uop_t *uop)
else
fatal("MEM_STORE_ABS - %02x\n", uop->src_reg_b_real);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -1151,7 +1151,7 @@ static int codegen_MEM_STORE_REG(codeblock_t *block, uop_t *uop)
else
fatal("MEM_STORE_REG - %02x\n", uop->src_reg_c_real);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -1164,7 +1164,7 @@ static int codegen_MEM_STORE_IMM_8(codeblock_t *block, uop_t *uop)
host_arm_MOV_IMM(block, REG_R1, uop->imm_data);
host_arm_BL(block, (uintptr_t)codegen_mem_store_byte);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -1176,7 +1176,7 @@ static int codegen_MEM_STORE_IMM_16(codeblock_t *block, uop_t *uop)
host_arm_MOV_IMM(block, REG_R1, uop->imm_data);
host_arm_BL(block, (uintptr_t)codegen_mem_store_word);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -1188,7 +1188,7 @@ static int codegen_MEM_STORE_IMM_32(codeblock_t *block, uop_t *uop)
host_arm_MOV_IMM(block, REG_R1, uop->imm_data);
host_arm_BL(block, (uintptr_t)codegen_mem_store_long);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -1206,7 +1206,7 @@ static int codegen_MEM_STORE_SINGLE(codeblock_t *block, uop_t *uop)
host_arm_VCVT_S_D(block, REG_D_TEMP, src_reg);
host_arm_BL(block, (uintptr_t)codegen_mem_store_single);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}
@ -1224,7 +1224,7 @@ static int codegen_MEM_STORE_DOUBLE(codeblock_t *block, uop_t *uop)
host_arm_VMOV_D_D(block, REG_D_TEMP, src_reg);
host_arm_BL(block, (uintptr_t)codegen_mem_store_double);
host_arm_TST_REG(block, REG_R1, REG_R1);
host_arm_BNE(block, (uintptr_t)&block->data[BLOCK_EXIT_OFFSET]);
host_arm_BNE(block, (uintptr_t)codegen_exit_rout);
return 0;
}