[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 47/81] target/arm: Implement SVE2 SPLICE, EXT
From: |
Richard Henderson |
Subject: |
[PATCH v5 47/81] target/arm: Implement SVE2 SPLICE, EXT |
Date: |
Fri, 16 Apr 2021 14:02:06 -0700 |
From: Stephen Long <steplong@quicinc.com>
Signed-off-by: Stephen Long <steplong@quicinc.com>
Message-Id: <20200423180347.9403-1-steplong@quicinc.com>
[rth: Rename the trans_* functions to *_sve2.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/sve.decode | 11 +++++++++--
target/arm/translate-sve.c | 35 ++++++++++++++++++++++++++++++-----
2 files changed, 39 insertions(+), 7 deletions(-)
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
*/
--
2.25.1
- [PATCH v5 40/81] target/arm: Implement SVE2 SUBHNB, SUBHNT, (continued)
- [PATCH v5 40/81] target/arm: Implement SVE2 SUBHNB, SUBHNT, Richard Henderson, 2021/04/16
- [PATCH v5 42/81] target/arm: Implement SVE2 HISTCNT, HISTSEG, Richard Henderson, 2021/04/16
- [PATCH v5 41/81] target/arm: Implement SVE2 RSUBHNB, RSUBHNT, Richard Henderson, 2021/04/16
- [PATCH v5 43/81] target/arm: Implement SVE2 XAR, Richard Henderson, 2021/04/16
- [PATCH v5 44/81] target/arm: Implement SVE2 scatter store insns, Richard Henderson, 2021/04/16
- [PATCH v5 45/81] target/arm: Implement SVE2 gather load insns, Richard Henderson, 2021/04/16
- [PATCH v5 46/81] target/arm: Implement SVE2 FMMLA, Richard Henderson, 2021/04/16
- [PATCH v5 48/81] target/arm: Pass separate addend to {U, S}DOT helpers, Richard Henderson, 2021/04/16
- [PATCH v5 51/81] target/arm: Split out formats for 3 vectors + 1 index, Richard Henderson, 2021/04/16
- [PATCH v5 56/81] target/arm: Implement SVE2 saturating multiply (indexed), Richard Henderson, 2021/04/16
- [PATCH v5 47/81] target/arm: Implement SVE2 SPLICE, EXT,
Richard Henderson <=
- [PATCH v5 50/81] target/arm: Split out formats for 2 vectors + 1 index, Richard Henderson, 2021/04/16
- [PATCH v5 49/81] target/arm: Pass separate addend to FCMLA helpers, Richard Henderson, 2021/04/16
- [PATCH v5 55/81] target/arm: Implement SVE2 saturating multiply-add (indexed), Richard Henderson, 2021/04/16
- [PATCH v5 57/81] target/arm: Implement SVE2 signed saturating doubling multiply high, Richard Henderson, 2021/04/16
- [PATCH v5 52/81] target/arm: Implement SVE2 integer multiply (indexed), Richard Henderson, 2021/04/16
- [PATCH v5 58/81] target/arm: Implement SVE2 saturating multiply high (indexed), Richard Henderson, 2021/04/16
- [PATCH v5 54/81] target/arm: Implement SVE2 saturating multiply-add high (indexed), Richard Henderson, 2021/04/16
- [PATCH v5 61/81] target/arm: Implement SVE2 crypto unary operations, Richard Henderson, 2021/04/16
- [PATCH v5 64/81] target/arm: Implement SVE2 TBL, TBX, Richard Henderson, 2021/04/16
- [PATCH v5 60/81] target/arm: Implement SVE mixed sign dot product, Richard Henderson, 2021/04/16