Reordered some CPU variables and rewrote codegen emitted by the old recompiler's 64-bit version of codegen_accumulate_flush() to not assume 32-bit pointers, fixes 64-bit old recompiler, closes #1615.
This commit is contained in:
@@ -48,11 +48,16 @@ void codegen_accumulate(int acc_reg, int delta)
|
|||||||
void codegen_accumulate_flush(void)
|
void codegen_accumulate_flush(void)
|
||||||
{
|
{
|
||||||
if (acc_regs[0].count) {
|
if (acc_regs[0].count) {
|
||||||
addbyte(0x81); /*ADD $acc_regs[0].count,acc_regs[0].dest*/
|
addbyte(0x55); /*push rbp*/
|
||||||
addbyte(0x04);
|
addbyte(0x48); /*mov rbp,val*/
|
||||||
addbyte(0x25);
|
addbyte(0xbd);
|
||||||
addlong((uint32_t) acc_regs[0].dest_reg);
|
addlong((uint32_t) (acc_regs[0].dest_reg & 0xffffffffULL));
|
||||||
|
addlong((uint32_t) (acc_regs[0].dest_reg >> 32ULL));
|
||||||
|
addbyte(0x81); /* add d,[rbp][0],val */
|
||||||
|
addbyte(0x45);
|
||||||
|
addbyte(0x00);
|
||||||
addlong(acc_regs[0].count);
|
addlong(acc_regs[0].count);
|
||||||
|
addbyte(0x5d); /*pop rbp*/
|
||||||
}
|
}
|
||||||
|
|
||||||
acc_regs[0].count = 0;
|
acc_regs[0].count = 0;
|
||||||
|
@@ -69,6 +69,9 @@ enum {
|
|||||||
#define CPUID_3DNOW (1UL << 31UL)
|
#define CPUID_3DNOW (1UL << 31UL)
|
||||||
|
|
||||||
|
|
||||||
|
/* Make sure this is as low as possible. */
|
||||||
|
cpu_state_t cpu_state;
|
||||||
|
|
||||||
#ifdef USE_DYNAREC
|
#ifdef USE_DYNAREC
|
||||||
const OpFn *x86_dynarec_opcodes, *x86_dynarec_opcodes_0f,
|
const OpFn *x86_dynarec_opcodes, *x86_dynarec_opcodes_0f,
|
||||||
*x86_dynarec_opcodes_d8_a16, *x86_dynarec_opcodes_d8_a32,
|
*x86_dynarec_opcodes_d8_a16, *x86_dynarec_opcodes_d8_a32,
|
||||||
@@ -128,8 +131,6 @@ double cpu_dmulti;
|
|||||||
|
|
||||||
msr_t msr;
|
msr_t msr;
|
||||||
|
|
||||||
cpu_state_t cpu_state;
|
|
||||||
|
|
||||||
cyrix_t cyrix;
|
cyrix_t cyrix;
|
||||||
|
|
||||||
cpu_family_t *cpu_f;
|
cpu_family_t *cpu_f;
|
||||||
|
@@ -461,6 +461,8 @@ COMPILE_TIME_ASSERT(sizeof(cpu_state_t) <= 128)
|
|||||||
|
|
||||||
|
|
||||||
/* Global variables. */
|
/* Global variables. */
|
||||||
|
extern cpu_state_t cpu_state;
|
||||||
|
|
||||||
extern const cpu_family_t cpu_families[];
|
extern const cpu_family_t cpu_families[];
|
||||||
extern const cpu_legacy_machine_t cpu_legacy_table[];
|
extern const cpu_legacy_machine_t cpu_legacy_table[];
|
||||||
extern cpu_family_t *cpu_f;
|
extern cpu_family_t *cpu_f;
|
||||||
@@ -505,7 +507,6 @@ extern uint32_t cpu_cur_status;
|
|||||||
extern uint64_t cpu_CR4_mask;
|
extern uint64_t cpu_CR4_mask;
|
||||||
extern uint64_t tsc;
|
extern uint64_t tsc;
|
||||||
extern msr_t msr;
|
extern msr_t msr;
|
||||||
extern cpu_state_t cpu_state;
|
|
||||||
extern uint8_t opcode;
|
extern uint8_t opcode;
|
||||||
extern int cgate16;
|
extern int cgate16;
|
||||||
extern int cpl_override;
|
extern int cpl_override;
|
||||||
|
Reference in New Issue
Block a user