From patchwork Fri Apr 16 21:02:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 422627 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp734477jaf; Fri, 16 Apr 2021 14:32:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXFjcBM9ruq4+W34MEnJsDbsUDQWtqXLOfT/WCc4arOmd1HHu830PFYMRJzDkk4gXCI02F X-Received: by 2002:ae9:f205:: with SMTP id m5mr1288453qkg.101.1618608753698; Fri, 16 Apr 2021 14:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618608753; cv=none; d=google.com; s=arc-20160816; b=vYgx1Ax2XKajUcYuPOWmcPoW3P2SkZ77wCASDcHFSwboYAWPfVIQpvO9irJDQj+MVf ZONGI3aiKca3yN2ZKXjQo3/4p1JFprHn30vwvH4GVrgm4aLyKtp0ffiCN7w+brqlpSVd SjJwXxOgeXAPxujBr68L/XVIoDZ1qrfTwLnTvFShG+bgUd8NYSR5ZU8WBGdKxqcBNyyq AZ/0C1qkAzGrnhYE/ZJ4F2o5LdInoS4y8vEEUSuxqEBfUKJZkhw5z8OuegQIBqDBBy15 1W69sSsI+9gdneJk2cKIHbLeHhnviu5kiy+Oy3T9fPZD+pCMh44otalwVLnkyYiwCdZK KXwQ== 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=YeuSP/ptzfHqZ3An7U1oQpcltldWGviyBgnte7gB4CU=; b=UH4byNKYoef1rLp/c3FJjoV8+DKLuyoJG2/kim/EXHXup/R/Xo1rmla1PhVPsVRuQY ngW+Rcu7IZnNYQ2FIVNVhmCZhsastemOeP2912jIDf4P4uWZXQCEXQBcqurBj4OoUwmu euznsOf0BmwWoKCjialWIyM73ZHDyISXOpOC7IGKux6HfgmNmpZAaSjp087Cj+1bppGx nMbkqu5FnqM2o94VRoztOJ2VPx/21S25KBf2Wu5BNX2p6QfThzpwaNfukV+kaF5jUAxv 5QnHSstWmMLgkvmhe2bJM33yjKQW3aAPLNYRyWV8px9KWRcDyO2PsqNw0WFBvXmOkyPQ aVzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oxaAt5DN; 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 g9si4593401qts.78.2021.04.16.14.32.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Apr 2021 14:32:33 -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=oxaAt5DN; 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]:45182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXW4m-0007pV-WC for patch@linaro.org; Fri, 16 Apr 2021 17:32:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXVdQ-0005iz-Qm for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:04:18 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:35354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXVdA-0001fb-HA for qemu-devel@nongnu.org; Fri, 16 Apr 2021 17:04:14 -0400 Received: by mail-pg1-x530.google.com with SMTP id q10so20003735pgj.2 for ; Fri, 16 Apr 2021 14:04:00 -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=YeuSP/ptzfHqZ3An7U1oQpcltldWGviyBgnte7gB4CU=; b=oxaAt5DNDxc78gDOzI35zRmEU7g/oip8KPTQVVvugOBSabmRDiuMCh3G55Wg10V3al wnAtiAFK/RBceJGk0CUECybhuXUHeJAbLoercVAJWG/npAYd1GF3qoj1YyagZz9xgO+9 GrHyG02eSTJST556rLl424hg5tPy0k3T2+pOvoFtIDpc2FbZTG/0ZmWhjt8H3xhtupbM Er2uj412Uxk7vqQPGtLVvS2rLFMX+HZjthZSH2wvn2MHAzvmtl9y/lLuAt4jFJcpXYT9 77fkdQqvgmmqRmwd6qkUDVZDCLIeYt3i2P3wcp9rebBg1adIjvi/Iq0ckET07hNZEk3C xj9w== 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=YeuSP/ptzfHqZ3An7U1oQpcltldWGviyBgnte7gB4CU=; b=CnvEYIodxI8xwq9/jn38g+lzgeoZGxF2g9/jvzr3KAQ0CJIn1O8zw5bDMLleXCxhCd VUKNjkkQlpwO3SBPMAW7hQ5RVfhRaKoe/EDPqtIasF/jp2pffgEkYPtriwe/liuvWduc 3Nf2B9dXAGnAeMDzuCMRAGXLbxrSE4lVYdIqHVdR0CPTOqZVT6fjzmN9BTlOIIFXm0fQ SrQdQFhBugegRdawEc+d+Q8Et/4EGbuWqSxgQhvJED1dfvUtWJsjlzPgPRRumu/PLQJg 0H5nvjd9B/0R8eCZNT9ht1lxbpI0tFBnatBKk/4VjDXcasERaGgPRsImE23ebWXkXYqY 7Vag== X-Gm-Message-State: AOAM531NG+BO9TdPD1M6dUQ2zv/znFVWSA6O+dqwXR1/f+nt7+QDO7lc AQDPkRd2R0LTwy5YqwP4ay1gwHrhye/Ujg== X-Received: by 2002:a62:7907:0:b029:23e:9010:3844 with SMTP id u7-20020a6279070000b029023e90103844mr9620148pfc.58.1618607039232; Fri, 16 Apr 2021 14:03:59 -0700 (PDT) Received: from localhost.localdomain ([71.212.131.83]) by smtp.gmail.com with ESMTPSA id m9sm5766734pgt.65.2021.04.16.14.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 14:03:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 47/81] target/arm: Implement SVE2 SPLICE, EXT Date: Fri, 16 Apr 2021 14:02:06 -0700 Message-Id: <20210416210240.1591291-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210416210240.1591291-1-richard.henderson@linaro.org> References: <20210416210240.1591291-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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: qemu-arm@nongnu.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 0afae9646f..e9feb05da3 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 */