From patchwork Thu Jun 18 04:26:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 191042 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp1077734ilo; Wed, 17 Jun 2020 22:03:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvbfR4lkJ3AOSwFJHjFznwXxDyfJOtmPCQiLgGavn/3cDeD50eqcPiDUNybZazGym7HGCk X-Received: by 2002:a5b:3c2:: with SMTP id t2mr3290147ybp.209.1592456612055; Wed, 17 Jun 2020 22:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592456612; cv=none; d=google.com; s=arc-20160816; b=An29E2wkflirLFpca8Wg1/qjEXpm1VzvfkDwa3gpFoQqr0eY8rhFYPcwi3WLmVcCis qnuM/rwL3kfKqTYbiNcppgKrTiYYA2uA4hhKOJSb9Gs4SXqBrGchA/fDq/wsaD+zQWaz Mtbj2RTPSBc3PM6JmgAKKOMcJquHnIOFaxS2wkitYVSGxiu5TdRY5hla6ts/1M2g3zGA F3IuRl7wQfcmbPjTv6iJNuNFjZ2VaiATTmhM6Z+JAnFpX01m6H9NJK4HB5x7cVNSWeWj UkykjF5okn/d9yxgERq7pjeAxx4Dtf3wDWLsZ560T90jXEI35gO8UsgTd7DPEtYkMoXN VTaw== 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=aL3JmGTn7BB0ZGVDuD2d3mmxx3NlQruQfPzWzn6p43Q=; b=mLjxDA7SFd7Pzn5uEDrwF3DZP9mV2Z+i5TsXyoWSWUmbX/H1k6KtW6PRyS2a8Jz2gQ yCbsJN7Xpwz9K2cWtBRPQuM0Xu6Zr9tLPY/Nuyw2V7hxb4EM8gqV0rrala+r3mG78xW1 bQ/TmU6VENoaZFkYyMkfirDaa8LstxkHFGedYcScflgjtEdmjASpVXqRr06tm5AZg6LF 40i4DzZkS2Elz+OLHqpVRNtVsgm73bvjBceX2xAnldXbOvkQz3vhZxtHEzifwcFvHvE4 j7OKU6hE+pYF+HUmIT01Oy3W1G6t1FRb2ZbIuQN/40b1BUPO5aoggd0Iqcz5dAQ1k6ZR gaqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JHD6YF+W; 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=fail (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 f10si1598311ybk.158.2020.06.17.22.03.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 22:03:32 -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=fail header.i=@linaro.org header.s=google header.b=JHD6YF+W; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlmi3-0001De-Ed for patch@linaro.org; Thu, 18 Jun 2020 01:03:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlmCt-0003Ip-KA for qemu-devel@nongnu.org; Thu, 18 Jun 2020 00:31:19 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:50786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlmCr-0003Jz-G4 for qemu-devel@nongnu.org; Thu, 18 Jun 2020 00:31:19 -0400 Received: by mail-pj1-x102c.google.com with SMTP id jz3so1972646pjb.0 for ; Wed, 17 Jun 2020 21:31:17 -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=aL3JmGTn7BB0ZGVDuD2d3mmxx3NlQruQfPzWzn6p43Q=; b=JHD6YF+WXSCLISzBczbonXfyKQNB+e/96xxwaTPQqqLqi/T8aSXR9EEOVT4EzoRK+K CuCZFnoSaFfqktvVdcaziWtLFeAATn2XFZKkSYjhn1EqRdq6prvjTHaf9zerbDsmFcTG /M94eqrlEpOaWTIa26mtyT6SVYdcdRG3arxW3I8N9Fah5+IOaNAwWCbmGEViurvsx8WA kQEHEJUDgaOFW0jmpQFkwfEP6SsNF6FzlEyQ6stk+24hCo7XZXuADH5KhikjDQvLKzt6 1UOCpfRedxTrF0i7GImW412JKYacY/4WOe8Yt6zZJ6fem2SqcS7UdD8XZYiYm6kuzb+J eQyw== 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=aL3JmGTn7BB0ZGVDuD2d3mmxx3NlQruQfPzWzn6p43Q=; b=iZsHrBwV7V6N74Z/1RDkrCwD9EBmLjuQaJVfUQ9+0Jbdx4c+Qk5UW2LkIkycuyeMuL bbJg21fB/FQmZUqoaTpNz6nQXIsDD199+8LCHvndFyMlEU1G/KVDn89fXnd6QFnH49V1 Sg/GN0lPnZACe3vqfFimUyXSWviWUHx8jFTc7ZhN9k7ohdMHh8iy1OV4MlwwqsaXwsVA gmeYmc3X2RtL3+0ljzalQLXEKasaR7bRqwQHBjVJ3wnyUsJEgSYHmGPqPwmEPvptO+Iw /kNwWcdSJ1q6YK+SUqLpnUM1hMrSEiSpjezlTLhKpRnfrmnZ3XIShmbwdZUIReor6084 dKWg== X-Gm-Message-State: AOAM532Zadm36Ei7RMsBJ1DnWx8F1I7KnmV0fNk5W/LzP22JDab6AumZ yzTPqsXJ4oqIuoylryeGj0j3JNJuw1s= X-Received: by 2002:a17:902:eb14:: with SMTP id l20mr2214389plb.189.1592454675656; Wed, 17 Jun 2020 21:31:15 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id o1sm974337pjf.17.2020.06.17.21.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 21:31:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 063/100] target/arm: Implement SVE2 SPLICE, EXT Date: Wed, 17 Jun 2020 21:26:07 -0700 Message-Id: <20200618042644.1685561-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618042644.1685561-1-richard.henderson@linaro.org> References: <20200618042644.1685561-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN 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, steplong@quicinc.com 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 11e724d3a2..0688dae450 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 0fa04afcaf..45ee91d3fe 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 */ @@ -3023,6 +3036,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, 0); + } + return true; +} + /* *** SVE Integer Compare - Vectors Group */