tcg: Make cpu_tick_cmpr a TCGv

This commit is contained in:
Lioncash 2018-02-21 01:27:46 -05:00
parent e5401deb09
commit 2d9d8c5e01
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 12 additions and 7 deletions

View file

@ -2893,7 +2893,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
gen_store_gpr(dc, rd, cpu_dst); gen_store_gpr(dc, rd, cpu_dst);
break; break;
case 0x17: /* Tick compare */ case 0x17: /* Tick compare */
gen_store_gpr(dc, rd, *(TCGv *)tcg_ctx->cpu_tick_cmpr); gen_store_gpr(dc, rd, tcg_ctx->cpu_tick_cmpr);
break; break;
case 0x18: /* System tick */ case 0x18: /* System tick */
{ {
@ -3811,13 +3811,13 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
{ {
TCGv_ptr r_tickptr; TCGv_ptr r_tickptr;
tcg_gen_xor_tl(tcg_ctx, *(TCGv *)tcg_ctx->cpu_tick_cmpr, cpu_src1, tcg_gen_xor_tl(tcg_ctx, tcg_ctx->cpu_tick_cmpr, cpu_src1,
cpu_src2); cpu_src2);
r_tickptr = tcg_temp_new_ptr(tcg_ctx); r_tickptr = tcg_temp_new_ptr(tcg_ctx);
tcg_gen_ld_ptr(tcg_ctx, r_tickptr, tcg_ctx->cpu_env, tcg_gen_ld_ptr(tcg_ctx, r_tickptr, tcg_ctx->cpu_env,
offsetof(CPUSPARCState, tick)); offsetof(CPUSPARCState, tick));
gen_helper_tick_set_limit(tcg_ctx, r_tickptr, gen_helper_tick_set_limit(tcg_ctx, r_tickptr,
*(TCGv *)tcg_ctx->cpu_tick_cmpr); tcg_ctx->cpu_tick_cmpr);
tcg_temp_free_ptr(tcg_ctx, r_tickptr); tcg_temp_free_ptr(tcg_ctx, r_tickptr);
} }
break; break;
@ -5536,8 +5536,7 @@ void gen_intermediate_code_init(CPUSPARCState *env)
tcg_ctx->cpu_gsr = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, gsr), tcg_ctx->cpu_gsr = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, gsr),
"gsr"); "gsr");
tcg_ctx->cpu_tick_cmpr = g_malloc0(sizeof(TCGv)); tcg_ctx->cpu_tick_cmpr = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env,
*(TCGv *)tcg_ctx->cpu_tick_cmpr = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env,
offsetof(CPUSPARCState, tick_cmpr), offsetof(CPUSPARCState, tick_cmpr),
"tick_cmpr"); "tick_cmpr");

View file

@ -840,8 +840,14 @@ struct TCGContext {
TCGv cpu_tbr; TCGv cpu_tbr;
TCGv cpu_cond; TCGv cpu_cond;
TCGv cpu_gsr; TCGv cpu_gsr;
void *cpu_tick_cmpr, *cpu_stick_cmpr, *cpu_hstick_cmpr; TCGv cpu_tick_cmpr;
void *cpu_hintp, *cpu_htba, *cpu_hver, *cpu_ssr, *cpu_ver; void *cpu_stick_cmpr;
void *cpu_hstick_cmpr;
void *cpu_hintp;
void *cpu_htba;
void *cpu_hver;
void *cpu_ssr;
void *cpu_ver;
void *cpu_wim; void *cpu_wim;
TCGLabel *exitreq_label; // gen_tb_start() TCGLabel *exitreq_label; // gen_tb_start()