Fix zero sized recompiled shifts. Fixes hang in Gunmetal.
This commit is contained in:
parent
e8f39da459
commit
12d73e8a95
4 changed files with 26 additions and 4 deletions
|
|
@ -1455,6 +1455,11 @@ static int codegen_MOV_INT_DOUBLE_64(codeblock_t *block, uop_t *uop)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int codegen_NOP(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int codegen_OR(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_a = HOST_REG_GET(uop->src_reg_a_real), src_reg_b = HOST_REG_GET(uop->src_reg_b_real);
|
||||
|
|
@ -2979,7 +2984,9 @@ const uOpFn uop_handlers[UOP_MAX] =
|
|||
[UOP_PUNPCKHDQ & UOP_MASK] = codegen_PUNPCKHDQ,
|
||||
[UOP_PUNPCKLBW & UOP_MASK] = codegen_PUNPCKLBW,
|
||||
[UOP_PUNPCKLWD & UOP_MASK] = codegen_PUNPCKLWD,
|
||||
[UOP_PUNPCKLDQ & UOP_MASK] = codegen_PUNPCKLDQ
|
||||
[UOP_PUNPCKLDQ & UOP_MASK] = codegen_PUNPCKLDQ,
|
||||
|
||||
[UOP_NOP_BARRIER & UOP_MASK] = codegen_NOP
|
||||
};
|
||||
|
||||
void codegen_direct_read_8(codeblock_t *block, int host_reg, void *p)
|
||||
|
|
|
|||
|
|
@ -1451,6 +1451,11 @@ static int codegen_MOV_INT_DOUBLE_64(codeblock_t *block, uop_t *uop)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int codegen_NOP(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int codegen_OR(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_a = HOST_REG_GET(uop->src_reg_a_real), src_reg_b = HOST_REG_GET(uop->src_reg_b_real);
|
||||
|
|
@ -2980,6 +2985,8 @@ const uOpFn uop_handlers[UOP_MAX] =
|
|||
[UOP_PUNPCKLWD & UOP_MASK] = codegen_PUNPCKLWD,
|
||||
[UOP_PUNPCKLDQ & UOP_MASK] = codegen_PUNPCKLDQ,
|
||||
|
||||
[UOP_NOP_BARRIER & UOP_MASK] = codegen_NOP,
|
||||
|
||||
#ifdef DEBUG_EXTRA
|
||||
[UOP_LOG_INSTR & UOP_MASK] = codegen_LOG_INSTR
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#define UOP_CALL_FUNC_RESULT (UOP_TYPE_PARAMS_REGS | UOP_TYPE_PARAMS_POINTER | 0x16 | UOP_TYPE_BARRIER)
|
||||
/*UOP_JMP_DEST - jump to ptr*/
|
||||
#define UOP_JMP_DEST (UOP_TYPE_PARAMS_IMM | UOP_TYPE_PARAMS_POINTER | 0x17 | UOP_TYPE_ORDER_BARRIER | UOP_TYPE_JUMP)
|
||||
#define UOP_NOP_BARRIER (UOP_TYPE_BARRIER | 0x18)
|
||||
|
||||
#ifdef DEBUG_EXTRA
|
||||
/*UOP_LOG_INSTR - log non-recompiled instruction in imm_data*/
|
||||
|
|
@ -699,6 +700,8 @@ static inline void uop_gen_reg_src2_pointer(uint32_t uop_type, ir_data_t *ir, in
|
|||
#define uop_MOV_INT_DOUBLE(ir, dst_reg, src_reg/*, nrc, orc*/) uop_gen_reg_dst_src1(UOP_MOV_INT_DOUBLE, ir, dst_reg, src_reg/*, nrc, orc*/)
|
||||
#define uop_MOV_INT_DOUBLE_64(ir, dst_reg, src_reg_d, src_reg_q, tag) uop_gen_reg_dst_src3(UOP_MOV_INT_DOUBLE_64, ir, dst_reg, src_reg_d, src_reg_q, tag)
|
||||
|
||||
#define uop_NOP_BARRIER(ir) uop_gen(UOP_NOP_BARRIER, ir)
|
||||
|
||||
#define uop_PACKSSWB(ir, dst_reg, src_reg_a, src_reg_b) uop_gen_reg_dst_src2(UOP_PACKSSWB, ir, dst_reg, src_reg_a, src_reg_b)
|
||||
#define uop_PACKSSDW(ir, dst_reg, src_reg_a, src_reg_b) uop_gen_reg_dst_src2(UOP_PACKSSDW, ir, dst_reg, src_reg_a, src_reg_b)
|
||||
#define uop_PACKUSWB(ir, dst_reg, src_reg_a, src_reg_b) uop_gen_reg_dst_src2(UOP_PACKUSWB, ir, dst_reg, src_reg_a, src_reg_b)
|
||||
|
|
|
|||
|
|
@ -496,12 +496,17 @@ uint32_t ropC1_l(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fet
|
|||
}
|
||||
if (block->flags & CODEBLOCK_NO_IMMEDIATES)
|
||||
{
|
||||
uint32_t new_pc;
|
||||
int jump_uop;
|
||||
|
||||
LOAD_IMMEDIATE_FROM_RAM_8(block, ir, IREG_temp2, cs + op_pc + 1);
|
||||
|
||||
uop_AND_IMM(ir, IREG_temp2, IREG_temp2, 0x1f);
|
||||
uop_CMP_IMM_JZ(ir, IREG_temp2, 0, codegen_exit_rout);
|
||||
jump_uop = uop_CMP_IMM_JZ_DEST(ir, IREG_temp2, 0);
|
||||
|
||||
return shift_common_variable_32(ir, fetchdat, op_pc, target_seg, IREG_temp2) + 1;
|
||||
new_pc = shift_common_variable_32(ir, fetchdat, op_pc, target_seg, IREG_temp2) + 1;
|
||||
uop_NOP_BARRIER(ir);
|
||||
uop_set_jump_dest(ir, jump_uop);
|
||||
return new_pc;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue