From nobody Tue Feb 10 12:13:38 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=1626194764; cv=none; d=zohomail.com; s=zohoarc; b=NPMaq6T60Mz+gy65WH2O3K5vc6h9inEH5rSE9Xhi4F7tfsvjywkY3cCPOd+Y0duFC4HE4n+CwZQH6o5lyhnNMKh5/n2TKZ0Kav7AS6OZqJHQNItrZBQXaPace3lhySw9geR//4wsWGarMvRw4ZRPnc46EkrsMhqNPLDSgRAtzOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626194764; 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=9Ox+DD1VyGDD2SWlngk4YcouD6dR00XZiALJU9OxjL4=; b=dAzpcm/VM9dtE+uqxI9c31C9tefyeOCabDjGr0Ca0BdvDAUbwrDA3xc0Jdambz10mSlswjJHTMNngEvOALXLzEZGMDoZnuK2pGzaKcvA+r+WfR2MN+MI1RzchMT9c7pZNcFalA5H8dV1OnXi3bmSzaIY0eN1qI7yYxA8cJ8NMM4= 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 1626194764463113.47620198202185; Tue, 13 Jul 2021 09:46:04 -0700 (PDT) Received: from localhost ([::1]:36538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3LXn-0006oT-CH for importer@patchew.org; Tue, 13 Jul 2021 12:46:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3LUE-0006u5-E0 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 12:42:22 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:37825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3LUB-0005gO-Ce for qemu-devel@nongnu.org; Tue, 13 Jul 2021 12:42:22 -0400 Received: by mail-pj1-x1030.google.com with SMTP id o3-20020a17090a6783b0290173ce472b8aso1803342pjj.2 for ; Tue, 13 Jul 2021 09:42:19 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id z13sm4947865pfn.94.2021.07.13.09.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 09:42:17 -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=9Ox+DD1VyGDD2SWlngk4YcouD6dR00XZiALJU9OxjL4=; b=q9WkDpCEdlMjMvspJD322CtxcGko6rp1HFq6WoZv0+ZaFhh6CD3wzql3YcyMykPwpI S2k6pD6E9AGmQCHj4BTYq36mL/zIP+EtsiBxtIe5p76MQ5KuF0o+1u8souy8GSapwDCe PlWah6aQNH/4i4RP1eRS/vkVA4DDWvy675risDCpn/xwtNOgJXV5pn/+NJtDiQhJsuXG 5oBihygk9SFdb/FwIorcqWPLCjZ2RLeu3EODCq0fCltDH/wBPXxlTiqhV0qLp+j/pZO+ t/kPqyfAEl0jK7r7jLdh5AfIVlojlfQDXNT1Xzaq4kIxFNGcygZDUPb4wwdy/U0Ij5oY rSYQ== 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=9Ox+DD1VyGDD2SWlngk4YcouD6dR00XZiALJU9OxjL4=; b=i27l/AQZRWSYe55XLxRgosYMf0uxkI4jX4jKCLBp4qgWFmKiB6Zh3YzVKT51vlKNaZ IuYhFKEAoUgeN4wx7Uwb83/fa432I9KQoxcTX188AaB1JuG9xqM/A/GErhZc6fcSPLhB upr24z0m4Xq2CNKS7wM1rVoqmLWi4SIzQaw9fcmvd0CGflB98vBOh2M4IoFORTVDgVrH dHYsTyAVZnIeeyRcnMGFqNWh56HVyURTaWsyNFaHQSpzFamaFiYuwy5KfRvW+mvvL/oD bQ4paSh9l0VvOzbkSvcK//tGANs8bNZ3MjRf58ZYMOAfPUdXlgfnxtrkc2MEvW5wFCy3 Ae0Q== X-Gm-Message-State: AOAM532CgHPnF4LuIddS0Ix5ygFBHIpEIaOMjby9CfnHJeUFMF0nAl93 c5tou0y/m/MF6CTXAQyeZ224QYd7Z/CIgA== X-Google-Smtp-Source: ABdhPJz7mYn149Xo/ivnwWno77wBjPm+vhg39GIrJqUbJQPWu2eila8JNWiRs4fJJ+T7WQs9X8IQcw== X-Received: by 2002:a17:90a:7bc3:: with SMTP id d3mr214428pjl.145.1626194538162; Tue, 13 Jul 2021 09:42:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/14] target/openrisc: Use tcg_constant_tl for dc->R0 Date: Tue, 13 Jul 2021 09:42:07 -0700 Message-Id: <20210713164211.1520109-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210713164211.1520109-1-richard.henderson@linaro.org> References: <20210713164211.1520109-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=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stafford Horne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1626194764830100001 Content-Type: text/plain; charset="utf-8" The temp allocated for tcg_const_tl is auto-freed at branches, but pure constants are not. So we can remove the extra hoop jumping in trans_l_swa. Reviewed-by: Stafford Horne Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 1e3b019c59..2db529b7de 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -732,12 +732,6 @@ static bool trans_l_swa(DisasContext *dc, arg_store *a) ea =3D tcg_temp_new(); tcg_gen_addi_tl(ea, cpu_R(dc, a->a), a->i); =20 - /* For TB_FLAGS_R0_0, the branch below invalidates the temporary assig= ned - to cpu_regs[0]. Since l.swa is quite often immediately followed by= a - branch, don't bother reallocating; finish the TB using the "real" R= 0. - This also takes care of RB input across the branch. */ - dc->R0 =3D cpu_regs[0]; - lab_fail =3D gen_new_label(); lab_done =3D gen_new_label(); tcg_gen_brcond_tl(TCG_COND_NE, ea, cpu_lock_addr, lab_fail); @@ -745,7 +739,7 @@ static bool trans_l_swa(DisasContext *dc, arg_store *a) =20 val =3D tcg_temp_new(); tcg_gen_atomic_cmpxchg_tl(val, cpu_lock_addr, cpu_lock_value, - cpu_regs[a->b], dc->mem_idx, MO_TEUL); + cpu_R(dc, a->b), dc->mem_idx, MO_TEUL); tcg_gen_setcond_tl(TCG_COND_EQ, cpu_sr_f, val, cpu_lock_value); tcg_temp_free(val); =20 @@ -1601,7 +1595,7 @@ static void openrisc_tr_tb_start(DisasContextBase *db= , CPUState *cs) /* Allow the TCG optimizer to see that R0 =3D=3D 0, when it's true, which is the common case. */ if (dc->tb_flags & TB_FLAGS_R0_0) { - dc->R0 =3D tcg_const_tl(0); + dc->R0 =3D tcg_constant_tl(0); } else { dc->R0 =3D cpu_regs[0]; } --=20 2.25.1