[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises |
Date: |
Fri, 15 Jan 2016 16:35:10 +0100 |
User-agent: |
StGit/0.17.1-dirty |
Signed-off-by: Lluís Vilanova <address@hidden>
---
include/exec/gen-icount.h | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h
index 05d89d3..98d7a85 100644
--- a/include/exec/gen-icount.h
+++ b/include/exec/gen-icount.h
@@ -5,7 +5,7 @@
/* Helpers for instruction counting code generation. */
-static TCGArg *icount_arg;
+static TCGv_promise_i32 icount_promise;
static TCGLabel *icount_label;
static TCGLabel *exitreq_label;
@@ -30,13 +30,11 @@ static inline void gen_tb_start(TranslationBlock *tb)
tcg_gen_ld_i32(count, cpu_env,
-ENV_OFFSET + offsetof(CPUState, icount_decr.u32));
- imm = tcg_temp_new_i32();
- tcg_gen_movi_i32(imm, 0xdeadbeef);
+ imm = tcg_promise_i32(&icount_promise);
/* This is a horrid hack to allow fixing up the value later. */
i = tcg_ctx.gen_last_op_idx;
i = tcg_ctx.gen_op_buf[i].args;
- icount_arg = &tcg_ctx.gen_opparam_buf[i + 1];
tcg_gen_sub_i32(count, count, imm);
tcg_temp_free_i32(imm);
@@ -53,7 +51,7 @@ static void gen_tb_end(TranslationBlock *tb, int num_insns)
tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_REQUESTED);
if (tb->cflags & CF_USE_ICOUNT) {
- *icount_arg = num_insns;
+ tcg_set_promise_i32(icount_promise, num_insns);
gen_set_label(icount_label);
tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_ICOUNT_EXPIRED);
}
- [Qemu-devel] [PATCH v1 0/2] tcg: Add support for constant value promises, Lluís Vilanova, 2016/01/15
- [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises, Lluís Vilanova, 2016/01/15
- Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises, Richard Henderson, 2016/01/15
- Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises, Lluís Vilanova, 2016/01/15
- Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises, Richard Henderson, 2016/01/15
- Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises, Lluís Vilanova, 2016/01/16
- Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises, Edgar E. Iglesias, 2016/01/19
- Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises, Lluís Vilanova, 2016/01/19
[Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises,
Lluís Vilanova <=