All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: qemu-devel@nongnu.org
Cc: "Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
	rth@twiddle.net, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises
Date: Fri, 15 Jan 2016 16:35:10 +0100	[thread overview]
Message-ID: <145287211039.25408.7085421323101489964.stgit@localhost> (raw)
In-Reply-To: <145287209895.25408.12995870835200275306.stgit@localhost>

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 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);
     }

      parent reply	other threads:[~2016-01-15 15:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 15:34 [Qemu-devel] [PATCH v1 0/2] tcg: Add support for " Lluís Vilanova
2016-01-15 15:35 ` [Qemu-devel] [PATCH v1 1/2] " Lluís Vilanova
2016-01-15 18:20   ` Richard Henderson
2016-01-15 20:12     ` Lluís Vilanova
2016-01-15 20:26       ` Richard Henderson
2016-01-16 20:57         ` Lluís Vilanova
2016-01-19 17:00           ` Edgar E. Iglesias
2016-01-19 21:17             ` Lluís Vilanova
2016-01-15 15:35 ` Lluís Vilanova [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=145287211039.25408.7085421323101489964.stgit@localhost \
    --to=vilanova@ac.upc.edu \
    --cc=edgar.iglesias@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --subject='Re: [Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.