Fix the LxS fix on the new recompiler.

This commit is contained in:
OBattler
2025-04-10 01:08:21 +02:00
parent 8ac9d5d9cf
commit e2f8a58d95
3 changed files with 6 additions and 7 deletions

View File

@@ -998,10 +998,9 @@ 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, uop->imm_data);
if (uop->is_a16) {
host_x86_ADD16_REG_IMM(block, REG_SI, uop->imm_data);
} else {
host_x86_ADD32_REG_IMM(block, REG_ESI, uop->imm_data);
host_x86_AND32_REG_IMM(block, REG_ESI, 0x0000ffff);
}
}
if (REG_IS_B(dest_size)) {

View File

@@ -982,10 +982,9 @@ 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, uop->imm_data);
if (uop->is_a16) {
host_x86_ADD16_REG_IMM(block, REG_SI, uop->imm_data);
} else {
host_x86_ADD32_REG_IMM(block, REG_ESI, uop->imm_data);
host_x86_AND32_REG_IMM(block, REG_ESI, 0x0000ffff);
}
}
if (REG_IS_B(dest_size)) {

View File

@@ -491,13 +491,14 @@ uop_gen_reg_dst_src2_imm(uint32_t uop_type, ir_data_t *ir, int dest_reg, int src
uop_t *uop = uop_alloc(ir, uop_type);
uop->type = uop_type;
uop->src_reg_a = codegen_reg_read(src_reg_a);
uop->is_a16 = 0;
uop->src_reg_a = codegen_reg_read(src_reg_a);
if (src_reg_b == IREG_eaa16) {
uop->src_reg_b = codegen_reg_read(IREG_eaaddr);
uop->is_a16 = 1;
} else
uop->src_reg_b = codegen_reg_read(src_reg_b);
uop->is_a16 = 0;
uop->dest_reg_a = codegen_reg_write(dest_reg, ir->wr_pos - 1);
uop->imm_data = imm;
}