Revert back to the old code on x64.

This commit is contained in:
OBattler
2025-11-04 19:17:00 +01:00
parent 3749b25c83
commit 98bb4950f8
3 changed files with 31 additions and 0 deletions

View File

@@ -53,7 +53,9 @@ duplicate_uop(ir_data_t *ir, uop_t *uop, int offset)
new_uop->imm_data = uop->imm_data;
new_uop->p = uop->p;
new_uop->pc = uop->pc;
#if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM || defined __aarch64__ || defined _M_ARM64
new_uop->is_a16 = uop->is_a16;
#endif
if (uop->jump_dest_uop != -1) {
new_uop->jump_dest_uop = uop->jump_dest_uop + offset;

View File

@@ -336,7 +336,11 @@ typedef struct uop_t {
ir_reg_t src_reg_a;
ir_reg_t src_reg_b;
ir_reg_t src_reg_c;
#if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM || defined __aarch64__ || defined _M_ARM64
uintptr_t imm_data;
#else
uint32_t imm_data;
#endif
void *p;
ir_host_reg_t dest_reg_a_real;
ir_host_reg_t src_reg_a_real, src_reg_b_real, src_reg_c_real;
@@ -601,7 +605,11 @@ uop_gen_reg_src3_imm(uint32_t uop_type, ir_data_t *ir, int src_reg_a, int src_re
}
static inline void
#if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM || defined __aarch64__ || defined _M_ARM64
uop_gen_imm(uint32_t uop_type, ir_data_t *ir, uintptr_t imm)
#else
uop_gen_imm(uint32_t uop_type, ir_data_t *ir, uint32_t imm)
#endif
{
uop_t *uop = uop_alloc(ir, uop_type);
@@ -727,6 +735,7 @@ extern int codegen_fp_enter(void);
#define uop_FSQRT(ir, dst_reg, src_reg) uop_gen_reg_dst_src1(UOP_FSQRT, ir, dst_reg, src_reg)
#define uop_FTST(ir, dst_reg, src_reg) uop_gen_reg_dst_src1(UOP_FTST, ir, dst_reg, src_reg)
#if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM || defined __aarch64__ || defined _M_ARM64
#define uop_FP_ENTER(ir) \
do { \
if (!codegen_fpu_entered) { \
@@ -745,6 +754,22 @@ extern int codegen_fp_enter(void);
codegen_mmx_entered = 1; \
codegen_fpu_entered = 0; \
} while (0)
#else
#define uop_FP_ENTER(ir) \
do { \
if (!codegen_fpu_entered) \
uop_gen_imm(UOP_FP_ENTER, ir, cpu_state.oldpc); \
codegen_fpu_entered = 1; \
codegen_mmx_entered = 0; \
} while (0)
#define uop_MMX_ENTER(ir) \
do { \
if (!codegen_mmx_entered) \
uop_gen_imm(UOP_MMX_ENTER, ir, cpu_state.oldpc); \
codegen_mmx_entered = 1; \
codegen_fpu_entered = 0; \
} while (0)
#endif
#define uop_JMP(ir, p) uop_gen_pointer(UOP_JMP, ir, p)
#define uop_JMP_DEST(ir) uop_gen(UOP_JMP_DEST, ir)

View File

@@ -201,7 +201,11 @@ static const uint8_t native_requested_sizes[9][8] =
[REG_DOUBLE][IREG_SIZE_Q >> IREG_SIZE_SHIFT] = 1,
[REG_FPU_ST_DOUBLE][IREG_SIZE_Q >> IREG_SIZE_SHIFT] = 1,
#if defined __ARM_EABI__ || defined _ARM_ || defined _M_ARM || defined __aarch64__ || defined _M_ARM64
[REG_POINTER][IREG_SIZE_Q >> IREG_SIZE_SHIFT] = 1
#else
[REG_POINTER][(sizeof(void *) == 4) ? (IREG_SIZE_L >> IREG_SIZE_SHIFT) : (IREG_SIZE_Q >> IREG_SIZE_SHIFT)] = 1
#endif
};
void