From patchwork Fri May 27 18:17:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 576589 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8607:0:0:0:0 with SMTP id bb7csp913704mab; Fri, 27 May 2022 12:18:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyb4Qn2LdgD9kjWgE2+CkMEgb8I2LJ7l1HNqRUPWaBDCuxgTE0GiILcaBRZnWII0UHH4fJ X-Received: by 2002:a05:6214:62f:b0:462:4aae:a474 with SMTP id a15-20020a056214062f00b004624aaea474mr20312549qvx.49.1653679117838; Fri, 27 May 2022 12:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653679117; cv=none; d=google.com; s=arc-20160816; b=niPoGj/4a9+SVLGApK4hopN5DvI1L2rybjgB8sdMF/bGP++Xa8joDxfJrliet1xmp2 8UgKgQrxAnoZUdBhQQaM4ue2sB5yvZwNnKjg1meM2/9R+Ne8fTABZchPXotLr2qf93rC QZO6KFeP/xRH1+ZP/mXKGM5I5eC+d7yhDCeQp0BqPKtXfTf6Kcu6X4SvxLOeNe9/Nksi 2hHl9ktIhKCWlOt/ZX9StJEFoBs94fq9+WDFShysC23GPofbR18NOFfVs2Bh/P+Vn+40 exV+8DAUNXMlsjZXwyKnE/y349J5Y7U86jfYaeoZ0GpMaKMb448ThEX1x6+11/7aEzVj +cqw== 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:cc:to :from:dkim-signature; bh=/y9F7o3DIUaUZkdfIWWkB4RYykgWwMLkMLCMsv2S7ag=; b=DDwAeu396/KAEymsdVq5NZJWxgf80XPBIar/wvqiKYxP+fSaryxxYM2mcEVBoEf2nB ij54rkLFXBPCVTNUD8RfPqJriaCstuKA7jXQOVKE0YZc36ujATxGmEX33pJr9D148KFK vmQ7wiA/JSAIG8gQolSWyK9c1I2MnUwY0R1nF++WTxiT03KMbYSabV2vJ+BzqdH1j2cy VcTiD7ZGDSoimCjm96GapbaNX4uNFs/lH1B82xxIyVJbhkbLnwEGh21GLaJqkCKFzZY3 HwRsNIwgwvvbux/kSYHlPq4uXo2pZPpqAUIJ9xm9izkN6B7cHQ+BObAcg4sdGhUTeco4 WlKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xjHy4GUE; 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 p16-20020a05622a049000b002f3c6a903d1si3582769qtx.73.2022.05.27.12.18.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 May 2022 12:18:37 -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=xjHy4GUE; 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]:36410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nufTp-00067C-CB for patch@linaro.org; Fri, 27 May 2022 15:18:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nueYu-00080C-ND for qemu-devel@nongnu.org; Fri, 27 May 2022 14:19:48 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:47084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nueYr-0003fO-23 for qemu-devel@nongnu.org; Fri, 27 May 2022 14:19:48 -0400 Received: by mail-pf1-x42e.google.com with SMTP id j6so4952027pfe.13 for ; Fri, 27 May 2022 11:19:44 -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=/y9F7o3DIUaUZkdfIWWkB4RYykgWwMLkMLCMsv2S7ag=; b=xjHy4GUECisCwxU1/2nZZljTBnbt6A6fxJ9CjNGgQxD35cKxPwel9VoEJPYYN56bHU oQBnWtqVjSgaoAZMQ32DW/8yYP6xX2KQ/zdo8HWCz+fjtBH0s+1+EcHG6249w9Ry5CnO ngqkMVGc4Udnyqq0TH0JG/bTJsgw2I9dWotZ0mIThs2dVb7/kNC10/xLK0KcuzbgzEQg usZyz3R8+ve2sGM0t+XusYANMfeOju5H0xrGmpZqTg4WalaTkvY0ImO+zRFzv1KQtjln s5ShSw9Ug211dDGFJmD7eaY29MAzA3hdzIoDjVzOudVep7liTHcTI8yzYLr7Bl5nhVUw Mj5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/y9F7o3DIUaUZkdfIWWkB4RYykgWwMLkMLCMsv2S7ag=; b=GcSl3ySeeSHcx8ZrULv7we1cDhactysSmJrNed9p9lz2nRvKVrAdQemheVzQEFbvKY IqeszolhWi5raQU4OeVhEzHhYZE0gnyARrNy8vAPgRCfA9cFgW0QHpM5pE9flRLyHDGr wWnZrtnjM0jyEb2y9c2oz41hdhOOlhgDqmMEH56AhWD+Kk0YDOjGX7iHtRAaB5GCcQse FcPzscyCak2Zc/Gz4BWQeqTq2C33roB7i65ycPhiN5ri67lpJVh7KfPo+1LumuQ5+feG vZiXmpmm/tWvzqUYImK+18PSxaWDJGeUCd1I4xyzwDCI+Vg4P6iHAdjjp7eh6OztnZYC hLjQ== X-Gm-Message-State: AOAM533G6zBcdCVYDtLtDIIA3kN+1CUJUWHVJ56SkH2Aut9Edoa7A+Qh BuVBh6Mo3L7PJ++mS4jusdSm8d2Rl8nmwg== X-Received: by 2002:a05:6a00:9a6:b0:518:fb72:5e2e with SMTP id u38-20020a056a0009a600b00518fb725e2emr14368710pfg.55.1653675584205; Fri, 27 May 2022 11:19:44 -0700 (PDT) Received: from stoup.. (174-21-71-225.tukw.qwest.net. [174.21.71.225]) by smtp.gmail.com with ESMTPSA id t5-20020a17090ae50500b001deb3cbd8f1sm1911612pjy.27.2022.05.27.11.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 11:19:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 038/114] target/arm: Introduce gen_gvec_fn_zzi Date: Fri, 27 May 2022 11:17:51 -0700 Message-Id: <20220527181907.189259-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220527181907.189259-1-richard.henderson@linaro.org> References: <20220527181907.189259-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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" We have two places that perform this particular operation. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index f89c78a23e..7938c5393e 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -258,6 +258,21 @@ static bool gen_gvec_ool_arg_zpzz(DisasContext *s, gen_helper_gvec_4 *fn, return gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, data); } +/* Invoke a vector expander on two Zregs and an immediate. */ +static bool gen_gvec_fn_zzi(DisasContext *s, GVecGen2iFn *gvec_fn, + int esz, int rd, int rn, uint64_t imm) +{ + if (gvec_fn == NULL) { + return false; + } + if (sve_access_check(s)) { + unsigned vsz = vec_full_reg_size(s); + gvec_fn(esz, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), imm, vsz, vsz); + } + return true; +} + /* 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) @@ -2028,12 +2043,7 @@ static bool do_zz_dbm(DisasContext *s, arg_rr_dbm *a, GVecGen2iFn *gvec_fn) extract32(a->dbm, 6, 6))) { return false; } - if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - gvec_fn(MO_64, vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), imm, vsz, vsz); - } - return true; + return gen_gvec_fn_zzi(s, gvec_fn, MO_64, a->rd, a->rn, imm); } static bool trans_AND_zzi(DisasContext *s, arg_rr_dbm *a) @@ -6835,13 +6845,7 @@ static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn) if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) { return false; } - if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - unsigned rd_ofs = vec_full_reg_offset(s, a->rd); - unsigned rn_ofs = vec_full_reg_offset(s, a->rn); - fn(a->esz, rd_ofs, rn_ofs, a->imm, vsz, vsz); - } - return true; + return gen_gvec_fn_zzi(s, fn, a->esz, a->rd, a->rn, a->imm); } static bool trans_SSRA(DisasContext *s, arg_rri_esz *a)