From patchwork Tue Jul 13 16:42:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 474693 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4140224jao; Tue, 13 Jul 2021 09:44:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOnESBadcMlOoVRHdDPZucY/1U9Wlsqx7aDxrGb0QFCjTwbq+xmJqzcnKRX4DOz5utccLG X-Received: by 2002:a1c:f016:: with SMTP id a22mr6257054wmb.65.1626194678646; Tue, 13 Jul 2021 09:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626194678; cv=none; d=google.com; s=arc-20160816; b=1HHBGEm0uCSZn5A+J+2vTpSAl8Z7zs+D48dKAyjDyomGY/SXOsS66SjXLrvZspPO6N Xj8FaSEdrLdgG98aV9zk+CReWnt0bvqiNTVU5HW1goHnc91k9tw/YqK2UhpXTXlfDCQ0 2R0E+7FfHQ5f65exKOhQMCCWCBGJWh933kjweCCpuyFQnJyKZqPXfuRHhI7qolzsw/Lk 2dZifSD9btFDJVXXpM21DjhvPBrGhhIV1oQVwODEj2kw8i9/B8hcX5wFzwwxgfvQ9o3H TkS+ES3mFtSTGWseoBsMtX71IRo/uUjI60i08MShnGBbBmCJ7sYF3vTB5IeZdH/9DLXC +Xmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9Ox+DD1VyGDD2SWlngk4YcouD6dR00XZiALJU9OxjL4=; b=vo31rsNtbftI47GYT+Xyx/k+6RKsY2F6ZfdAtEFfrfqlNlWUZypHy0iDbZW2/PsEmj Paw3MZeV5/NuSWZzKP+k5eXX5F+fFhlzJJF0MOYcvofhTatrC0QdVsihGW/344bx5QJ7 0c0eCcwsrYCBsq4s0o8aA0hdQfsdyRifB0L7KSohA1T7r456qYq2MXQzj0ENL7PltSRj yjOBJHBeJ5MO7jshkHSc7eSBPxvui2LlWcQkHU7aON0OnEFhCI+zxmn1BuPO2b+Sj4nr JqXtrqLRQ6quljKFKDtv07V9KhVoE5llT3sfcPNlPHD1vITjAW307ueelQZkC36b8j9T Uh4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9WkDpCE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n5si7723555wmi.121.2021.07.13.09.44.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jul 2021 09:44:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9WkDpCE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3LWP-00046u-P8 for patch@linaro.org; Tue, 13 Jul 2021 12:44:37 -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) 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-Received: by 2002:a17:90a:7bc3:: with SMTP id d3mr214428pjl.145.1626194538162; Tue, 13 Jul 2021 09:42:18 -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) 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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.25.1 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 = tcg_temp_new(); tcg_gen_addi_tl(ea, cpu_R(dc, a->a), a->i); - /* For TB_FLAGS_R0_0, the branch below invalidates the temporary assigned - 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" R0. - This also takes care of RB input across the branch. */ - dc->R0 = cpu_regs[0]; - lab_fail = gen_new_label(); lab_done = 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) val = 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); @@ -1601,7 +1595,7 @@ static void openrisc_tr_tb_start(DisasContextBase *db, CPUState *cs) /* Allow the TCG optimizer to see that R0 == 0, when it's true, which is the common case. */ if (dc->tb_flags & TB_FLAGS_R0_0) { - dc->R0 = tcg_const_tl(0); + dc->R0 = tcg_constant_tl(0); } else { dc->R0 = cpu_regs[0]; }