From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6PD-0004fM-Pf for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:35:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK6PA-0003qa-H5 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:35:15 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:41010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6PA-0003qV-5e for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:35:12 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 15 Jan 2016 16:35:10 +0100 Message-Id: <145287211039.25408.7085421323101489964.stgit@localhost> In-Reply-To: <145287209895.25408.12995870835200275306.stgit@localhost> References: <145287209895.25408.12995870835200275306.stgit@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Edgar E . Iglesias" , rth@twiddle.net, peter.maydell@linaro.org Signed-off-by: Llu=C3=ADs Vilanova --- 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 @@ =20 /* Helpers for instruction counting code generation. */ =20 -static TCGArg *icount_arg; +static TCGv_promise_i32 icount_promise; static TCGLabel *icount_label; static TCGLabel *exitreq_label; =20 @@ -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)); =20 - imm =3D tcg_temp_new_i32(); - tcg_gen_movi_i32(imm, 0xdeadbeef); + imm =3D tcg_promise_i32(&icount_promise); =20 /* This is a horrid hack to allow fixing up the value later. */ i =3D tcg_ctx.gen_last_op_idx; i =3D tcg_ctx.gen_op_buf[i].args; - icount_arg =3D &tcg_ctx.gen_opparam_buf[i + 1]; =20 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_in= sns) tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_REQUESTED); =20 if (tb->cflags & CF_USE_ICOUNT) { - *icount_arg =3D 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); }