[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 35/45] gen-icount: fold exitreq_label into TCGCon
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH v2 35/45] gen-icount: fold exitreq_label into TCGContext |
Date: |
Sun, 16 Jul 2017 16:04:18 -0400 |
Groundwork for supporting multiple TCG contexts.
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
---
include/exec/gen-icount.h | 7 +++----
tcg/tcg.h | 2 ++
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h
index 4a55da8..7723aa0 100644
--- a/include/exec/gen-icount.h
+++ b/include/exec/gen-icount.h
@@ -6,13 +6,12 @@
/* Helpers for instruction counting code generation. */
static int icount_start_insn_idx;
-static TCGLabel *exitreq_label;
static inline void gen_tb_start(TranslationBlock *tb)
{
TCGv_i32 count, imm;
- exitreq_label = gen_new_label();
+ tcg_ctx->exitreq_label = gen_new_label();
if (tb->cflags & CF_USE_ICOUNT) {
count = tcg_temp_local_new_i32();
} else {
@@ -34,7 +33,7 @@ static inline void gen_tb_start(TranslationBlock *tb)
tcg_temp_free_i32(imm);
}
- tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, exitreq_label);
+ tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, tcg_ctx->exitreq_label);
if (tb->cflags & CF_USE_ICOUNT) {
tcg_gen_st16_i32(count, tcg_ctx->tcg_env,
@@ -52,7 +51,7 @@ static inline void gen_tb_end(TranslationBlock *tb, int
num_insns)
tcg_set_insn_param(icount_start_insn_idx, 1, num_insns);
}
- gen_set_label(exitreq_label);
+ gen_set_label(tcg_ctx->exitreq_label);
tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_REQUESTED);
/* Terminate the linked list. */
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 6913d4b..569f823 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -712,6 +712,8 @@ struct TCGContext {
/* The TCGBackendData structure is private to tcg-target.inc.c. */
struct TCGBackendData *be;
+ TCGLabel *exitreq_label;
+
TCGTempSet free_temps[TCG_TYPE_COUNT * 2];
TCGTemp temps[TCG_MAX_TEMPS]; /* globals first, temps after */
--
2.7.4
- Re: [Qemu-devel] [PATCH v2 40/45] osdep: introduce qemu_mprotect_rwx/none, (continued)
- [Qemu-devel] [PATCH v2 29/45] exec-all: rename tb_free to tb_remove, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 14/45] tcg: define CF_PARALLEL and use it for TB hashing, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 35/45] gen-icount: fold exitreq_label into TCGContext,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v2 16/45] target/hppa: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 15/45] target/arm: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 36/45] tcg: dynamically allocate optimizer globals + fold into TCGContext, Emilio G. Cota, 2017/07/16
[Qemu-devel] [PATCH v2 31/45] tci: move tci_regs to tcg_qemu_tb_exec's stack, Emilio G. Cota, 2017/07/16