Move GPF and early exit routines out of individual code blocks and into the common helper block.
This commit is contained in:
parent
966e74261b
commit
8998024225
21 changed files with 213 additions and 213 deletions
|
|
@ -203,7 +203,7 @@ static int codegen_CALL_INSTRUCTION_FUNC(codeblock_t *block, uop_t *uop)
|
|||
{
|
||||
host_x86_CALL(block, uop->p);
|
||||
host_x86_TEST32_REG(block, REG_EAX, REG_EAX);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
// host_x86_CALL(block, codegen_debug);
|
||||
|
||||
return 0;
|
||||
|
|
@ -730,7 +730,7 @@ static int codegen_FP_ENTER(codeblock_t *block, uop_t *uop)
|
|||
host_x86_MOV32_ABS_IMM(block, &cpu_state.oldpc, uop->imm_data);
|
||||
host_x86_MOV32_STACK_IMM(block, STACK_ARG0, 7);
|
||||
host_x86_CALL(block, x86_int);
|
||||
host_x86_JMP(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JMP(block, codegen_exit_rout);
|
||||
*branch_offset = (uint32_t)((uintptr_t)&block_write_data[block_pos] - (uintptr_t)branch_offset) - 4;
|
||||
|
||||
return 0;
|
||||
|
|
@ -746,7 +746,7 @@ static int codegen_MMX_ENTER(codeblock_t *block, uop_t *uop)
|
|||
host_x86_MOV32_ABS_IMM(block, &cpu_state.oldpc, uop->imm_data);
|
||||
host_x86_MOV32_STACK_IMM(block, STACK_ARG0, 7);
|
||||
host_x86_CALL(block, x86_int);
|
||||
host_x86_JMP(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JMP(block, codegen_exit_rout);
|
||||
*branch_offset = (uint32_t)((uintptr_t)&block_write_data[block_pos] - (uintptr_t)branch_offset) - 4;
|
||||
host_x86_MOV32_ABS_IMM(block, &cpu_state.tag[0], 0);
|
||||
host_x86_MOV32_ABS_IMM(block, &cpu_state.tag[4], 0);
|
||||
|
|
@ -831,7 +831,7 @@ static int codegen_LOAD_SEG(codeblock_t *block, uop_t *uop)
|
|||
host_x86_MOV32_STACK_IMM(block, STACK_ARG1, (uint32_t)uop->p);
|
||||
host_x86_CALL(block, loadseg);
|
||||
host_x86_TEST32_REG(block, REG_EAX, REG_EAX);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -857,7 +857,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_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
if (REG_IS_B(dest_size))
|
||||
{
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, REG_ECX);
|
||||
|
|
@ -900,7 +900,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_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
if (REG_IS_B(dest_size))
|
||||
{
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, REG_ECX);
|
||||
|
|
@ -933,7 +933,7 @@ static int codegen_MEM_LOAD_SINGLE(codeblock_t *block, uop_t *uop)
|
|||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_CALL(block, codegen_mem_load_single);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
host_x86_MOVQ_XREG_XREG(block, dest_reg, REG_XMM_TEMP);
|
||||
|
||||
return 0;
|
||||
|
|
@ -952,7 +952,7 @@ static int codegen_MEM_LOAD_DOUBLE(codeblock_t *block, uop_t *uop)
|
|||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_CALL(block, codegen_mem_load_double);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
host_x86_MOVQ_XREG_XREG(block, dest_reg, REG_XMM_TEMP);
|
||||
|
||||
return 0;
|
||||
|
|
@ -982,7 +982,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_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1018,7 +1018,7 @@ static int codegen_MEM_STORE_REG(codeblock_t *block, uop_t *uop)
|
|||
else
|
||||
fatal("MEM_STORE_REG - %02x\n", uop->src_reg_b_real);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1031,7 +1031,7 @@ static int codegen_MEM_STORE_IMM_8(codeblock_t *block, uop_t *uop)
|
|||
host_x86_MOV8_REG_IMM(block, REG_ECX, uop->imm_data);
|
||||
host_x86_CALL(block, codegen_mem_store_byte);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1043,7 +1043,7 @@ static int codegen_MEM_STORE_IMM_16(codeblock_t *block, uop_t *uop)
|
|||
host_x86_MOV16_REG_IMM(block, REG_ECX, uop->imm_data);
|
||||
host_x86_CALL(block, codegen_mem_store_word);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1055,7 +1055,7 @@ static int codegen_MEM_STORE_IMM_32(codeblock_t *block, uop_t *uop)
|
|||
host_x86_MOV32_REG_IMM(block, REG_ECX, uop->imm_data);
|
||||
host_x86_CALL(block, codegen_mem_store_long);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1074,7 +1074,7 @@ static int codegen_MEM_STORE_SINGLE(codeblock_t *block, uop_t *uop)
|
|||
host_x86_CVTSD2SS_XREG_XREG(block, REG_XMM_TEMP, src_reg);
|
||||
host_x86_CALL(block, codegen_mem_store_single);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1092,7 +1092,7 @@ static int codegen_MEM_STORE_DOUBLE(codeblock_t *block, uop_t *uop)
|
|||
host_x86_MOVQ_XREG_XREG(block, REG_XMM_TEMP, src_reg);
|
||||
host_x86_CALL(block, codegen_mem_store_double);
|
||||
host_x86_TEST32_REG(block, REG_ESI, REG_ESI);
|
||||
host_x86_JNZ(block, &block->data[BLOCK_EXIT_OFFSET]);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue