From patchwork Thu Apr 28 14:39:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 567174 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp5545177map; Thu, 28 Apr 2022 08:08:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdTU8xE+VVkMZnLx7Wq/v/At6HRPglK8rlc66kGmgznnf9JLr2+pGLlA/z101io7Q+TuHb X-Received: by 2002:a05:6e02:16cb:b0:2cd:a552:4349 with SMTP id 11-20020a056e0216cb00b002cda5524349mr7279810ilx.264.1651158490424; Thu, 28 Apr 2022 08:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651158490; cv=none; d=google.com; s=arc-20160816; b=SVAS6HNg1YjcIVDSMGc8UOE8pPckdQg6R4M5h9P8EADKe4/J5wAmSy0wU7sEE+FVid a3iH/NCIVm1BOCF8G6pXBW7UlEw9jr17BnGGPC3JknEG5wmZNBG8cfCRUl7iEpAq6D2s kMBFsj3RTojp1l14Tq8/eWpwHoRxakQLpZLn/YPNq7lb8+Op4OrbInWoc5CYNkWGcHmY rysQn9p3/YsQyMYzteZKiJuSXkandwm6ezK59cp5vllIc6iQuKGDoTAGW3FvxJfpgDwO gPd0Oi1okYSzrwz2e4hj4YD5PjYYH+XcHl2cVsvB5lYCdXG2jgPRiSYdksgMgcBbYERW I7PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=F7+9/tJeY/sz+uNlL1QZazY6ZAxBeXQj/QrrkXhkYJY=; b=brVwZTJGWPi8LNiu6GErgM4qc5vf1CfbMosdmPehuaw2KKpsKqiiPTDDB4ZisWlQCq leocCa8XsRl/iAoLxTLtxoORqWifw7Xj/hq4a/R7i9Vu3Qv1PTQjsloB+5KLhZtbbrCr sBHth8bakcBdL0Fw4Oi7qh7ScRAhYLiV2nZQrQDTVnToEfdW+wRn+YZUP8SrHP3krL0V eROOYJOrnSrpOZVcXSHC6dRThMa9dqEo1cNNP6fSbMEWuDxjDhokZ5y1Rno8c5Rt1gm8 Zq3HCD+GPFtfXhIZyqqx6lNHytLOnShad9WWRPSHIUTxuHev5maHIUqJy+6UhFEd+ain SQsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y9aCN6kp; 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 n38-20020a027126000000b0032893677264si1968013jac.118.2022.04.28.08.08.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Apr 2022 08:08:10 -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=y9aCN6kp; 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]:47366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nk5kX-0000B7-Rp for patch@linaro.org; Thu, 28 Apr 2022 11:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk5K1-0005b1-SY for qemu-devel@nongnu.org; Thu, 28 Apr 2022 10:40:46 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:43983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nk5Jx-0006Sx-Ge for qemu-devel@nongnu.org; Thu, 28 Apr 2022 10:40:45 -0400 Received: by mail-wr1-x433.google.com with SMTP id v12so7061913wrv.10 for ; Thu, 28 Apr 2022 07:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=F7+9/tJeY/sz+uNlL1QZazY6ZAxBeXQj/QrrkXhkYJY=; b=y9aCN6kpCouOgI2TpZBldmH/27FLg2HQndYLIuKF8oivf+Tvwqu2i4vxCXqUm0oDIi 6Hcy/JsxLNg9qRMdx1A1599jeZ4NDhjnZ2I5hCl8KlglkJt8GfO/mg3bu6z2jlCiRq+i B5kOETAXysc6D8dQmFFRH009zd1btu3zFzfED+ju37PD/AcEees+UFD5+y8DIM1HOf0E dQXO7fZ4eX+hbrLbybv+Eq9S0X/o2fE6HeXVWs19f6YJ4yL7Uuf2aGWnwWd/BO97Kkig 5CKQLEJv8uDH3RMvyMUg1t/6tZIP7vVbdhEMn7MvQIapff4hIVgJoGCxAsGloDaBa80r toNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F7+9/tJeY/sz+uNlL1QZazY6ZAxBeXQj/QrrkXhkYJY=; b=4tXuN+rl/FLltc/RNTvqhqEzoukYTZgd5SpQ0TuDzOBWa4b1vle9a7Gakk7m6xmTwV k1AD+db87j78b6rPr2cuZVewBMC/BT4BK7NFL0zUVgooTll/ztuNSaE9PHB9zYXmSSAZ H35GFcDmmxwRl1sH+cKyb5LFTj830L7rILXsVrZ57HYnntKO8zmZM8vNT2M3n4+mALf5 98Lp6KFmh7zdf3zgk4NFQki0bShq2aq1bwWPv5IPN9aBaIh0hPy9b7I0FcS08Mc9xcgB Sd/cwG2q+J9W6ZeWiSIEdA55R7QwpSo88D8xDYpjE+X8Rh6GRCCWz0cdawkndgAzK0JL 8ANQ== X-Gm-Message-State: AOAM5321df3vaw6arvK7SOilFZlA1n9mDg9o+DgIIdHif8bD3bLRYQd2 pXPssrSHi1MVEvqyECGdpXFWS+yn8EqgUg== X-Received: by 2002:adf:ec89:0:b0:20a:c0a4:e4a3 with SMTP id z9-20020adfec89000000b0020ac0a4e4a3mr26190760wrn.98.1651156840197; Thu, 28 Apr 2022 07:40:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bh26-20020a05600c3d1a00b003928db85759sm130221wmb.15.2022.04.28.07.40.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 07:40:39 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 41/54] target/arm: Use tcg_constant in WHILE Date: Thu, 28 Apr 2022 15:39:45 +0100 Message-Id: <20220428143958.2451229-42-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220428143958.2451229-1-peter.maydell@linaro.org> References: <20220428143958.2451229-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-id: 20220426163043.100432-42-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate-sve.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 7a39ed0c062..727f5cca36f 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -3568,7 +3568,7 @@ static bool trans_CTERM(DisasContext *s, arg_CTERM *a) static bool trans_WHILE(DisasContext *s, arg_WHILE *a) { TCGv_i64 op0, op1, t0, t1, tmax; - TCGv_i32 t2, t3; + TCGv_i32 t2; TCGv_ptr ptr; unsigned vsz = vec_full_reg_size(s); unsigned desc = 0; @@ -3624,7 +3624,7 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a) } } - tmax = tcg_const_i64(vsz >> a->esz); + tmax = tcg_constant_i64(vsz >> a->esz); if (eq) { /* Equality means one more iteration. */ tcg_gen_addi_i64(t0, t0, 1); @@ -3644,7 +3644,6 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a) /* Bound to the maximum. */ tcg_gen_umin_i64(t0, t0, tmax); - tcg_temp_free_i64(tmax); /* Set the count to zero if the condition is false. */ tcg_gen_movi_i64(t1, 0); @@ -3661,28 +3660,26 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a) desc = FIELD_DP32(desc, PREDDESC, OPRSZ, vsz / 8); desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz); - t3 = tcg_const_i32(desc); ptr = tcg_temp_new_ptr(); tcg_gen_addi_ptr(ptr, cpu_env, pred_full_reg_offset(s, a->rd)); if (a->lt) { - gen_helper_sve_whilel(t2, ptr, t2, t3); + gen_helper_sve_whilel(t2, ptr, t2, tcg_constant_i32(desc)); } else { - gen_helper_sve_whileg(t2, ptr, t2, t3); + gen_helper_sve_whileg(t2, ptr, t2, tcg_constant_i32(desc)); } do_pred_flags(t2); tcg_temp_free_ptr(ptr); tcg_temp_free_i32(t2); - tcg_temp_free_i32(t3); return true; } static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a) { TCGv_i64 op0, op1, diff, t1, tmax; - TCGv_i32 t2, t3; + TCGv_i32 t2; TCGv_ptr ptr; unsigned vsz = vec_full_reg_size(s); unsigned desc = 0; @@ -3697,7 +3694,7 @@ static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a) op0 = read_cpu_reg(s, a->rn, 1); op1 = read_cpu_reg(s, a->rm, 1); - tmax = tcg_const_i64(vsz); + tmax = tcg_constant_i64(vsz); diff = tcg_temp_new_i64(); if (a->rw) { @@ -3723,7 +3720,6 @@ static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a) /* Bound to the maximum. */ tcg_gen_umin_i64(diff, diff, tmax); - tcg_temp_free_i64(tmax); /* Since we're bounded, pass as a 32-bit type. */ t2 = tcg_temp_new_i32(); @@ -3732,17 +3728,15 @@ static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a) desc = FIELD_DP32(desc, PREDDESC, OPRSZ, vsz / 8); desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz); - t3 = tcg_const_i32(desc); ptr = tcg_temp_new_ptr(); tcg_gen_addi_ptr(ptr, cpu_env, pred_full_reg_offset(s, a->rd)); - gen_helper_sve_whilel(t2, ptr, t2, t3); + gen_helper_sve_whilel(t2, ptr, t2, tcg_constant_i32(desc)); do_pred_flags(t2); tcg_temp_free_ptr(ptr); tcg_temp_free_i32(t2); - tcg_temp_free_i32(t3); return true; }