aboutsummaryrefslogtreecommitdiff
path: root/target/i386/translate.c
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2017-07-14 11:53:55 +0300
committerRichard Henderson <richard.henderson@linaro.org>2017-09-06 08:06:47 -0700
commite0d110d943891b719de7ca075fc17fa8ea5749b8 (patch)
treefcdd3fc2cf69a650b9c3ad49e1fb973e815a0882 /target/i386/translate.c
parent47e981b42553f00110024c33897354f9014e83e9 (diff)
target/i386: [tcg] Port to disas_log
Incrementally paves the way towards using the generic instruction translation loop. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Emilio G. Cota <cota@braap.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-Id: <150002243497.22386.8888053391875656102.stgit@frigg.lan> [rth: Move tb->size computation and use that result.] Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target/i386/translate.c')
-rw-r--r--target/i386/translate.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 9872f84a03..ad4b2735f4 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -8518,6 +8518,21 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
}
}
+static void i386_tr_disas_log(const DisasContextBase *dcbase,
+ CPUState *cpu)
+{
+ DisasContext *dc = container_of(dcbase, DisasContext, base);
+ int disas_flags = !dc->code32;
+
+ qemu_log("IN: %s\n", lookup_symbol(dc->base.pc_first));
+#ifdef TARGET_X86_64
+ if (dc->code64) {
+ disas_flags = 2;
+ }
+#endif
+ log_target_disas(cpu, dc->base.pc_first, dc->base.tb->size, disas_flags);
+}
+
/* generate intermediate code for basic block 'tb'. */
void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
{
@@ -8593,28 +8608,19 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
gen_io_end();
gen_tb_end(tb, num_insns);
+ tb->size = dc->base.pc_next - dc->base.pc_first;
+ tb->icount = num_insns;
+
#ifdef DEBUG_DISAS
if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
&& qemu_log_in_addr_range(dc->base.pc_first)) {
- int disas_flags;
qemu_log_lock();
qemu_log("----------------\n");
- qemu_log("IN: %s\n", lookup_symbol(dc->base.pc_first));
-#ifdef TARGET_X86_64
- if (dc->code64)
- disas_flags = 2;
- else
-#endif
- disas_flags = !dc->code32;
- log_target_disas(cs, dc->base.pc_first, dc->base.pc_next - dc->base.pc_first,
- disas_flags);
+ i386_tr_disas_log(&dc->base, cs);
qemu_log("\n");
qemu_log_unlock();
}
#endif
-
- tb->size = dc->base.pc_next - dc->base.pc_first;
- tb->icount = num_insns;
}
void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb,