mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 06:35:30 +00:00
tcg: Make cpu_y a TCGv
Commit 5d4e1a1081d3f1ec2908ff0eaebe312389971ab4 allows making the type concrete
This commit is contained in:
parent
a913b3e468
commit
bbc8517cd2
|
@ -617,7 +617,7 @@ static inline void gen_op_mulscc(DisasContext *dc, TCGv dst, TCGv src1, TCGv src
|
||||||
*/
|
*/
|
||||||
zero = tcg_const_tl(tcg_ctx, 0);
|
zero = tcg_const_tl(tcg_ctx, 0);
|
||||||
tcg_gen_andi_tl(tcg_ctx, *(TCGv *)tcg_ctx->cpu_cc_src, src1, 0xffffffff);
|
tcg_gen_andi_tl(tcg_ctx, *(TCGv *)tcg_ctx->cpu_cc_src, src1, 0xffffffff);
|
||||||
tcg_gen_andi_tl(tcg_ctx, r_temp, *(TCGv *)tcg_ctx->cpu_y, 0x1);
|
tcg_gen_andi_tl(tcg_ctx, r_temp, tcg_ctx->cpu_y, 0x1);
|
||||||
tcg_gen_andi_tl(tcg_ctx, *(TCGv *)tcg_ctx->cpu_cc_src2, src2, 0xffffffff);
|
tcg_gen_andi_tl(tcg_ctx, *(TCGv *)tcg_ctx->cpu_cc_src2, src2, 0xffffffff);
|
||||||
tcg_gen_movcond_tl(tcg_ctx, TCG_COND_EQ, *(TCGv *)tcg_ctx->cpu_cc_src2, r_temp, zero,
|
tcg_gen_movcond_tl(tcg_ctx, TCG_COND_EQ, *(TCGv *)tcg_ctx->cpu_cc_src2, r_temp, zero,
|
||||||
zero, *(TCGv *)tcg_ctx->cpu_cc_src2);
|
zero, *(TCGv *)tcg_ctx->cpu_cc_src2);
|
||||||
|
@ -627,10 +627,10 @@ static inline void gen_op_mulscc(DisasContext *dc, TCGv dst, TCGv src1, TCGv src
|
||||||
// env->y = (b2 << 31) | (env->y >> 1);
|
// env->y = (b2 << 31) | (env->y >> 1);
|
||||||
tcg_gen_andi_tl(tcg_ctx, r_temp, *(TCGv *)tcg_ctx->cpu_cc_src, 0x1);
|
tcg_gen_andi_tl(tcg_ctx, r_temp, *(TCGv *)tcg_ctx->cpu_cc_src, 0x1);
|
||||||
tcg_gen_shli_tl(tcg_ctx, r_temp, r_temp, 31);
|
tcg_gen_shli_tl(tcg_ctx, r_temp, r_temp, 31);
|
||||||
tcg_gen_shri_tl(tcg_ctx, t0, *(TCGv *)tcg_ctx->cpu_y, 1);
|
tcg_gen_shri_tl(tcg_ctx, t0, tcg_ctx->cpu_y, 1);
|
||||||
tcg_gen_andi_tl(tcg_ctx, t0, t0, 0x7fffffff);
|
tcg_gen_andi_tl(tcg_ctx, t0, t0, 0x7fffffff);
|
||||||
tcg_gen_or_tl(tcg_ctx, t0, t0, r_temp);
|
tcg_gen_or_tl(tcg_ctx, t0, t0, r_temp);
|
||||||
tcg_gen_andi_tl(tcg_ctx, *(TCGv *)tcg_ctx->cpu_y, t0, 0xffffffff);
|
tcg_gen_andi_tl(tcg_ctx, tcg_ctx->cpu_y, t0, 0xffffffff);
|
||||||
|
|
||||||
// b1 = N ^ V;
|
// b1 = N ^ V;
|
||||||
gen_mov_reg_N(dc, t0, tcg_ctx->cpu_psr);
|
gen_mov_reg_N(dc, t0, tcg_ctx->cpu_psr);
|
||||||
|
@ -655,9 +655,9 @@ static inline void gen_op_multiply(DisasContext *dc, TCGv dst, TCGv src1, TCGv s
|
||||||
TCGContext *tcg_ctx = dc->uc->tcg_ctx;
|
TCGContext *tcg_ctx = dc->uc->tcg_ctx;
|
||||||
#if TARGET_LONG_BITS == 32
|
#if TARGET_LONG_BITS == 32
|
||||||
if (sign_ext) {
|
if (sign_ext) {
|
||||||
tcg_gen_muls2_tl(tcg_ctx, dst, *(TCGv *)tcg_ctx->cpu_y, src1, src2);
|
tcg_gen_muls2_tl(tcg_ctx, dst, tcg_ctx->cpu_y, src1, src2);
|
||||||
} else {
|
} else {
|
||||||
tcg_gen_mulu2_tl(tcg_ctx, dst, *(TCGv *)tcg_ctx->cpu_y, src1, src2);
|
tcg_gen_mulu2_tl(tcg_ctx, dst, tcg_ctx->cpu_y, src1, src2);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
TCGv t0 = tcg_temp_new_i64(tcg_ctx);
|
TCGv t0 = tcg_temp_new_i64(tcg_ctx);
|
||||||
|
@ -675,7 +675,7 @@ static inline void gen_op_multiply(DisasContext *dc, TCGv dst, TCGv src1, TCGv s
|
||||||
tcg_temp_free(tcg_ctx, t0);
|
tcg_temp_free(tcg_ctx, t0);
|
||||||
tcg_temp_free(tcg_ctx, t1);
|
tcg_temp_free(tcg_ctx, t1);
|
||||||
|
|
||||||
tcg_gen_shri_i64(tcg_ctx, *(TCGv *)tcg_ctx->cpu_y, dst, 32);
|
tcg_gen_shri_i64(tcg_ctx, tcg_ctx->cpu_y, dst, 32);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2841,7 +2841,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
gen_store_gpr(dc, rd, *(TCGv *)tcg_ctx->cpu_y);
|
gen_store_gpr(dc, rd, tcg_ctx->cpu_y);
|
||||||
break;
|
break;
|
||||||
#ifdef TARGET_SPARC64
|
#ifdef TARGET_SPARC64
|
||||||
case 0x2: /* V9 rdccr */
|
case 0x2: /* V9 rdccr */
|
||||||
|
@ -3735,7 +3735,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins
|
||||||
switch(rd) {
|
switch(rd) {
|
||||||
case 0: /* wry */
|
case 0: /* wry */
|
||||||
tcg_gen_xor_tl(tcg_ctx, cpu_tmp0, cpu_src1, cpu_src2);
|
tcg_gen_xor_tl(tcg_ctx, cpu_tmp0, cpu_src1, cpu_src2);
|
||||||
tcg_gen_andi_tl(tcg_ctx, *(TCGv *)tcg_ctx->cpu_y, cpu_tmp0, 0xffffffff);
|
tcg_gen_andi_tl(tcg_ctx, tcg_ctx->cpu_y, cpu_tmp0, 0xffffffff);
|
||||||
break;
|
break;
|
||||||
#ifndef TARGET_SPARC64
|
#ifndef TARGET_SPARC64
|
||||||
/* undefined in the SPARCv8 manual, nop on the microSPARC II */
|
/* undefined in the SPARCv8 manual, nop on the microSPARC II */
|
||||||
|
@ -5614,8 +5614,7 @@ void gen_intermediate_code_init(CPUSPARCState *env)
|
||||||
*(TCGv *)tcg_ctx->cpu_npc = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, npc),
|
*(TCGv *)tcg_ctx->cpu_npc = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, npc),
|
||||||
"npc");
|
"npc");
|
||||||
|
|
||||||
tcg_ctx->cpu_y = g_malloc0(sizeof(TCGv));
|
tcg_ctx->cpu_y = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, y), "y");
|
||||||
*(TCGv *)tcg_ctx->cpu_y = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, y), "y");
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
tcg_ctx->cpu_tbr = g_malloc0(sizeof(TCGv));
|
tcg_ctx->cpu_tbr = g_malloc0(sizeof(TCGv));
|
||||||
*(TCGv *)tcg_ctx->cpu_tbr = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, tbr),
|
*(TCGv *)tcg_ctx->cpu_tbr = tcg_global_mem_new(tcg_ctx, tcg_ctx->cpu_env, offsetof(CPUSPARCState, tbr),
|
||||||
|
|
|
@ -42,7 +42,6 @@ void sparc_release(void *ctx)
|
||||||
g_free(tcg_ctx->cpu_fsr);
|
g_free(tcg_ctx->cpu_fsr);
|
||||||
g_free(tcg_ctx->sparc_cpu_pc);
|
g_free(tcg_ctx->sparc_cpu_pc);
|
||||||
g_free(tcg_ctx->cpu_npc);
|
g_free(tcg_ctx->cpu_npc);
|
||||||
g_free(tcg_ctx->cpu_y);
|
|
||||||
g_free(tcg_ctx->cpu_tbr);
|
g_free(tcg_ctx->cpu_tbr);
|
||||||
|
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
|
|
|
@ -835,7 +835,7 @@ struct TCGContext {
|
||||||
// void *cpu_cc_src, *cpu_cc_src2, *cpu_cc_dst;
|
// void *cpu_cc_src, *cpu_cc_src2, *cpu_cc_dst;
|
||||||
void *cpu_fsr, *sparc_cpu_pc, *cpu_npc;
|
void *cpu_fsr, *sparc_cpu_pc, *cpu_npc;
|
||||||
void *cpu_regs_sparc[32];
|
void *cpu_regs_sparc[32];
|
||||||
void *cpu_y;
|
TCGv cpu_y;
|
||||||
void *cpu_tbr;
|
void *cpu_tbr;
|
||||||
void *cpu_cond;
|
void *cpu_cond;
|
||||||
void *cpu_gsr;
|
void *cpu_gsr;
|
||||||
|
|
Loading…
Reference in a new issue