mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-04 14:33:47 +00:00
merge PPC_PROFILE_REGS_USE fixes from KPX branch
This commit is contained in:
parent
8e0088c4c6
commit
b20a76f580
@ -109,6 +109,7 @@
|
|||||||
#define PPC_FLIGHT_RECORDER 1
|
#define PPC_FLIGHT_RECORDER 1
|
||||||
#define PPC_PROFILE_COMPILE_TIME 0
|
#define PPC_PROFILE_COMPILE_TIME 0
|
||||||
#define PPC_PROFILE_GENERIC_CALLS 1
|
#define PPC_PROFILE_GENERIC_CALLS 1
|
||||||
|
#define PPC_PROFILE_REGS_USE 0
|
||||||
#define KPX_MAX_CPUS 1
|
#define KPX_MAX_CPUS 1
|
||||||
#if ENABLE_DYNGEN
|
#if ENABLE_DYNGEN
|
||||||
#define PPC_ENABLE_JIT 1
|
#define PPC_ENABLE_JIT 1
|
||||||
|
@ -250,6 +250,14 @@ void powerpc_cpu::initialize()
|
|||||||
printf("PowerPC CPU emulator by Gwenole Beauchesne\n");
|
printf("PowerPC CPU emulator by Gwenole Beauchesne\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PPC_PROFILE_REGS_USE
|
||||||
|
reginfo = new register_info[32];
|
||||||
|
for (int i = 0; i < 32; i++) {
|
||||||
|
reginfo[i].id = i;
|
||||||
|
reginfo[i].count = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
init_flight_recorder();
|
init_flight_recorder();
|
||||||
init_decoder();
|
init_decoder();
|
||||||
init_registers();
|
init_registers();
|
||||||
@ -292,14 +300,6 @@ void powerpc_cpu::initialize()
|
|||||||
compile_time = 0;
|
compile_time = 0;
|
||||||
emul_start_time = clock();
|
emul_start_time = clock();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PPC_PROFILE_REGS_USE
|
|
||||||
reginfo = new register_info[32];
|
|
||||||
for (int i = 0; i < 32; i++) {
|
|
||||||
reginfo[i].id = i;
|
|
||||||
reginfo[i].count = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PPC_ENABLE_JIT
|
#if PPC_ENABLE_JIT
|
||||||
@ -427,12 +427,12 @@ powerpc_cpu::~powerpc_cpu()
|
|||||||
uint64 cum_reg_count = 0;
|
uint64 cum_reg_count = 0;
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
cum_reg_count += reginfo[i].count;
|
cum_reg_count += reginfo[i].count;
|
||||||
printf("r%-2d : %16lld %2.1f%% [%3.1f%%]\n",
|
printf("r%-2d : %16llu %2.1f%% [%3.1f%%]\n",
|
||||||
reginfo[i].id, reginfo[i].count,
|
reginfo[i].id, reginfo[i].count,
|
||||||
100.0*double(reginfo[i].count)/double(tot_reg_count),
|
100.0*double(reginfo[i].count)/double(tot_reg_count),
|
||||||
100.0*double(cum_reg_count)/double(tot_reg_count));
|
100.0*double(cum_reg_count)/double(tot_reg_count));
|
||||||
}
|
}
|
||||||
delete reginfo;
|
delete[] reginfo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
kill_decode_cache();
|
kill_decode_cache();
|
||||||
|
@ -328,7 +328,14 @@ bool powerpc_jit::gen_vector_generic_store_word(int mnemo, int vS, int rA, int r
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define xPPC_FIELD(M) ((uintptr)&((powerpc_cpu *)0)->M)
|
#if PPC_PROFILE_REGS_USE
|
||||||
|
// XXX update reginfo[] counts for xPPC_GPR() accesses
|
||||||
|
static uint8 dummy_ppc_context[sizeof(powerpc_cpu)];
|
||||||
|
#define xPPC_CONTEXT ((powerpc_cpu *)dummy_ppc_context)
|
||||||
|
#else
|
||||||
|
#define xPPC_CONTEXT ((powerpc_cpu *)0)
|
||||||
|
#endif
|
||||||
|
#define xPPC_FIELD(M) (((uintptr)&xPPC_CONTEXT->M) - (uintptr)xPPC_CONTEXT)
|
||||||
#define xPPC_GPR(N) xPPC_FIELD(gpr(N))
|
#define xPPC_GPR(N) xPPC_FIELD(gpr(N))
|
||||||
#define xPPC_VR(N) xPPC_FIELD(vr(N))
|
#define xPPC_VR(N) xPPC_FIELD(vr(N))
|
||||||
#define xPPC_CR xPPC_FIELD(cr())
|
#define xPPC_CR xPPC_FIELD(cr())
|
||||||
|
@ -235,6 +235,9 @@ struct powerpc_cpu_base
|
|||||||
};
|
};
|
||||||
|
|
||||||
powerpc_cpu_base::powerpc_cpu_base()
|
powerpc_cpu_base::powerpc_cpu_base()
|
||||||
|
#ifndef SHEEPSHAVER
|
||||||
|
: powerpc_cpu(NULL)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
init_decoder();
|
init_decoder();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user