[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 20/51] target/arm: Move pred_{full, gvec}_reg_{offset, size} t
From: |
Richard Henderson |
Subject: |
[PATCH v3 20/51] target/arm: Move pred_{full, gvec}_reg_{offset, size} to translate-a64.h |
Date: |
Mon, 20 Jun 2022 10:52:04 -0700 |
We will need these functions in translate-sme.c.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-a64.h | 38 ++++++++++++++++++++++++++++++++++++++
target/arm/translate-sve.c | 36 ------------------------------------
2 files changed, 38 insertions(+), 36 deletions(-)
diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h
index dbc917ee65..f0970c6b8c 100644
--- a/target/arm/translate-a64.h
+++ b/target/arm/translate-a64.h
@@ -107,6 +107,44 @@ static inline int vec_full_reg_size(DisasContext *s)
return s->vl;
}
+/*
+ * Return the offset info CPUARMState of the predicate vector register Pn.
+ * Note for this purpose, FFR is P16.
+ */
+static inline int pred_full_reg_offset(DisasContext *s, int regno)
+{
+ return offsetof(CPUARMState, vfp.pregs[regno]);
+}
+
+/* Return the byte size of the whole predicate register, VL / 64. */
+static inline int pred_full_reg_size(DisasContext *s)
+{
+ return s->vl >> 3;
+}
+
+/*
+ * Round up the size of a register to a size allowed by
+ * the tcg vector infrastructure. Any operation which uses this
+ * size may assume that the bits above pred_full_reg_size are zero,
+ * and must leave them the same way.
+ *
+ * Note that this is not needed for the vector registers as they
+ * are always properly sized for tcg vectors.
+ */
+static inline int size_for_gvec(int size)
+{
+ if (size <= 8) {
+ return 8;
+ } else {
+ return QEMU_ALIGN_UP(size, 16);
+ }
+}
+
+static inline int pred_gvec_reg_size(DisasContext *s)
+{
+ return size_for_gvec(pred_full_reg_size(s));
+}
+
bool disas_sve(DisasContext *, uint32_t);
void gen_gvec_rax1(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 67761bf2cc..62b5f3040c 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -100,42 +100,6 @@ static inline int msz_dtype(DisasContext *s, int msz)
* Implement all of the translator functions referenced by the decoder.
*/
-/* Return the offset info CPUARMState of the predicate vector register Pn.
- * Note for this purpose, FFR is P16.
- */
-static inline int pred_full_reg_offset(DisasContext *s, int regno)
-{
- return offsetof(CPUARMState, vfp.pregs[regno]);
-}
-
-/* Return the byte size of the whole predicate register, VL / 64. */
-static inline int pred_full_reg_size(DisasContext *s)
-{
- return s->vl >> 3;
-}
-
-/* Round up the size of a register to a size allowed by
- * the tcg vector infrastructure. Any operation which uses this
- * size may assume that the bits above pred_full_reg_size are zero,
- * and must leave them the same way.
- *
- * Note that this is not needed for the vector registers as they
- * are always properly sized for tcg vectors.
- */
-static int size_for_gvec(int size)
-{
- if (size <= 8) {
- return 8;
- } else {
- return QEMU_ALIGN_UP(size, 16);
- }
-}
-
-static int pred_gvec_reg_size(DisasContext *s)
-{
- return size_for_gvec(pred_full_reg_size(s));
-}
-
/* Invoke an out-of-line helper on 2 Zregs. */
static bool gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn,
int rd, int rn, int data)
--
2.34.1
- [PATCH v3 09/51] target/arm: Add the SME ZA storage to CPUARMState, (continued)
- [PATCH v3 09/51] target/arm: Add the SME ZA storage to CPUARMState, Richard Henderson, 2022/06/20
- [PATCH v3 11/51] target/arm: Move error for sve%d property to arm_cpu_sve_finalize, Richard Henderson, 2022/06/20
- [PATCH v3 12/51] target/arm: Create ARMVQMap, Richard Henderson, 2022/06/20
- [PATCH v3 14/51] target/arm: Generalize cpu_arm_{get, set}_default_vec_len, Richard Henderson, 2022/06/20
- [PATCH v3 16/51] target/arm: Unexport aarch64_add_*_properties, Richard Henderson, 2022/06/20
- [PATCH v3 13/51] target/arm: Generalize cpu_arm_{get,set}_vq, Richard Henderson, 2022/06/20
- [PATCH v3 17/51] target/arm: Add cpu properties for SME, Richard Henderson, 2022/06/20
- [PATCH v3 19/51] target/arm: Add SVL to TB flags, Richard Henderson, 2022/06/20
- [PATCH v3 20/51] target/arm: Move pred_{full, gvec}_reg_{offset, size} to translate-a64.h,
Richard Henderson <=
- [PATCH v3 18/51] target/arm: Introduce sve_vqm1_for_el_sm, Richard Henderson, 2022/06/20
- [PATCH v3 22/51] target/arm: Trap AdvSIMD usage when Streaming SVE is active, Richard Henderson, 2022/06/20
[PATCH v3 28/51] target/arm: Implement SME LDR, STR, Richard Henderson, 2022/06/20
[PATCH v3 29/51] target/arm: Implement SME ADDHA, ADDVA, Richard Henderson, 2022/06/20