[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 48/71] target/arm: Implement SME LDR, STR
From: |
Richard Henderson |
Subject: |
[PATCH v2 48/71] target/arm: Implement SME LDR, STR |
Date: |
Tue, 7 Jun 2022 13:32:43 -0700 |
We can reuse the SVE functions for LDR and STR, passing in the
base of the ZA vector and a zero offset.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-sme.c | 23 +++++++++++++++++++++++
target/arm/sme.decode | 7 +++++++
2 files changed, 30 insertions(+)
diff --git a/target/arm/translate-sme.c b/target/arm/translate-sme.c
index 978af74d1d..c3e544d69c 100644
--- a/target/arm/translate-sme.c
+++ b/target/arm/translate-sme.c
@@ -220,3 +220,26 @@ static bool trans_LDST1(DisasContext *s, arg_LDST1 *a)
tcg_temp_free_i64(addr);
return true;
}
+
+typedef void GenLdStR(DisasContext *, TCGv_ptr, int, int, int, int);
+
+static bool do_ldst_r(DisasContext *s, arg_ldstr *a, GenLdStR *fn)
+{
+ int imm = a->imm;
+ TCGv_ptr base;
+
+ if (!sme_za_enabled_check(s)) {
+ return true;
+ }
+
+ /* ZA[n] equates to ZA0H.B[n]. */
+ base = get_tile_rowcol(s, MO_8, a->rv, imm, false);
+
+ fn(s, base, 0, s->svl, a->rn, imm * s->svl);
+
+ tcg_temp_free_ptr(base);
+ return true;
+}
+
+TRANS_FEAT(LDR, aa64_sme, do_ldst_r, a, gen_sve_ldr)
+TRANS_FEAT(STR, aa64_sme, do_ldst_r, a, gen_sve_str)
diff --git a/target/arm/sme.decode b/target/arm/sme.decode
index 900e3f2a07..f1ebd857a5 100644
--- a/target/arm/sme.decode
+++ b/target/arm/sme.decode
@@ -46,3 +46,10 @@ LDST1 1110000 0 esz:2 st:1 rm:5 v:1 .. pg:3 rn:5 0
za_imm:4 \
&ldst rs=%mova_rs
LDST1 1110000 111 st:1 rm:5 v:1 .. pg:3 rn:5 0 za_imm:4 \
&ldst esz=4 rs=%mova_rs
+
+&ldstr rv rn imm
+@ldstr ....... ... . ...... .. ... rn:5 . imm:4 \
+ &ldstr rv=%mova_rs
+
+LDR 1110000 100 0 000000 .. 000 ..... 0 .... @ldstr
+STR 1110000 100 1 000000 .. 000 ..... 0 .... @ldstr
--
2.34.1
- Re: [PATCH v2 40/71] target/arm: Move pred_{full, gvec}_reg_{offset, size} to translate-a64.h, (continued)
- [PATCH v2 43/71] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL, Richard Henderson, 2022/06/07
- [PATCH v2 47/71] target/arm: Export unpredicated ld/st from translate-sve.c, Richard Henderson, 2022/06/07
- [PATCH v2 44/71] target/arm: Implement SME ZERO, Richard Henderson, 2022/06/07
- [PATCH v2 45/71] target/arm: Implement SME MOVA, Richard Henderson, 2022/06/07
- [PATCH v2 46/71] target/arm: Implement SME LD1, ST1, Richard Henderson, 2022/06/07
- [PATCH v2 48/71] target/arm: Implement SME LDR, STR,
Richard Henderson <=
- [PATCH v2 49/71] target/arm: Implement SME ADDHA, ADDVA, Richard Henderson, 2022/06/07
- [PATCH v2 42/71] target/arm: Trap AdvSIMD usage when Streaming SVE is active, Richard Henderson, 2022/06/07
- [PATCH v2 51/71] target/arm: Implement BFMOPA, BFMOPS, Richard Henderson, 2022/06/07
- [PATCH v2 53/71] target/arm: Implement SME integer outer product, Richard Henderson, 2022/06/07
- [PATCH v2 54/71] target/arm: Implement PSEL, Richard Henderson, 2022/06/07
- [PATCH v2 50/71] target/arm: Implement FMOPA, FMOPS (non-widening), Richard Henderson, 2022/06/07
- [PATCH v2 52/71] target/arm: Implement FMOPA, FMOPS (widening), Richard Henderson, 2022/06/07
- [PATCH v2 57/71] target/arm: Reset streaming sve state on exception boundaries, Richard Henderson, 2022/06/07
- [PATCH v2 59/71] linux-user/aarch64: Clear tpidr2_el0 if CLONE_SETTLS, Richard Henderson, 2022/06/07
- [PATCH v2 61/71] linux-user/aarch64: Add SM bit to SVE signal context, Richard Henderson, 2022/06/07