From patchwork Fri Jan 15 15:35:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 8042791 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8278EBEEE5 for ; Fri, 15 Jan 2016 15:36:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E459020458 for ; Fri, 15 Jan 2016 15:36:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D43AC2044C for ; Fri, 15 Jan 2016 15:36:24 +0000 (UTC) Received: from localhost ([::1]:47677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK6QK-0006JD-8m for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jan 2016 10:36:24 -0500 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 Received: from gw-2.ac.upc.es (gw-2.ac.upc.es [147.83.30.8]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id u0FDtaQY027523; Fri, 15 Jan 2016 14:55:36 +0100 Received: from localhost (unknown [84.88.51.85]) by gw-2.ac.upc.es (Postfix) with ESMTPSA id DBF2E1CD6; Fri, 15 Jan 2016 16:35:10 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Fri, 15 Jan 2016 16:35:10 +0100 Message-Id: <145287211039.25408.7085421323101489964.stgit@localhost> X-Mailer: git-send-email 2.6.4 In-Reply-To: <145287209895.25408.12995870835200275306.stgit@localhost> References: <145287209895.25408.12995870835200275306.stgit@localhost> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id u0FDtaQY027523 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Cc: "Edgar E . Iglesias" , rth@twiddle.net, peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: LluĂ­s 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 @@ /* 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); }