From nobody Tue Feb 10 09:59:00 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1662463868; cv=none; d=zohomail.com; s=zohoarc; b=OAEzYOcebPgnIP15IbKadkrR6bN/z5nZMcM+5DbzKQdDAKGLfv4I8mCJid2RmvMEvDa38Lyerkf7oytKyDk3HVwtQrDihHUTwAjVHtVVX2WDHeRGx0IFcaUpkqjP5TD+umhD1VHDGVg10RMCGVXOlwNieUWXDxWa3B8OO3+fuwU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662463868; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=81l+dTPIf/D25VI4PJYrcgpxjDCwZBn7L7Zo7+FYLBs=; b=kIymc0c65GvmrgSPJK+LJUKEVzhv2uSWY5QdL1ABeAPLKspwqBW2tjbakI2o2n0MxxE3s7XNSlCLls7np8zCEHZtBZCIHxvi64zcRjZKQH43JVga35lOdyp5QCxlrhTVvvr+AwCRMixpCTkO1pgY1TEhhdUAJLEwdj63cksxY0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1662463868078316.97650017097544; Tue, 6 Sep 2022 04:31:08 -0700 (PDT) Received: from localhost ([::1]:58618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVWnK-0001S6-Pc for importer@patchew.org; Tue, 06 Sep 2022 07:31:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVVf7-0003sx-8j for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:18:33 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:33488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVVeq-0005Eb-Ch for qemu-devel@nongnu.org; Tue, 06 Sep 2022 06:18:32 -0400 Received: by mail-wr1-x42a.google.com with SMTP id k9so14727618wri.0 for ; Tue, 06 Sep 2022 03:18:14 -0700 (PDT) Received: from localhost.localdomain ([2a02:8084:a5c0:5a80:ba98:3a71:8524:e0b1]) by smtp.gmail.com with ESMTPSA id y16-20020a05600c365000b003a62bc1735asm14094361wmq.9.2022.09.06.03.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 03:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=81l+dTPIf/D25VI4PJYrcgpxjDCwZBn7L7Zo7+FYLBs=; b=OyM4qdYECP/aXEXqaOytokFkM9y8JSLitAUZNiK2zPSTfw0rB3bB3uk9sdVHlyEncf eVT2kGpy6nxwtc+qwhYVEzMwcTfgyuXYdWOde4NoT135Dd/PfHrBfJaKPhtJib9AgZ43 KDoX3EygDBwM/cHxKyPeY+3U8c9gc90j9jS2MJAR1QmJI6+4ZMBrdJl05VUP1tfgqv9/ YaepLY+UpmmAR4Xxvx3ItldMTvZ6O27M3KhovoELg1I+6M63BgS9lE0PWqqLIxHTrUJs LnTC5W3AcFVz9uJq38d6IIYqbTCRl89FDnTunhUhEK0AywAxbMTsHer1aB+6SumYS0NC KW+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=81l+dTPIf/D25VI4PJYrcgpxjDCwZBn7L7Zo7+FYLBs=; b=ur3rJl9wnCbqHive1DOeF27wZSwU+JpjBMGQbFeWlJerRV/2vQbWlBqDN2lG+exGVD GTabT/8Im9SSsW4uMVPEeg4wVVm8MeYbpSqV9my6S+lgkFE/l5KE6y5FB6djNmpPdF99 QzgXY7IfXbdKOl3jbHEgaQdfaFxKtHIp2g0N6P3FVPSNDIA5Kd0FoRbfvUAyObP7xj1w XkXeg3lD8Z0IZNgrfrCyvoRumGaAWBS9m+i8eiVBVIm9SUmsocl0LhLo+LdZR5E7GApL KmCs2HrZ0r8FN1TOnQEqt93l3kSEp1XdeWx1GXuE7KeuH/ZYo4ETuGFD8H+5Mx3LIaEm iFmQ== X-Gm-Message-State: ACgBeo2dPHigIkZM50Od/j186YdnSltMahkY429IFt3aRfgkMsV0ES7P JjPuPxud3REKhbUEl/xd4/KkgKqdLuibL+ky X-Google-Smtp-Source: AA6agR5r118Ahd1lyk30+3qTCA3im/vgcBOS3325UCxjt1KYQD8IMi8J5Bg2SgUyI2gBVmI+sPm28w== X-Received: by 2002:a5d:64a4:0:b0:226:df7c:2e5d with SMTP id m4-20020a5d64a4000000b00226df7c2e5dmr21782892wrp.416.1662459494053; Tue, 06 Sep 2022 03:18:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org Subject: [PATCH v1 24/26] tcg: Introduce tcg_temp_ebb_new_* Date: Tue, 6 Sep 2022 11:17:45 +0100 Message-Id: <20220906101747.344559-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906101747.344559-1-richard.henderson@linaro.org> References: <20220906101747.344559-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1662463869010100001 Content-Type: text/plain; charset="utf-8" Allow targets to allocate extended-basic-block temps. Signed-off-by: Richard Henderson --- include/tcg/tcg-op.h | 2 ++ include/tcg/tcg.h | 20 +++++++++++++++++++- tcg/tcg.c | 16 ++++------------ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 209e168305..0ebbee6e24 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -848,6 +848,7 @@ static inline void tcg_gen_plugin_cb_end(void) #define tcg_temp_new() tcg_temp_new_i32() #define tcg_global_mem_new tcg_global_mem_new_i32 #define tcg_temp_local_new() tcg_temp_local_new_i32() +#define tcg_temp_ebb_new() tcg_temp_ebb_new_i32() #define tcg_temp_free tcg_temp_free_i32 #define tcg_gen_qemu_ld_tl tcg_gen_qemu_ld_i32 #define tcg_gen_qemu_st_tl tcg_gen_qemu_st_i32 @@ -855,6 +856,7 @@ static inline void tcg_gen_plugin_cb_end(void) #define tcg_temp_new() tcg_temp_new_i64() #define tcg_global_mem_new tcg_global_mem_new_i64 #define tcg_temp_local_new() tcg_temp_local_new_i64() +#define tcg_temp_ebb_new() tcg_temp_ebb_new_i64() #define tcg_temp_free tcg_temp_free_i64 #define tcg_gen_qemu_ld_tl tcg_gen_qemu_ld_i64 #define tcg_gen_qemu_st_tl tcg_gen_qemu_st_i64 diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 42f39bcf54..546cb3d9d7 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -609,7 +609,7 @@ struct TCGContext { #endif =20 GHashTable *const_table[TCG_TYPE_COUNT]; - TCGTempSet free_temps[TCG_TYPE_COUNT * 2]; + TCGTempSet free_temps[TCG_TYPE_COUNT * 3]; TCGTemp temps[TCG_MAX_TEMPS]; /* globals first, temps after */ =20 QTAILQ_HEAD(, TCGOp) ops, free_ops; @@ -890,6 +890,12 @@ static inline TCGv_i32 tcg_temp_local_new_i32(void) return temp_tcgv_i32(t); } =20 +static inline TCGv_i32 tcg_temp_ebb_new_i32(void) +{ + TCGTemp *t =3D tcg_temp_new_internal(TCG_TYPE_I32, TEMP_EBB); + return temp_tcgv_i32(t); +} + static inline TCGv_i64 tcg_global_mem_new_i64(TCGv_ptr reg, intptr_t offse= t, const char *name) { @@ -909,6 +915,12 @@ static inline TCGv_i64 tcg_temp_local_new_i64(void) return temp_tcgv_i64(t); } =20 +static inline TCGv_i64 tcg_temp_ebb_new_i64(void) +{ + TCGTemp *t =3D tcg_temp_new_internal(TCG_TYPE_I64, TEMP_EBB); + return temp_tcgv_i64(t); +} + static inline TCGv_ptr tcg_global_mem_new_ptr(TCGv_ptr reg, intptr_t offse= t, const char *name) { @@ -928,6 +940,12 @@ static inline TCGv_ptr tcg_temp_local_new_ptr(void) return temp_tcgv_ptr(t); } =20 +static inline TCGv_ptr tcg_temp_ebb_new_ptr(void) +{ + TCGTemp *t =3D tcg_temp_new_internal(TCG_TYPE_PTR, TEMP_EBB); + return temp_tcgv_ptr(t); +} + #if defined(CONFIG_DEBUG_TCG) /* If you call tcg_clear_temp_count() at the start of a section of * code which is not supposed to leak any TCG temporaries, then diff --git a/tcg/tcg.c b/tcg/tcg.c index 2bfba860d4..bd33657f80 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -948,17 +948,8 @@ TCGTemp *tcg_temp_new_internal(TCGType type, TCGTempKi= nd kind) TCGTemp *ts; int idx, k; =20 - switch (kind) { - case TEMP_NORMAL: - k =3D 0; - break; - case TEMP_LOCAL: - k =3D TCG_TYPE_COUNT; - break; - default: - g_assert_not_reached(); - } - k +=3D type; + assert(kind >=3D TEMP_NORMAL && kind <=3D TEMP_LOCAL); + k =3D TCG_TYPE_COUNT * kind + type; =20 idx =3D find_first_bit(s->free_temps[k].l, TCG_MAX_TEMPS); if (idx < TCG_MAX_TEMPS) { @@ -1046,6 +1037,7 @@ void tcg_temp_free_internal(TCGTemp *ts) */ return; case TEMP_NORMAL: + case TEMP_EBB: case TEMP_LOCAL: break; default: @@ -1063,7 +1055,7 @@ void tcg_temp_free_internal(TCGTemp *ts) ts->temp_allocated =3D 0; =20 idx =3D temp_idx(ts); - k =3D ts->base_type + (ts->kind =3D=3D TEMP_NORMAL ? 0 : TCG_TYPE_COUN= T); + k =3D ts->base_type + ts->kind * TCG_TYPE_COUNT; set_bit(idx, s->free_temps[k].l); } =20 --=20 2.34.1