From patchwork Mon May 30 16:05:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 577255 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp424653mag; Mon, 30 May 2022 10:14:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxg4Y3mY8sOilL3G3ACuZrvYekXs4PYe9MT69s5abGo+FghKYPv2jf9x57k0Kcevt6FUBiV X-Received: by 2002:a37:9e0a:0:b0:6a3:299e:735e with SMTP id h10-20020a379e0a000000b006a3299e735emr38090872qke.388.1653930842504; Mon, 30 May 2022 10:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653930842; cv=none; d=google.com; s=arc-20160816; b=mapX1/cWNufG1jsPuriBusJyfgjuBXSbtHmD+lvYA9kofAtszlABGmhnsI8zQTLptA zcm+QjoH/xMb/e+0vLLUZbeeQGF4ezK4x+eRaumPFRSdHWrBjb48oLuvmeWIRmfqTPlb 8LjgFWgD2YhFd8kiaITMpw7iqnbpzCbmh/7bobxaCUzbY1HWBDV9etvJh6lz1WF9ZzGG h4wtDBGdyV/C5hUfvA/LsomN4XtnW8bs3g/fit5M2V5KONcfq33mvghdEHoP9XLflCP0 mznl8AlqSIS2MG38i1NVd1FTMIfBTC4mIyH0XovY64CO4irjuhYqaUbavLRNxLEv87Ti 2gKw== 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=nnl0FxSy2lQGEXHLpuMztJtWf2ssR/52boz+nuGDoCs=; b=0PVgmsQFmBI3ohZxKfgNc16ChXyBRZtTGiNId/5APnYa3SFT8NBcDim85YpxwR4uRb h/xcjW2meQQ9b30J6dEdbFeYPGfnJ2eS7agBzQfmAS1W8p2fc+iNu8htRc4sNwRWPP7P Aoc31ckK9ZK+F0Th4CD2K9T8LYJ7dN0KW0MZUgfLE/MrGKDrSehzc29GJAWoRR5pK/J4 S3ek9fFkKHuk2ZWNWphc4b2s/58M8sHEGWv5/fRuAZred0ekpyA6Ex1nrJuPrR2zbVE2 U85bQR4Kf4r2grivzEcJjQ4w/I+Z/KDv0XC3DCdoELhKXDYQ5mQnhvaGRm2ndzrdtEI7 mAlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lT2G1r6H; 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 f1-20020a05622a1a0100b00301304e2e09si3764232qtb.435.2022.05.30.10.14.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 May 2022 10:14:02 -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=lT2G1r6H; 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]:45682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvixt-0004RI-To for patch@linaro.org; Mon, 30 May 2022 13:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhvo-0003ZJ-Cb for qemu-devel@nongnu.org; Mon, 30 May 2022 12:07:48 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:36677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvhvm-0007J3-OB for qemu-devel@nongnu.org; Mon, 30 May 2022 12:07:48 -0400 Received: by mail-wm1-x331.google.com with SMTP id h62-20020a1c2141000000b0039aa4d054e2so2622811wmh.1 for ; Mon, 30 May 2022 09:07:46 -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=nnl0FxSy2lQGEXHLpuMztJtWf2ssR/52boz+nuGDoCs=; b=lT2G1r6HBVzWOJQ1iTIDjvzdeTS60VLGqZsple6WNWaf2Q1VduhrV2J/jDFrjMdJUF 7nU9xDYLxLQ7mvZGO5gu9jN8n9Zgt5BPJ5RPMSJeCemsZ3Olm8/MRqP/Ov1NnPtvnETJ hN236fAjkAhjLh6ScZ6u4RumEECX/93ARl03wcbSJLtENcPSvZhQ9eJzfrJMuWa2Tli7 nfr2sQx/FjHKNaGAzzN6nnDD+x52t7p8SC+rm4o55UQhD9703UYWt1HP76bYqACUJSOO dDd9FfRHedGwqBglcQuCwfdsY8n97DKzFu5frGbBBY9pu21uMOOhw4HOKy14Xsw2cF4F YO3A== 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=nnl0FxSy2lQGEXHLpuMztJtWf2ssR/52boz+nuGDoCs=; b=A8XlPvreiq7Ydw0MQ9l6tVl4eSe/6olnDPR/lpnLdLHzcSZvY1nJ8NKATvg39eWuL8 i4/B29jG41Bei+zx/8SZ93NcWTx3p6KZtjv79Uw+q7VB8PvEMmM1zHPoGEhhKRFonYvk Y98CNJTcqrmsrCM/IdLm8VaJhpwEI0EvbJPiND+QT52mtmCu9vzj7p9JlTZdb2v7MQvH n4ZfdR2zKkc6UZaukbOKsE7+HXi1qs+mrRWfRXLePi0ShcTXwReTAmkMXfPHRlTY5Jh2 q3kBPtfuXMXA84I0eGZFHz/r000qafiBHEMCu13pKfVnelBwLIscQW9/Rc5YhWlUPuJW Ig2w== X-Gm-Message-State: AOAM533Bo0jqnsw9pG+ZuOGmEyyulTyZmVn0g3trVF1cnKuiffdHuWIx 12+wVHiCxB0s9A+L89X4iO4lnERUHnIO8Q== X-Received: by 2002:a05:600c:3510:b0:397:8454:991a with SMTP id h16-20020a05600c351000b003978454991amr17544203wmq.165.1653926865266; Mon, 30 May 2022 09:07:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bi12-20020a05600c3d8c00b003974b95d897sm10232152wmb.37.2022.05.30.09.07.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 09:07:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 044/117] target/arm: Introduce gen_gvec_fn_arg_zzi Date: Mon, 30 May 2022 17:05:55 +0100 Message-Id: <20220530160708.726466-45-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530160708.726466-1-peter.maydell@linaro.org> References: <20220530160708.726466-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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 We have two places that perform this particular operation. Signed-off-by: Richard Henderson Message-id: 20220527181907.189259-42-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate-sve.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 62bfc6fe7c4..7a3b5f137ac 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -273,6 +273,16 @@ static bool gen_gvec_fn_zzi(DisasContext *s, GVecGen2iFn *gvec_fn, return true; } +static bool gen_gvec_fn_arg_zzi(DisasContext *s, GVecGen2iFn *gvec_fn, + arg_rri_esz *a) +{ + if (a->esz < 0) { + /* Invalid tsz encoding -- see tszimm_esz. */ + return false; + } + return gen_gvec_fn_zzi(s, gvec_fn, a->esz, a->rd, a->rn, a->imm); +} + /* Invoke a vector expander on three Zregs. */ static bool gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, int esz, int rd, int rn, int rm) @@ -3503,12 +3513,7 @@ static bool trans_ADD_zzi(DisasContext *s, arg_rri_esz *a) if (a->esz == 0 && extract32(s->insn, 13, 1)) { return false; } - if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_addi(a->esz, vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), a->imm, vsz, vsz); - } - return true; + return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a); } static bool trans_SUB_zzi(DisasContext *s, arg_rri_esz *a) @@ -6825,10 +6830,10 @@ TRANS_FEAT(ADCLT, aa64_sve2, do_adcl, a, true) static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn) { - if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { + if (!dc_isar_feature(aa64_sve2, s)) { return false; } - return gen_gvec_fn_zzi(s, fn, a->esz, a->rd, a->rn, a->imm); + return gen_gvec_fn_arg_zzi(s, fn, a); } static bool trans_SSRA(DisasContext *s, arg_rri_esz *a)