From patchwork Mon May 30 16:06:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 577274 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp437921mag; Mon, 30 May 2022 10:31:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdljaMZcPkIt1qD4EXBcoGTA7qVR33d2cKZArRyJ/241ovjZUy7eZEYMQ9PrYbYhaJ/eEJ X-Received: by 2002:ac8:5ad0:0:b0:2f3:e37a:e768 with SMTP id d16-20020ac85ad0000000b002f3e37ae768mr44054620qtd.592.1653931872458; Mon, 30 May 2022 10:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653931872; cv=none; d=google.com; s=arc-20160816; b=fuCYbYc/EHSimq2sfwcmt3r/zp2+VG9VYaM/B4zC912GuvKKc/5aB3nhYGeX2n76/q hYYFZHv0qL6SFPxxFBdcSem5ruwpL/pxcBXRUx4UY8K5+/6/LhsjhU/MMjBzTunN7qso cYVUvvOA/Cl5+f7W7WnXFVU5qDXqVpNJG9P5xrS77uYuoctRSbsmwTJc+CCxmsOQdnK6 swuMDLNf1vA5YFhVm8nroQReHTDj11boHtVVaAg7cFTa7p9EUVVzXIdAyiJwC6BEzoLL KheQor/e1mAgCcciqWt4hgA8fxvqkADQU0fQbq0qtjHa6s0eY6jgYQnzv1a/WbFSP6Dl T/Lw== 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=Eb1liHNMAWKwhqUeBid/UlGEz6S97F/+Fydx9EWhKYI=; b=FLLzcW3sfyY1TAXhuw7jslTZji/Mjf7UPZqh2xfumDMvrHWIIzXrXJpYYcYoi7RPPn aivA4qy9NAHpqZAaFd40Fgx5+EgaVAqQ3FVG04Y381Ky4Wn+m/Ce706wWGNINtayru0r foC30ZvgpBZ3PgFN2O5dqn9692u112lOK3It6fDWRErYDC0rqOz3B8aAvQot9TSvk0Kx rMhW8VGdihsEKgSf9b64zUBkNAQpVNHE82A4g6GLrHlfRu7x2qxHNREP7HjBeBHXcuHY hgU+fVQ96FDdZecKZzUrwsBB8uxEx25Ibdhx8By+J0VUlkSwuAbwK08triqFJkwX4Pq6 AoPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kUU2O71Q; 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 iw15-20020a0562140f2f00b0045645825998si7403168qvb.212.2022.05.30.10.31.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 May 2022 10:31:12 -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=kUU2O71Q; 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]:60184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvjEV-0008Uz-VH for patch@linaro.org; Mon, 30 May 2022 13:31:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhwI-0003r9-Em for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:26 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:36780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvhwC-0007MM-9k for qemu-devel@nongnu.org; Mon, 30 May 2022 12:08:17 -0400 Received: by mail-wr1-x42d.google.com with SMTP id u3so15272110wrg.3 for ; Mon, 30 May 2022 09:08:11 -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=Eb1liHNMAWKwhqUeBid/UlGEz6S97F/+Fydx9EWhKYI=; b=kUU2O71QXH3mhvWa1KUr6cz4zQKIzY+gVXOE2o70+yQNWzCkvlAw0DxbVhPntHQktD KJqYfqH9u85mIot4fw0xNH26dqLqxQPxBAnUyBG5tViGbAXHOd3hzAdsZEit7v38x6Fr cAWcbP320EDg6a3VaHo86aJAxlN6EV+Tgta6jKmD168asEOzd8UshhxB/7dPLBHaK4I3 xncFPc1YVsasnZ8EoUF5ro3ULZFD+lSc1uEx+cdvJA1+NBs0v5CkcCnS37md1oCZ5IRB ZoloZDatz7TUzhoqiqFyn7igbxAQotimGYii6Yjqnw5fTws3rGLbIXGLo4cAZLOJPeUk kYeQ== 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=Eb1liHNMAWKwhqUeBid/UlGEz6S97F/+Fydx9EWhKYI=; b=jajR7anAhWB8J7tbZF/DxujSwAYbZJx9TbhBz6PtfbhTnN2idfuzRAXAtrYxG1k1n0 wuzBA1T0aJ7SP1NBlMzk+yX27aKEnHv5okmr70wen20iOWisk5iK5VLgPEkImJfsVbMW 2sHYRZpzV3Jp0QZUAGPH9C0RGaJHjKpRVzkREZzRF9BntKG4xRV9ovYfvgiS9FM+voCR GHnV4H+QLGcTY78OrswVDd6PIyKYBG85WjNkaPBhNRExEUNCbCPEd79pagZvko4IfbJR 1e+fXRMF+ovAStLENxC1eb5j0+2HPLG0GWgE5Qk6jMWl2AcVNPoFdKCem7Jb3AWsLvlG TGSA== X-Gm-Message-State: AOAM530CNSfqq8lV8ZCDZIgQu1XWXr+DyiASZBxAcTj83R0S+MBJvUg4 R8CZScOmSjC6IkGWa6mxF/Cs+w3vEthjQA== X-Received: by 2002:a5d:5847:0:b0:20f:dc2d:d6c8 with SMTP id i7-20020a5d5847000000b0020fdc2dd6c8mr32475893wrf.644.1653926890250; Mon, 30 May 2022 09:08:10 -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.08.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 09:08:09 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 062/117] target/arm: Use TRANS_FEAT for do_zip, do_zip_q Date: Mon, 30 May 2022 17:06:13 +0100 Message-Id: <20220530160708.726466-63-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::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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 Convert SVE translation functions using do_zip* to use TRANS_FEAT and gen_gvec_ool_arg_zzz. Signed-off-by: Richard Henderson Message-id: 20220527181907.189259-60-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate-sve.c | 54 +++++++++----------------------------- 1 file changed, 13 insertions(+), 41 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 75c52d8ce1e..7c9deb267fa 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -2287,48 +2287,20 @@ TRANS_FEAT(PUNPKHI, aa64_sve, do_perm_pred2, a, 1, gen_helper_sve_punpk_p) *** SVE Permute - Interleaving Group */ -static bool do_zip(DisasContext *s, arg_rrr_esz *a, bool high) -{ - static gen_helper_gvec_3 * const fns[4] = { - gen_helper_sve_zip_b, gen_helper_sve_zip_h, - gen_helper_sve_zip_s, gen_helper_sve_zip_d, - }; - unsigned vsz = vec_full_reg_size(s); - unsigned high_ofs = high ? vsz / 2 : 0; +static gen_helper_gvec_3 * const zip_fns[4] = { + gen_helper_sve_zip_b, gen_helper_sve_zip_h, + gen_helper_sve_zip_s, gen_helper_sve_zip_d, +}; +TRANS_FEAT(ZIP1_z, aa64_sve, gen_gvec_ool_arg_zzz, + zip_fns[a->esz], a, 0) +TRANS_FEAT(ZIP2_z, aa64_sve, gen_gvec_ool_arg_zzz, + zip_fns[a->esz], a, vec_full_reg_size(s) / 2) - return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, high_ofs); -} - -static bool trans_ZIP1_z(DisasContext *s, arg_rrr_esz *a) -{ - return do_zip(s, a, false); -} - -static bool trans_ZIP2_z(DisasContext *s, arg_rrr_esz *a) -{ - return do_zip(s, a, true); -} - -static bool do_zip_q(DisasContext *s, arg_rrr_esz *a, bool high) -{ - unsigned vsz = vec_full_reg_size(s); - unsigned high_ofs = high ? QEMU_ALIGN_DOWN(vsz, 32) / 2 : 0; - - if (!dc_isar_feature(aa64_sve_f64mm, s)) { - return false; - } - return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_zip_q, a, high_ofs); -} - -static bool trans_ZIP1_q(DisasContext *s, arg_rrr_esz *a) -{ - return do_zip_q(s, a, false); -} - -static bool trans_ZIP2_q(DisasContext *s, arg_rrr_esz *a) -{ - return do_zip_q(s, a, true); -} +TRANS_FEAT(ZIP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, + gen_helper_sve2_zip_q, a, 0) +TRANS_FEAT(ZIP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz, + gen_helper_sve2_zip_q, a, + QEMU_ALIGN_DOWN(vec_full_reg_size(s), 32) / 2) static gen_helper_gvec_3 * const uzp_fns[4] = { gen_helper_sve_uzp_b, gen_helper_sve_uzp_h,