Remove fake 3-operand instructions in x86 backend.
This commit is contained in:
parent
f0225d2710
commit
b018dc1005
4 changed files with 157 additions and 240 deletions
|
|
@ -40,19 +40,19 @@ static int codegen_ADD(codeblock_t *block, uop_t *uop)
|
|||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_LEA_REG_REG(block, dest_reg, src_reg_a, src_reg_b);
|
||||
else
|
||||
host_x86_ADD32_REG_REG(block, dest_reg, src_reg_a, src_reg_b);
|
||||
host_x86_ADD32_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size_a) && REG_IS_W(src_size_b))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_ADD16_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_ADD16_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size_a) && REG_IS_B(src_size_b))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_ADD8_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_ADD8_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -71,19 +71,19 @@ static int codegen_ADD_IMM(codeblock_t *block, uop_t *uop)
|
|||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_LEA_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
else
|
||||
host_x86_ADD32_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
host_x86_ADD32_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_ADD16_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_ADD16_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_ADD8_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_ADD8_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -95,7 +95,12 @@ static int codegen_ADD_IMM(codeblock_t *block, uop_t *uop)
|
|||
static int codegen_ADD_LSHIFT(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
if (!uop->imm_data)
|
||||
host_x86_ADD32_REG_REG(block, uop->dest_reg_a_real, uop->src_reg_a_real, uop->src_reg_b_real);
|
||||
{
|
||||
if (uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
host_x86_ADD32_REG_REG(block, uop->dest_reg_a_real, uop->src_reg_b_real);
|
||||
else
|
||||
host_x86_LEA_REG_REG(block, uop->dest_reg_a_real, uop->src_reg_a_real, uop->src_reg_b_real);
|
||||
}
|
||||
else if (uop->imm_data < 4)
|
||||
host_x86_LEA_REG_REG_SHIFT(block, uop->dest_reg_a_real, uop->src_reg_a_real, uop->src_reg_b_real, uop->imm_data);
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
|
|
@ -118,19 +123,19 @@ static int codegen_AND(codeblock_t *block, uop_t *uop)
|
|||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV32_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_AND32_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_AND32_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size_a) && REG_IS_W(src_size_b))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_AND16_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_AND16_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size_a) && REG_IS_B(src_size_b))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_AND8_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_AND8_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -148,19 +153,19 @@ static int codegen_AND_IMM(codeblock_t *block, uop_t *uop)
|
|||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV32_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_AND32_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_AND32_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_AND16_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_AND16_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_AND8_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_AND8_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -638,10 +643,10 @@ static int codegen_FTST(codeblock_t *block, uop_t *uop)
|
|||
host_x86_PXOR_XREG_XREG(block, REG_XMM_TEMP, REG_XMM_TEMP);
|
||||
if (dest_reg != REG_EAX)
|
||||
host_x86_MOV32_REG_REG(block, REG_ECX, REG_EAX);
|
||||
host_x86_XOR32_REG_REG(block, REG_EAX, REG_EAX, REG_EAX);
|
||||
host_x86_XOR32_REG_REG(block, REG_EAX, REG_EAX);
|
||||
host_x86_COMISD_XREG_XREG(block, src_reg_a, REG_XMM_TEMP);
|
||||
host_x86_LAHF(block);
|
||||
host_x86_AND16_REG_IMM(block, REG_EAX, REG_EAX, C0|C2|C3);
|
||||
host_x86_AND16_REG_IMM(block, REG_EAX, C0|C2|C3);
|
||||
if (dest_reg != REG_EAX)
|
||||
{
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, REG_EAX);
|
||||
|
|
@ -679,10 +684,10 @@ static int codegen_FCOM(codeblock_t *block, uop_t *uop)
|
|||
{
|
||||
if (dest_reg != REG_EAX)
|
||||
host_x86_MOV32_REG_REG(block, REG_ECX, REG_EAX);
|
||||
host_x86_XOR32_REG_REG(block, REG_EAX, REG_EAX, REG_EAX);
|
||||
host_x86_XOR32_REG_REG(block, REG_EAX, REG_EAX);
|
||||
host_x86_COMISD_XREG_XREG(block, src_reg_a, src_reg_b);
|
||||
host_x86_LAHF(block);
|
||||
host_x86_AND16_REG_IMM(block, REG_EAX, REG_EAX, C0|C2|C3);
|
||||
host_x86_AND16_REG_IMM(block, REG_EAX, C0|C2|C3);
|
||||
if (dest_reg != REG_EAX)
|
||||
{
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, REG_EAX);
|
||||
|
|
@ -924,7 +929,7 @@ static int codegen_MEM_LOAD_REG(codeblock_t *block, uop_t *uop)
|
|||
|
||||
host_x86_LEA_REG_REG(block, REG_ESI, seg_reg, addr_reg);
|
||||
if (uop->imm_data)
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, uop->imm_data);
|
||||
if (REG_IS_B(dest_size))
|
||||
{
|
||||
host_x86_CALL(block, codegen_mem_load_byte);
|
||||
|
|
@ -977,7 +982,7 @@ static int codegen_MEM_LOAD_SINGLE(codeblock_t *block, uop_t *uop)
|
|||
#endif
|
||||
host_x86_LEA_REG_REG(block, REG_ESI, seg_reg, addr_reg);
|
||||
if (uop->imm_data)
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_ADD32_REG_IMM(block, 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, codegen_exit_rout);
|
||||
|
|
@ -997,7 +1002,7 @@ static int codegen_MEM_LOAD_DOUBLE(codeblock_t *block, uop_t *uop)
|
|||
#endif
|
||||
host_x86_LEA_REG_REG(block, REG_ESI, seg_reg, addr_reg);
|
||||
if (uop->imm_data)
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_ADD32_REG_IMM(block, 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, codegen_exit_rout);
|
||||
|
|
@ -1044,7 +1049,7 @@ static int codegen_MEM_STORE_REG(codeblock_t *block, uop_t *uop)
|
|||
|
||||
host_x86_LEA_REG_REG(block, REG_ESI, seg_reg, addr_reg);
|
||||
if (uop->imm_data)
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, uop->imm_data);
|
||||
if (REG_IS_B(src_size))
|
||||
{
|
||||
host_x86_MOV8_REG_REG(block, REG_ECX, src_reg);
|
||||
|
|
@ -1123,7 +1128,7 @@ static int codegen_MEM_STORE_SINGLE(codeblock_t *block, uop_t *uop)
|
|||
#endif
|
||||
host_x86_LEA_REG_REG(block, REG_ESI, seg_reg, addr_reg);
|
||||
if (uop->imm_data)
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, uop->imm_data);
|
||||
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);
|
||||
|
|
@ -1142,7 +1147,7 @@ static int codegen_MEM_STORE_DOUBLE(codeblock_t *block, uop_t *uop)
|
|||
#endif
|
||||
host_x86_LEA_REG_REG(block, REG_ESI, seg_reg, addr_reg);
|
||||
if (uop->imm_data)
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, REG_ESI, uop->imm_data);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ESI, uop->imm_data);
|
||||
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);
|
||||
|
|
@ -1364,17 +1369,19 @@ static int codegen_OR(codeblock_t *block, uop_t *uop)
|
|||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV32_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_OR32_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_OR32_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size_a) && REG_IS_W(src_size_b))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_OR16_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_OR16_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size_a) && REG_IS_B(src_size_b))
|
||||
{
|
||||
host_x86_OR8_REG_REG(block, dest_reg, src_reg_a, src_reg_b);
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_OR8_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -1385,19 +1392,19 @@ static int codegen_OR(codeblock_t *block, uop_t *uop)
|
|||
static int codegen_OR_IMM(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg = HOST_REG_GET(uop->src_reg_a_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size = IREG_GET_SIZE(uop->src_reg_a_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real);
|
||||
|
||||
if (REG_IS_L(dest_size) && REG_IS_L(src_size))
|
||||
if (REG_IS_L(dest_size) && dest_reg == src_reg)
|
||||
{
|
||||
host_x86_OR32_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
host_x86_OR32_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size))
|
||||
else if (REG_IS_W(dest_size) && dest_reg == src_reg)
|
||||
{
|
||||
host_x86_OR16_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
host_x86_OR16_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size))
|
||||
else if (REG_IS_B(dest_size) && dest_reg == src_reg)
|
||||
{
|
||||
host_x86_OR8_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
host_x86_OR8_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -2425,19 +2432,19 @@ static int codegen_SUB(codeblock_t *block, uop_t *uop)
|
|||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV32_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_SUB32_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_SUB32_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size_a) && REG_IS_W(src_size_b))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_SUB16_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_SUB16_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size_a) && REG_IS_B(src_size_b))
|
||||
{
|
||||
if (uop->dest_reg_a_real != uop->src_reg_a_real)
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, src_reg_a);
|
||||
host_x86_SUB8_REG_REG(block, dest_reg, dest_reg, src_reg_b);
|
||||
host_x86_SUB8_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -2454,19 +2461,19 @@ static int codegen_SUB_IMM(codeblock_t *block, uop_t *uop)
|
|||
{
|
||||
if (dest_reg != src_reg)
|
||||
host_x86_MOV32_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_SUB32_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_SUB32_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size))
|
||||
{
|
||||
if (dest_reg != src_reg)
|
||||
host_x86_MOV16_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_SUB16_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_SUB16_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size))
|
||||
{
|
||||
if (dest_reg != src_reg)
|
||||
host_x86_MOV8_REG_REG(block, dest_reg, src_reg);
|
||||
host_x86_SUB8_REG_IMM(block, dest_reg, dest_reg, uop->imm_data);
|
||||
host_x86_SUB8_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -2528,24 +2535,24 @@ static int codegen_TEST_JS_DEST(codeblock_t *block, uop_t *uop)
|
|||
|
||||
static int codegen_XOR(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);
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_b = HOST_REG_GET(uop->src_reg_b_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size_a = IREG_GET_SIZE(uop->src_reg_a_real), src_size_b = IREG_GET_SIZE(uop->src_reg_b_real);
|
||||
|
||||
if (REG_IS_Q(dest_size) && REG_IS_Q(src_size_a) && REG_IS_Q(src_size_b) && uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
{
|
||||
host_x86_PXOR_XREG_XREG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_L(dest_size) && REG_IS_L(src_size_a) && REG_IS_L(src_size_b))
|
||||
else if (REG_IS_L(dest_size) && REG_IS_L(src_size_a) && REG_IS_L(src_size_b) && uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
{
|
||||
host_x86_XOR32_REG_REG(block, dest_reg, src_reg_a, src_reg_b);
|
||||
host_x86_XOR32_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size_a) && REG_IS_W(src_size_b))
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size_a) && REG_IS_W(src_size_b) && uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
{
|
||||
host_x86_XOR16_REG_REG(block, dest_reg, src_reg_a, src_reg_b);
|
||||
host_x86_XOR16_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size_a) && REG_IS_B(src_size_b))
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size_a) && REG_IS_B(src_size_b) && uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
{
|
||||
host_x86_XOR8_REG_REG(block, dest_reg, src_reg_a, src_reg_b);
|
||||
host_x86_XOR8_REG_REG(block, dest_reg, src_reg_b);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -2555,20 +2562,20 @@ static int codegen_XOR(codeblock_t *block, uop_t *uop)
|
|||
}
|
||||
static int codegen_XOR_IMM(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg = HOST_REG_GET(uop->src_reg_a_real);
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size = IREG_GET_SIZE(uop->src_reg_a_real);
|
||||
|
||||
if (REG_IS_L(dest_size) && REG_IS_L(src_size))
|
||||
if (REG_IS_L(dest_size) && REG_IS_L(src_size) && uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
{
|
||||
host_x86_XOR32_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
host_x86_XOR32_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size))
|
||||
else if (REG_IS_W(dest_size) && REG_IS_W(src_size) && uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
{
|
||||
host_x86_XOR16_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
host_x86_XOR16_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size))
|
||||
else if (REG_IS_B(dest_size) && REG_IS_B(src_size) && uop->dest_reg_a_real == uop->src_reg_a_real)
|
||||
{
|
||||
host_x86_XOR8_REG_IMM(block, dest_reg, src_reg, uop->imm_data);
|
||||
host_x86_XOR8_REG_IMM(block, dest_reg, uop->imm_data);
|
||||
}
|
||||
#ifdef RECOMPILER_DEBUG
|
||||
else
|
||||
|
|
@ -2783,8 +2790,8 @@ void codegen_direct_read_st_8(codeblock_t *block, int host_reg, void *base, int
|
|||
int offset = (uintptr_t)base - (((uintptr_t)&cpu_state) + 128);
|
||||
|
||||
host_x86_MOV32_REG_BASE_OFFSET(block, REG_ECX, REG_ESP, IREG_TOP_diff_stack_offset);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, REG_ECX, 7);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, 7);
|
||||
host_x86_MOV8_REG_ABS_REG_REG_SHIFT(block, host_reg, offset, REG_EBP, REG_ECX, 0);
|
||||
}
|
||||
void codegen_direct_read_st_64(codeblock_t *block, int host_reg, void *base, int reg_idx)
|
||||
|
|
@ -2792,8 +2799,8 @@ void codegen_direct_read_st_64(codeblock_t *block, int host_reg, void *base, int
|
|||
int offset = (uintptr_t)base - (((uintptr_t)&cpu_state) + 128);
|
||||
|
||||
host_x86_MOV32_REG_BASE_OFFSET(block, REG_ECX, REG_ESP, IREG_TOP_diff_stack_offset);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, REG_ECX, 7);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, 7);
|
||||
host_x86_MOVQ_XREG_ABS_REG_REG_SHIFT(block, host_reg, offset, REG_EBP, REG_ECX, 3);
|
||||
}
|
||||
void codegen_direct_read_st_double(codeblock_t *block, int host_reg, void *base, int reg_idx)
|
||||
|
|
@ -2801,8 +2808,8 @@ void codegen_direct_read_st_double(codeblock_t *block, int host_reg, void *base,
|
|||
int offset = (uintptr_t)base - (((uintptr_t)&cpu_state) + 128);
|
||||
|
||||
host_x86_MOV32_REG_BASE_OFFSET(block, REG_ECX, REG_ESP, IREG_TOP_diff_stack_offset);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, REG_ECX, 7);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, 7);
|
||||
host_x86_MOVQ_XREG_ABS_REG_REG_SHIFT(block, host_reg, offset, REG_EBP, REG_ECX, 3);
|
||||
}
|
||||
|
||||
|
|
@ -2831,8 +2838,8 @@ void codegen_direct_write_st_8(codeblock_t *block, void *base, int reg_idx, int
|
|||
int offset = (uintptr_t)base - (((uintptr_t)&cpu_state) + 128);
|
||||
|
||||
host_x86_MOV32_REG_BASE_OFFSET(block, REG_ECX, REG_ESP, IREG_TOP_diff_stack_offset);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, REG_ECX, 7);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, 7);
|
||||
host_x86_MOV8_ABS_REG_REG_SHIFT_REG(block, offset, REG_EBP, REG_ECX, 0, host_reg);
|
||||
}
|
||||
void codegen_direct_write_st_64(codeblock_t *block, void *base, int reg_idx, int host_reg)
|
||||
|
|
@ -2840,8 +2847,8 @@ void codegen_direct_write_st_64(codeblock_t *block, void *base, int reg_idx, int
|
|||
int offset = (uintptr_t)base - (((uintptr_t)&cpu_state) + 128);
|
||||
|
||||
host_x86_MOV32_REG_BASE_OFFSET(block, REG_ECX, REG_ESP, IREG_TOP_diff_stack_offset);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, REG_ECX, 7);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, 7);
|
||||
host_x86_MOVQ_ABS_REG_REG_SHIFT_XREG(block, offset, REG_EBP, REG_ECX, 3, host_reg);
|
||||
}
|
||||
void codegen_direct_write_st_double(codeblock_t *block, void *base, int reg_idx, int host_reg)
|
||||
|
|
@ -2849,8 +2856,8 @@ void codegen_direct_write_st_double(codeblock_t *block, void *base, int reg_idx,
|
|||
int offset = (uintptr_t)base - (((uintptr_t)&cpu_state) + 128);
|
||||
|
||||
host_x86_MOV32_REG_BASE_OFFSET(block, REG_ECX, REG_ESP, IREG_TOP_diff_stack_offset);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, REG_ECX, 7);
|
||||
host_x86_ADD32_REG_IMM(block, REG_ECX, reg_idx);
|
||||
host_x86_AND32_REG_IMM(block, REG_ECX, 7);
|
||||
host_x86_MOVQ_ABS_REG_REG_SHIFT_XREG(block, offset, REG_EBP, REG_ECX, 3, host_reg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue