mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
Do away with TB retranslation
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJWFOjwAAoJEK0ScMxN0CebJb0IAJT1JFDVkxsdkOAB6ZsM7xlj 8INCI00ayO/nK4U93haO/i4d5kCwYdPNtv98f1NDsSoUsmw+DJTzDiZQ0qvXd+bD byF8XYqNyIbft9C1MdUch2v4jT29QZPOO0Fpcfy6/yOHTs9SyYyiC9dSddIiXdd/ MOTvbOENWYwnf+8U57kfQQfaJffLdcyOPQJseMo8S81bmhg7ZUqRw7r7L1GC6vih 2hBPAmv9uo+c9qAzOyquNeVfktfhJmO+DAMpedJ/fu1VQxwP9/HYnA/ijBWVrjBJ 2D1EmfzFtTMdPVl1q/K1dpryMM7XAb2QztFGZAYEMWjC1ackKJP289YqC+7V2ug= =PYK3 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20151007' into staging Do away with TB retranslation # gpg: Signature made Wed 07 Oct 2015 10:42:08 BST using RSA key ID 4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@redhat.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" * remotes/rth/tags/pull-tcg-20151007: (26 commits) tcg: Adjust CODE_GEN_AVG_BLOCK_SIZE tcg: Check for overflow via highwater mark tcg: Allocate a guard page after code_gen_buffer tcg: Emit prologue to the beginning of code_gen_buffer tcg: Remove tcg_gen_code_search_pc tcg: Remove gen_intermediate_code_pc tcg: Save insn data and use it in cpu_restore_state_from_tb tcg: Pass data argument to restore_state_to_opc tcg: Add TCG_MAX_INSNS target-*: Drop cpu_gen_code define tcg: Merge cpu_gen_code into tb_gen_code target-sparc: Add npc state to insn_start target-sparc: Remove gen_opc_jump_pc target-sparc: Split out gen_branch_n target-sparc: Tidy gen_branch_a interface target-cris: Mirror gen_opc_pc into insn_start target-sh4: Add flags state to insn_start target-s390x: Add cc_op state to insn_start target-mips: Add delayed branch state to insn_start target-i386: Add cc_op state to insn_start ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
31c9bd164d
45 changed files with 974 additions and 1502 deletions
|
|
@ -167,7 +167,6 @@ TileGXCPU *cpu_tilegx_init(const char *cpu_model);
|
|||
#define cpu_init(cpu_model) CPU(cpu_tilegx_init(cpu_model))
|
||||
|
||||
#define cpu_exec cpu_tilegx_exec
|
||||
#define cpu_gen_code cpu_tilegx_gen_code
|
||||
#define cpu_signal_handler cpu_tilegx_signal_handler
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUTLGState *env, target_ulong *pc,
|
||||
|
|
|
|||
|
|
@ -2320,10 +2320,6 @@ static void translate_one_bundle(DisasContext *dc, uint64_t bundle)
|
|||
}
|
||||
dc->num_wb = 0;
|
||||
|
||||
if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP | CPU_LOG_TB_OP_OPT))) {
|
||||
tcg_gen_debug_insn_start(dc->pc);
|
||||
}
|
||||
|
||||
qemu_log_mask(CPU_LOG_TB_IN_ASM, " %" PRIx64 ": { ", dc->pc);
|
||||
if (get_Mode(bundle)) {
|
||||
notice_excp(dc, bundle, "y0", decode_y0(dc, bundle));
|
||||
|
|
@ -2365,17 +2361,14 @@ static void translate_one_bundle(DisasContext *dc, uint64_t bundle)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void gen_intermediate_code_internal(TileGXCPU *cpu,
|
||||
TranslationBlock *tb,
|
||||
bool search_pc)
|
||||
void gen_intermediate_code(CPUTLGState *env, struct TranslationBlock *tb)
|
||||
{
|
||||
TileGXCPU *cpu = tilegx_env_get_cpu(env);
|
||||
DisasContext ctx;
|
||||
DisasContext *dc = &ctx;
|
||||
CPUState *cs = CPU(cpu);
|
||||
CPUTLGState *env = &cpu->env;
|
||||
uint64_t pc_start = tb->pc;
|
||||
uint64_t next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
|
||||
int j, lj = -1;
|
||||
int num_insns = 0;
|
||||
int max_insns = tb->cflags & CF_COUNT_MASK;
|
||||
|
||||
|
|
@ -2397,21 +2390,15 @@ static inline void gen_intermediate_code_internal(TileGXCPU *cpu,
|
|||
if (cs->singlestep_enabled || singlestep) {
|
||||
max_insns = 1;
|
||||
}
|
||||
if (max_insns > TCG_MAX_INSNS) {
|
||||
max_insns = TCG_MAX_INSNS;
|
||||
}
|
||||
gen_tb_start(tb);
|
||||
|
||||
while (1) {
|
||||
if (search_pc) {
|
||||
j = tcg_op_buf_count();
|
||||
if (lj < j) {
|
||||
lj++;
|
||||
while (lj < j) {
|
||||
tcg_ctx.gen_opc_instr_start[lj++] = 0;
|
||||
}
|
||||
}
|
||||
tcg_ctx.gen_opc_pc[lj] = dc->pc;
|
||||
tcg_ctx.gen_opc_instr_start[lj] = 1;
|
||||
tcg_ctx.gen_opc_icount[lj] = num_insns;
|
||||
}
|
||||
tcg_gen_insn_start(dc->pc);
|
||||
num_insns++;
|
||||
|
||||
translate_one_bundle(dc, cpu_ldq_data(env, dc->pc));
|
||||
|
||||
if (dc->exit_tb) {
|
||||
|
|
@ -2419,7 +2406,7 @@ static inline void gen_intermediate_code_internal(TileGXCPU *cpu,
|
|||
break;
|
||||
}
|
||||
dc->pc += TILEGX_BUNDLE_SIZE_IN_BYTES;
|
||||
if (++num_insns >= max_insns
|
||||
if (num_insns >= max_insns
|
||||
|| dc->pc >= next_page_start
|
||||
|| tcg_op_buf_full()) {
|
||||
/* Ending the TB due to TB size or page boundary. Set PC. */
|
||||
|
|
@ -2430,33 +2417,16 @@ static inline void gen_intermediate_code_internal(TileGXCPU *cpu,
|
|||
}
|
||||
|
||||
gen_tb_end(tb, num_insns);
|
||||
if (search_pc) {
|
||||
j = tcg_op_buf_count();
|
||||
lj++;
|
||||
while (lj <= j) {
|
||||
tcg_ctx.gen_opc_instr_start[lj++] = 0;
|
||||
}
|
||||
} else {
|
||||
tb->size = dc->pc - pc_start;
|
||||
tb->icount = num_insns;
|
||||
}
|
||||
tb->size = dc->pc - pc_start;
|
||||
tb->icount = num_insns;
|
||||
|
||||
qemu_log_mask(CPU_LOG_TB_IN_ASM, "\n");
|
||||
}
|
||||
|
||||
void gen_intermediate_code(CPUTLGState *env, struct TranslationBlock *tb)
|
||||
void restore_state_to_opc(CPUTLGState *env, TranslationBlock *tb,
|
||||
target_ulong *data)
|
||||
{
|
||||
gen_intermediate_code_internal(tilegx_env_get_cpu(env), tb, false);
|
||||
}
|
||||
|
||||
void gen_intermediate_code_pc(CPUTLGState *env, struct TranslationBlock *tb)
|
||||
{
|
||||
gen_intermediate_code_internal(tilegx_env_get_cpu(env), tb, true);
|
||||
}
|
||||
|
||||
void restore_state_to_opc(CPUTLGState *env, TranslationBlock *tb, int pc_pos)
|
||||
{
|
||||
env->pc = tcg_ctx.gen_opc_pc[pc_pos];
|
||||
env->pc = data[0];
|
||||
}
|
||||
|
||||
void tilegx_tcg_init(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue