[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 17/45] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL
From: |
Richard Henderson |
Subject: |
[PATCH v6 17/45] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL |
Date: |
Fri, 8 Jul 2022 20:45:12 +0530 |
These SME instructions are nominally within the SVE decode space,
so we add them to sve.decode and translate-sve.c.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
v4: Add streaming_{vec,pred}_reg_size.
---
target/arm/translate-a64.h | 12 ++++++++++++
target/arm/sve.decode | 5 ++++-
target/arm/translate-sve.c | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h
index 02fb95e019..099d3d11d6 100644
--- a/target/arm/translate-a64.h
+++ b/target/arm/translate-a64.h
@@ -128,6 +128,12 @@ static inline int vec_full_reg_size(DisasContext *s)
return s->vl;
}
+/* Return the byte size of the vector register, SVL / 8. */
+static inline int streaming_vec_reg_size(DisasContext *s)
+{
+ return s->svl;
+}
+
/*
* Return the offset info CPUARMState of the predicate vector register Pn.
* Note for this purpose, FFR is P16.
@@ -143,6 +149,12 @@ static inline int pred_full_reg_size(DisasContext *s)
return s->vl >> 3;
}
+/* Return the byte size of the predicate register, SVL / 64. */
+static inline int streaming_pred_reg_size(DisasContext *s)
+{
+ return s->svl >> 3;
+}
+
/*
* Round up the size of a register to a size allowed by
* the tcg vector infrastructure. Any operation which uses this
diff --git a/target/arm/sve.decode b/target/arm/sve.decode
index 908643d7d9..95af08c139 100644
--- a/target/arm/sve.decode
+++ b/target/arm/sve.decode
@@ -449,14 +449,17 @@ INDEX_ri 00000100 esz:2 1 imm:s5 010001 rn:5 rd:5
# SVE index generation (register start, register increment)
INDEX_rr 00000100 .. 1 ..... 010011 ..... ..... @rd_rn_rm
-### SVE Stack Allocation Group
+### SVE / Streaming SVE Stack Allocation Group
# SVE stack frame adjustment
ADDVL 00000100 001 ..... 01010 ...... ..... @rd_rn_i6
+ADDSVL 00000100 001 ..... 01011 ...... ..... @rd_rn_i6
ADDPL 00000100 011 ..... 01010 ...... ..... @rd_rn_i6
+ADDSPL 00000100 011 ..... 01011 ...... ..... @rd_rn_i6
# SVE stack frame size
RDVL 00000100 101 11111 01010 imm:s6 rd:5
+RDSVL 00000100 101 11111 01011 imm:s6 rd:5
### SVE Bitwise Shift - Unpredicated Group
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 96e934c1ea..95016e49e9 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -1286,6 +1286,19 @@ static bool trans_ADDVL(DisasContext *s, arg_ADDVL *a)
return true;
}
+static bool trans_ADDSVL(DisasContext *s, arg_ADDSVL *a)
+{
+ if (!dc_isar_feature(aa64_sme, s)) {
+ return false;
+ }
+ if (sme_enabled_check(s)) {
+ TCGv_i64 rd = cpu_reg_sp(s, a->rd);
+ TCGv_i64 rn = cpu_reg_sp(s, a->rn);
+ tcg_gen_addi_i64(rd, rn, a->imm * streaming_vec_reg_size(s));
+ }
+ return true;
+}
+
static bool trans_ADDPL(DisasContext *s, arg_ADDPL *a)
{
if (!dc_isar_feature(aa64_sve, s)) {
@@ -1299,6 +1312,19 @@ static bool trans_ADDPL(DisasContext *s, arg_ADDPL *a)
return true;
}
+static bool trans_ADDSPL(DisasContext *s, arg_ADDSPL *a)
+{
+ if (!dc_isar_feature(aa64_sme, s)) {
+ return false;
+ }
+ if (sme_enabled_check(s)) {
+ TCGv_i64 rd = cpu_reg_sp(s, a->rd);
+ TCGv_i64 rn = cpu_reg_sp(s, a->rn);
+ tcg_gen_addi_i64(rd, rn, a->imm * streaming_pred_reg_size(s));
+ }
+ return true;
+}
+
static bool trans_RDVL(DisasContext *s, arg_RDVL *a)
{
if (!dc_isar_feature(aa64_sve, s)) {
@@ -1311,6 +1337,18 @@ static bool trans_RDVL(DisasContext *s, arg_RDVL *a)
return true;
}
+static bool trans_RDSVL(DisasContext *s, arg_RDSVL *a)
+{
+ if (!dc_isar_feature(aa64_sme, s)) {
+ return false;
+ }
+ if (sme_enabled_check(s)) {
+ TCGv_i64 reg = cpu_reg(s, a->rd);
+ tcg_gen_movi_i64(reg, a->imm * streaming_vec_reg_size(s));
+ }
+ return true;
+}
+
/*
*** SVE Compute Vector Address Group
*/
--
2.34.1
- [PATCH v6 08/45] target/arm: Mark FTSMUL, FTMAD, FADDA as non-streaming, (continued)
- [PATCH v6 08/45] target/arm: Mark FTSMUL, FTMAD, FADDA as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 10/45] target/arm: Mark string/histo/crypto as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 06/45] target/arm: Mark BDEP, BEXT, BGRP, COMPACT, FEXPA, FTSSEL as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 07/45] target/arm: Mark PMULL, FMMLA as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 11/45] target/arm: Mark gather/scatter load/store as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 12/45] target/arm: Mark gather prefetch as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 14/45] target/arm: Mark LD1RO as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 15/45] target/arm: Add SME enablement checks, Richard Henderson, 2022/07/08
- [PATCH v6 13/45] target/arm: Mark LDFF1 and LDNF1 as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 16/45] target/arm: Handle SME in sve_access_check, Richard Henderson, 2022/07/08
- [PATCH v6 17/45] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL,
Richard Henderson <=
- [PATCH v6 18/45] target/arm: Implement SME ZERO, Richard Henderson, 2022/07/08
- [PATCH v6 19/45] target/arm: Implement SME MOVA, Richard Henderson, 2022/07/08
- [PATCH v6 20/45] target/arm: Implement SME LD1, ST1, Richard Henderson, 2022/07/08
- [PATCH v6 21/45] target/arm: Export unpredicated ld/st from translate-sve.c, Richard Henderson, 2022/07/08
- [PATCH v6 22/45] target/arm: Implement SME LDR, STR, Richard Henderson, 2022/07/08
- [PATCH v6 23/45] target/arm: Implement SME ADDHA, ADDVA, Richard Henderson, 2022/07/08
- [PATCH v6 24/45] target/arm: Implement FMOPA, FMOPS (non-widening), Richard Henderson, 2022/07/08
- [PATCH v6 25/45] target/arm: Implement BFMOPA, BFMOPS, Richard Henderson, 2022/07/08
- [PATCH v6 26/45] target/arm: Implement FMOPA, FMOPS (widening), Richard Henderson, 2022/07/08
- [PATCH v6 27/45] target/arm: Implement SME integer outer product, Richard Henderson, 2022/07/08