From patchwork Tue Mar 9 16:20:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 396059 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2812406jai; Tue, 9 Mar 2021 10:18:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNHt6B1B6P48OlFYRodulXpzDXnPSU8zOi+27kI4eErIf/VAR/x7VcJlL9tJscVIHFGU8o X-Received: by 2002:a6b:e312:: with SMTP id u18mr23726499ioc.58.1615313902198; Tue, 09 Mar 2021 10:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615313902; cv=none; d=google.com; s=arc-20160816; b=FjM/gRYY0WhUtXqtFnSgun+nh3LeiFwqtLQnQpXSycHJ0mwPtXI7d/dPtNR15ozgNy Deresrw68drZ2PQxogeVRnz6YjRy9jEIEMc9UUOZ0L01utZtTpJhvbt3YyV5eRtRPev/ qsfvFG3JKj7FpdqTFzJ0YUkVnyvfoJ/ekQXsI7GEdrivUaLPkL5qgmtU2G0+6WmDlm00 H9u6UREPtlDI2M9JDJrnzwu9slVKgio7VupxicWscfiHYz9cW8sGFhKANBIFYfSRC9/F 0qFD1WVeOJJ9DzjmfAGfQ1hA0rXS7ggj+YRMxP1Rntdt3ZDmZbKsi/9rnVgLSU1x9jk5 C9CA== 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=HEwyxw34JNS3xvvmtmlho/yxHK1LKHErEB/8mITxEEA=; b=BWjyAmV7k+EIM+IXaQwWNNpQzqqf0vIfAJF24/OmwBcaAJ6idSuETSEaLENNIqicUj QpDwbAjhgmZrE9x+x6WE3I9ci8B9nLGcF6Bmrl2oWzDUqANdNB4pbbPUyvymKe2nZWEA VBwD9ul5/8fNglmZLjaxdMIpz09c7vpJAZYVZzrcdQ0926Ss/asEvVeBM9gkHGz8Dq6o da9p6O4kcnjcMWekvp8qMll45u3PZeb56tNiqxIUSCRZnv+exd3WL0OiUDUwP5Z3LPz8 qYUTIKyx0NVXcSIDVphn5FoWU1NRUsB7W5eq7gg9MTjgcPdGiepCjsBnvpqLK+HCL06u s+TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xKL1Veqg; 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 o16si15019733ilk.56.2021.03.09.10.18.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Mar 2021 10:18:22 -0800 (PST) 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=xKL1Veqg; 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]:60110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJgw1-0003uS-FT for patch@linaro.org; Tue, 09 Mar 2021 13:18:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJf7a-0000Hg-RT for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:22:10 -0500 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]:46336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJf7Y-0002lU-Rt for qemu-devel@nongnu.org; Tue, 09 Mar 2021 11:22:10 -0500 Received: by mail-oo1-xc34.google.com with SMTP id l11so3166995oov.13 for ; Tue, 09 Mar 2021 08:22:08 -0800 (PST) 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=HEwyxw34JNS3xvvmtmlho/yxHK1LKHErEB/8mITxEEA=; b=xKL1VeqgOiuR1tF7zh9YSdfceKKUpt3AVxq74NOV8Syh0+01kMfHyFun0NBhwVtz71 AC9Nd0ZHLJ7o+nPH1pf8EXedClHxdefahUu0GhmNWy6gLI2OS+ngEz6u/t+IVVL4zDGi /fPxQCPawnXRh73QcTlBr2fNpCePw3oxWdYant7MZVrCG8w4OXIMPhhaCgUlXaOBwnQl Qt5ncFSg4F79R3fhAtkLgqgRSepXz2QTjL1pARXFE19DbpKjCx8cnYAMAoXCbEH9pmWD EvjMHJj78zBpuYu1eMLKv4ut+YWxAq//pqqg/AXn9b4zq/3PZQjiXJbUaQfaI6DlaFIo Ovwg== 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=HEwyxw34JNS3xvvmtmlho/yxHK1LKHErEB/8mITxEEA=; b=nyDJHT0aYVrBjK8LwwW4GXJuc4flVbHhL4Jt3xMSWEp51QN7FO1wBVnbXNdRnhhp/V TIoGjzsgSSdy+5oCUjTWvq8I22fniRX9ZDVlndoGIGNtZ1Hz8A9U9FpkgQFrOx0SX6R/ s4J30Nnz+FHGaBNRjihZHrPzkp5EojVnHm32ZSLUsh9vt2fU6aX1DnDYOSUaIRBaTPPZ yf/yGVCAISuJrWn4fWpQqDsQuSNYxJpUQPez70yg5S9icBS9hGgf74bPKUgy/dnlFQbU MzAhZajpsdnCDICAmzBo4g0t5FybopNj9tmRbnzdABZ9v6JqKkDFbC9XW9F8fs/MtnO4 vvrw== X-Gm-Message-State: AOAM530kOHyHf6yAX3/36w/5oKIHGvCFHv1wi19YwFGe3WaDmB514HCA gTXDAyXuqmPiD/92UrefoiZ4yTiIL+TgRoZ7 X-Received: by 2002:a4a:d994:: with SMTP id k20mr22846236oou.70.1615306927863; Tue, 09 Mar 2021 08:22:07 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id u19sm3470898ote.15.2021.03.09.08.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Mar 2021 08:22:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 47/78] target/arm: Implement SVE2 SPLICE, EXT Date: Tue, 9 Mar 2021 08:20:10 -0800 Message-Id: <20210309162041.23124-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210309162041.23124-1-richard.henderson@linaro.org> References: <20210309162041.23124-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.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: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org, Stephen Long Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Stephen Long Signed-off-by: Stephen Long Message-Id: <20200423180347.9403-1-steplong@quicinc.com> [rth: Rename the trans_* functions to *_sve2.] Signed-off-by: Richard Henderson --- target/arm/sve.decode | 11 +++++++++-- target/arm/translate-sve.c | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/target/arm/sve.decode b/target/arm/sve.decode index cb2ee86228..67b6466a1e 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -494,10 +494,14 @@ CPY_z_i 00000101 .. 01 .... 00 . ........ ..... @rdn_pg4 imm=%sh8_i8s ### SVE Permute - Extract Group -# SVE extract vector (immediate offset) +# SVE extract vector (destructive) EXT 00000101 001 ..... 000 ... rm:5 rd:5 \ &rrri rn=%reg_movprfx imm=%imm8_16_10 +# SVE2 extract vector (constructive) +EXT_sve2 00000101 011 ..... 000 ... rn:5 rd:5 \ + &rri imm=%imm8_16_10 + ### SVE Permute - Unpredicated Group # SVE broadcast general register @@ -588,9 +592,12 @@ REVH 00000101 .. 1001 01 100 ... ..... ..... @rd_pg_rn REVW 00000101 .. 1001 10 100 ... ..... ..... @rd_pg_rn RBIT 00000101 .. 1001 11 100 ... ..... ..... @rd_pg_rn -# SVE vector splice (predicated) +# SVE vector splice (predicated, destructive) SPLICE 00000101 .. 101 100 100 ... ..... ..... @rdn_pg_rm +# SVE2 vector splice (predicated, constructive) +SPLICE_sve2 00000101 .. 101 101 100 ... ..... ..... @rd_pg_rn + ### SVE Select Vectors Group # SVE select vector elements (predicated) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 8c93d87897..cfcf4893ac 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -2266,18 +2266,18 @@ static bool trans_CPY_z_i(DisasContext *s, arg_CPY_z_i *a) *** SVE Permute Extract Group */ -static bool trans_EXT(DisasContext *s, arg_EXT *a) +static bool do_EXT(DisasContext *s, int rd, int rn, int rm, int imm) { if (!sve_access_check(s)) { return true; } unsigned vsz = vec_full_reg_size(s); - unsigned n_ofs = a->imm >= vsz ? 0 : a->imm; + unsigned n_ofs = imm >= vsz ? 0 : imm; unsigned n_siz = vsz - n_ofs; - unsigned d = vec_full_reg_offset(s, a->rd); - unsigned n = vec_full_reg_offset(s, a->rn); - unsigned m = vec_full_reg_offset(s, a->rm); + unsigned d = vec_full_reg_offset(s, rd); + unsigned n = vec_full_reg_offset(s, rn); + unsigned m = vec_full_reg_offset(s, rm); /* Use host vector move insns if we have appropriate sizes * and no unfortunate overlap. @@ -2296,6 +2296,19 @@ static bool trans_EXT(DisasContext *s, arg_EXT *a) return true; } +static bool trans_EXT(DisasContext *s, arg_EXT *a) +{ + return do_EXT(s, a->rd, a->rn, a->rm, a->imm); +} + +static bool trans_EXT_sve2(DisasContext *s, arg_rri *a) +{ + if (!dc_isar_feature(aa64_sve2, s)) { + return false; + } + return do_EXT(s, a->rd, a->rn, (a->rn + 1) % 32, a->imm); +} + /* *** SVE Permute - Unpredicated Group */ @@ -3013,6 +3026,18 @@ static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a) return true; } +static bool trans_SPLICE_sve2(DisasContext *s, arg_rpr_esz *a) +{ + if (!dc_isar_feature(aa64_sve2, s)) { + return false; + } + if (sve_access_check(s)) { + gen_gvec_ool_zzzp(s, gen_helper_sve_splice, + a->rd, a->rn, (a->rn + 1) % 32, a->pg, a->esz); + } + return true; +} + /* *** SVE Integer Compare - Vectors Group */