Commit 25983cad authored by Evgeny Voevodin's avatar Evgeny Voevodin Committed by Blue Swirl
Browse files

TCG: Use gen_opc_pc from context instead of global variable.

parent c3a43607
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3412,7 +3412,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env,
                while (lj < j)
                    gen_opc_instr_start[lj++] = 0;
            }
            gen_opc_pc[lj] = ctx.pc;
            tcg_ctx.gen_opc_pc[lj] = ctx.pc;
            gen_opc_instr_start[lj] = 1;
            gen_opc_icount[lj] = num_insns;
        }
@@ -3551,5 +3551,5 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)

void restore_state_to_opc(CPUAlphaState *env, TranslationBlock *tb, int pc_pos)
{
    env->pc = gen_opc_pc[pc_pos];
    env->pc = tcg_ctx.gen_opc_pc[pc_pos];
}
+2 −2
Original line number Diff line number Diff line
@@ -9840,7 +9840,7 @@ static inline void gen_intermediate_code_internal(CPUARMState *env,
                while (lj < j)
                    gen_opc_instr_start[lj++] = 0;
            }
            gen_opc_pc[lj] = dc->pc;
            tcg_ctx.gen_opc_pc[lj] = dc->pc;
            gen_opc_condexec_bits[lj] = (dc->condexec_cond << 4) | (dc->condexec_mask >> 1);
            gen_opc_instr_start[lj] = 1;
            gen_opc_icount[lj] = num_insns;
@@ -10043,6 +10043,6 @@ void cpu_dump_state(CPUARMState *env, FILE *f, fprintf_function cpu_fprintf,

void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, int pc_pos)
{
    env->regs[15] = gen_opc_pc[pc_pos];
    env->regs[15] = tcg_ctx.gen_opc_pc[pc_pos];
    env->condexec_bits = gen_opc_condexec_bits[pc_pos];
}
+3 −3
Original line number Diff line number Diff line
@@ -3305,9 +3305,9 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb,
                }
            }
            if (dc->delayed_branch == 1) {
                gen_opc_pc[lj] = dc->ppc | 1;
                tcg_ctx.gen_opc_pc[lj] = dc->ppc | 1;
            } else {
                gen_opc_pc[lj] = dc->pc;
                tcg_ctx.gen_opc_pc[lj] = dc->pc;
            }
            gen_opc_instr_start[lj] = 1;
            gen_opc_icount[lj] = num_insns;
@@ -3621,5 +3621,5 @@ CRISCPU *cpu_cris_init(const char *cpu_model)

void restore_state_to_opc(CPUCRISState *env, TranslationBlock *tb, int pc_pos)
{
    env->pc = gen_opc_pc[pc_pos];
    env->pc = tcg_ctx.gen_opc_pc[pc_pos];
}
+5 −4
Original line number Diff line number Diff line
@@ -7990,7 +7990,7 @@ static inline void gen_intermediate_code_internal(CPUX86State *env,
                while (lj < j)
                    gen_opc_instr_start[lj++] = 0;
            }
            gen_opc_pc[lj] = pc_ptr;
            tcg_ctx.gen_opc_pc[lj] = pc_ptr;
            gen_opc_cc_op[lj] = dc->cc_op;
            gen_opc_instr_start[lj] = 1;
            gen_opc_icount[lj] = num_insns;
@@ -8081,15 +8081,16 @@ void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb, int pc_pos)
        qemu_log("RESTORE:\n");
        for(i = 0;i <= pc_pos; i++) {
            if (gen_opc_instr_start[i]) {
                qemu_log("0x%04x: " TARGET_FMT_lx "\n", i, gen_opc_pc[i]);
                qemu_log("0x%04x: " TARGET_FMT_lx "\n", i,
                        tcg_ctx.gen_opc_pc[i]);
            }
        }
        qemu_log("pc_pos=0x%x eip=" TARGET_FMT_lx " cs_base=%x\n",
                pc_pos, gen_opc_pc[pc_pos] - tb->cs_base,
                pc_pos, tcg_ctx.gen_opc_pc[pc_pos] - tb->cs_base,
                (uint32_t)tb->cs_base);
    }
#endif
    env->eip = gen_opc_pc[pc_pos] - tb->cs_base;
    env->eip = tcg_ctx.gen_opc_pc[pc_pos] - tb->cs_base;
    cc_op = gen_opc_cc_op[pc_pos];
    if (cc_op != CC_OP_DYNAMIC)
        env->cc_op = cc_op;
+2 −2
Original line number Diff line number Diff line
@@ -1054,7 +1054,7 @@ static void gen_intermediate_code_internal(CPULM32State *env,
                    gen_opc_instr_start[lj++] = 0;
                }
            }
            gen_opc_pc[lj] = dc->pc;
            tcg_ctx.gen_opc_pc[lj] = dc->pc;
            gen_opc_instr_start[lj] = 1;
            gen_opc_icount[lj] = num_insns;
        }
@@ -1172,7 +1172,7 @@ void cpu_dump_state(CPULM32State *env, FILE *f, fprintf_function cpu_fprintf,

void restore_state_to_opc(CPULM32State *env, TranslationBlock *tb, int pc_pos)
{
    env->pc = gen_opc_pc[pc_pos];
    env->pc = tcg_ctx.gen_opc_pc[pc_pos];
}

void lm32_translate_init(void)
Loading