From patchwork Wed Oct 25 09:35:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 830195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="VUZUM3Jy"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yMQWy6RPQz9sRW for ; Wed, 25 Oct 2017 20:56:30 +1100 (AEDT) Received: from localhost ([::1]:47394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7IQG-0000XX-Ut for incoming@patchwork.ozlabs.org; Wed, 25 Oct 2017 05:56:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7I6z-0000JL-4c for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7I6y-0000EX-3j for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:33 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:46394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7I6x-0000DI-Tl for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:32 -0400 Received: by mail-wm0-x242.google.com with SMTP id m72so634438wmc.1 for ; Wed, 25 Oct 2017 02:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sa6uo3rj/SL5EFTrIk1mR9VrwCgR8v1yqAwPesoy4+0=; b=VUZUM3JylPLzLDM0PxHXHPRqptO2Flqf3CeG6DxxRQojJSL91G0ncg3U76X/RI5aKp utcSXiFJ6KD6zCfd56nlyTYWfkqZudDNQElKLVSqTH/VVASxMUOoZgxq/L2NUb5gMiMn 12h1zQ2na5TRyQHX/Ae9tzD749eTIvHGr99YY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sa6uo3rj/SL5EFTrIk1mR9VrwCgR8v1yqAwPesoy4+0=; b=UJOpgFVKJ1qAmYKpOXtupuHKXA2tWNZ7/xa60mHWkj5bgyvp8iyA66l1oFx0G7F02i wwAJMU4MoqRd3hNvQ3UEJ9CNM8QUNBteK+DvgJHcacu/TCYgGTXVNsT2Kkfx3ra7RUTe zvvgIsi7wOUa08O/XIsi8/M6H4Lcq2fG8X7yrsmlqPBiFQlGUDdV9VXtljjGsHNCh8tn u+DbLUeghKfAPJ9g9hxUoP+QDshZhj7VwfV2QeQcxVctMqW811h7m6BI1vmYiiLLWsWs uoOVKA+vxyZxiu0C4NH/a7+CSeepXmm++pTQBQM4IsIACbFrMVNK37isHIBsSOjhzdzB gQ/Q== X-Gm-Message-State: AMCzsaWNDysjZ8ol6sfzFnZ6jeL736YD2P8FWLL8gpA5fSPaR0+bESah qQp8GcR3bAxl+FNh62Acxe470r8EYPw= X-Google-Smtp-Source: ABhQp+Qoi02h1BUOoVnv4FPKaN8kQNWElRMZib/qrdCAXRvpkQnEmTgZMZXzbk64K8L24UgZJSDOew== X-Received: by 10.28.211.66 with SMTP id k63mr1094812wmg.33.1508924190735; Wed, 25 Oct 2017 02:36:30 -0700 (PDT) Received: from cloudburst.twiddle.net ([62.168.35.107]) by smtp.gmail.com with ESMTPSA id v23sm2751025wmh.8.2017.10.25.02.36.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2017 02:36:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 25 Oct 2017 11:35:26 +0200 Message-Id: <20171025093535.10175-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171025093535.10175-1-richard.henderson@linaro.org> References: <20171025093535.10175-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 42/51] gen-icount: fold exitreq_label into TCGContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Groundwork for supporting multiple TCG contexts. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- 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 c58b0b2585..fe80176462 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(tb) & 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(tb) & 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 17fd146557..cca85b4d85 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -675,6 +675,8 @@ struct TCGContext { struct TCGLabelPoolData *pool_labels; #endif + TCGLabel *exitreq_label; + TCGTempSet free_temps[TCG_TYPE_COUNT * 2]; TCGTemp temps[TCG_MAX_TEMPS]; /* globals first, temps after */