mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 13:31:02 +00:00
tcg: Make cpu_regs_sparc a TCGv array
This commit is contained in:
parent
db114261e3
commit
1c04024688
|
@ -260,11 +260,11 @@ static inline void gen_address_mask(DisasContext *dc, TCGv addr)
|
|||
static inline TCGv gen_load_gpr(DisasContext *dc, int reg)
|
||||
{
|
||||
TCGContext *tcg_ctx = dc->uc->tcg_ctx;
|
||||
TCGv **cpu_regs = (TCGv **)tcg_ctx->cpu_regs_sparc;
|
||||
TCGv *cpu_regs = tcg_ctx->cpu_regs_sparc;
|
||||
|
||||
if (reg > 0) {
|
||||
assert(reg < 32);
|
||||
return *cpu_regs[reg];
|
||||
return cpu_regs[reg];
|
||||
} else {
|
||||
TCGv t = get_temp_tl(dc);
|
||||
tcg_gen_movi_tl(tcg_ctx, t, 0);
|
||||
|
@ -277,9 +277,9 @@ static inline void gen_store_gpr(DisasContext *dc, int reg, TCGv v)
|
|||
TCGContext *tcg_ctx = dc->uc->tcg_ctx;
|
||||
|
||||
if (reg > 0) {
|
||||
TCGv **cpu_regs = (TCGv **)tcg_ctx->cpu_regs_sparc;
|
||||
TCGv *cpu_regs = tcg_ctx->cpu_regs_sparc;
|
||||
assert(reg < 32);
|
||||
tcg_gen_mov_tl(tcg_ctx, *cpu_regs[reg], v);
|
||||
tcg_gen_mov_tl(tcg_ctx, cpu_regs[reg], v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,9 +287,9 @@ static inline TCGv gen_dest_gpr(DisasContext *dc, int reg)
|
|||
{
|
||||
if (reg > 0) {
|
||||
TCGContext *tcg_ctx = dc->uc->tcg_ctx;
|
||||
TCGv **cpu_regs = (TCGv **)tcg_ctx->cpu_regs_sparc;
|
||||
TCGv *cpu_regs = tcg_ctx->cpu_regs_sparc;
|
||||
assert(reg < 32);
|
||||
return *cpu_regs[reg];
|
||||
return cpu_regs[reg];
|
||||
} else {
|
||||
return get_temp_tl(dc);
|
||||
}
|
||||
|
@ -5605,14 +5605,12 @@ void gen_intermediate_code_init(CPUSPARCState *env)
|
|||
|
||||
TCGV_UNUSED(tcg_ctx->cpu_regs[0]);
|
||||
for (i = 1; i < 8; ++i) {
|
||||
tcg_ctx->cpu_regs_sparc[i] = g_malloc0(sizeof(TCGv));
|
||||
tcg_ctx->cpu_regs_sparc[i] = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env,
|
||||
offsetof(CPUSPARCState, gregs[i]),
|
||||
gregnames[i]);
|
||||
}
|
||||
|
||||
for (i = 8; i < 32; ++i) {
|
||||
tcg_ctx->cpu_regs_sparc[i] = g_malloc0(sizeof(TCGv));
|
||||
tcg_ctx->cpu_regs_sparc[i] = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_regwptr,
|
||||
(i - 8) * sizeof(target_ulong),
|
||||
gregnames[i]);
|
||||
|
|
|
@ -31,18 +31,8 @@ static void sparc_set_pc(struct uc_struct *uc, uint64_t address)
|
|||
void sparc_release(void *ctx);
|
||||
void sparc_release(void *ctx)
|
||||
{
|
||||
int i;
|
||||
TCGContext *tcg_ctx = (TCGContext *) ctx;
|
||||
release_common(ctx);
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
g_free(tcg_ctx->cpu_regs_sparc[i]);
|
||||
}
|
||||
for (i = 0; i < 32; i++) {
|
||||
g_free(tcg_ctx->cpu_gpr[i]);
|
||||
}
|
||||
|
||||
g_free(tcg_ctx->cpu_PC);
|
||||
g_free(tcg_ctx->tb_ctx.tbs);
|
||||
}
|
||||
|
||||
|
|
|
@ -835,7 +835,7 @@ struct TCGContext {
|
|||
TCGv cpu_fsr;
|
||||
TCGv sparc_cpu_pc;
|
||||
TCGv cpu_npc;
|
||||
void *cpu_regs_sparc[32];
|
||||
TCGv cpu_regs_sparc[32];
|
||||
TCGv cpu_y;
|
||||
TCGv cpu_tbr;
|
||||
TCGv cpu_cond;
|
||||
|
|
Loading…
Reference in a new issue