[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 81/92] target/arm: Move endian adjustment macros to vec_intern
From: |
Richard Henderson |
Subject: |
[PATCH v7 81/92] target/arm: Move endian adjustment macros to vec_internal.h |
Date: |
Mon, 24 May 2021 18:03:47 -0700 |
We have two copies of these, one set of which is not complete.
Move them to a common header.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/vec_internal.h | 24 ++++++++++++++++++++++++
target/arm/sve_helper.c | 16 ----------------
target/arm/vec_helper.c | 12 ------------
3 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/target/arm/vec_internal.h b/target/arm/vec_internal.h
index ff694d870a..dba481e001 100644
--- a/target/arm/vec_internal.h
+++ b/target/arm/vec_internal.h
@@ -20,6 +20,30 @@
#ifndef TARGET_ARM_VEC_INTERNALS_H
#define TARGET_ARM_VEC_INTERNALS_H
+/*
+ * Note that vector data is stored in host-endian 64-bit chunks,
+ * so addressing units smaller than that needs a host-endian fixup.
+ *
+ * The H<N> macros are used when indexing an array of elements of size N.
+ *
+ * The H1_<N> macros are used when performing byte arithmetic and then
+ * casting the final pointer to a type of size N.
+ */
+#ifdef HOST_WORDS_BIGENDIAN
+#define H1(x) ((x) ^ 7)
+#define H1_2(x) ((x) ^ 6)
+#define H1_4(x) ((x) ^ 4)
+#define H2(x) ((x) ^ 3)
+#define H4(x) ((x) ^ 1)
+#else
+#define H1(x) (x)
+#define H1_2(x) (x)
+#define H1_4(x) (x)
+#define H2(x) (x)
+#define H4(x) (x)
+#endif
+
+
static inline void clear_tail(void *vd, uintptr_t opr_sz, uintptr_t max_sz)
{
uint64_t *d = vd + opr_sz;
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
index 4afb06fb2a..40af3024df 100644
--- a/target/arm/sve_helper.c
+++ b/target/arm/sve_helper.c
@@ -29,22 +29,6 @@
#include "vec_internal.h"
-/* Note that vector data is stored in host-endian 64-bit chunks,
- so addressing units smaller than that needs a host-endian fixup. */
-#ifdef HOST_WORDS_BIGENDIAN
-#define H1(x) ((x) ^ 7)
-#define H1_2(x) ((x) ^ 6)
-#define H1_4(x) ((x) ^ 4)
-#define H2(x) ((x) ^ 3)
-#define H4(x) ((x) ^ 1)
-#else
-#define H1(x) (x)
-#define H1_2(x) (x)
-#define H1_4(x) (x)
-#define H2(x) (x)
-#define H4(x) (x)
-#endif
-
/* Return a value for NZCV as per the ARM PredTest pseudofunction.
*
* The return value has bit 31 set if N is set, bit 1 set if Z is clear,
diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c
index 21ae1258f2..f5af45375d 100644
--- a/target/arm/vec_helper.c
+++ b/target/arm/vec_helper.c
@@ -25,18 +25,6 @@
#include "qemu/int128.h"
#include "vec_internal.h"
-/* Note that vector data is stored in host-endian 64-bit chunks,
- so addressing units smaller than that needs a host-endian fixup. */
-#ifdef HOST_WORDS_BIGENDIAN
-#define H1(x) ((x) ^ 7)
-#define H2(x) ((x) ^ 3)
-#define H4(x) ((x) ^ 1)
-#else
-#define H1(x) (x)
-#define H2(x) (x)
-#define H4(x) (x)
-#endif
-
/* Signed saturating rounding doubling multiply-accumulate high half, 8-bit */
int8_t do_sqrdmlah_b(int8_t src1, int8_t src2, int8_t src3,
bool neg, bool round)
--
2.25.1
- [PATCH v7 72/92] target/arm: Implement SVE2 FCVTNT, (continued)
- [PATCH v7 72/92] target/arm: Implement SVE2 FCVTNT, Richard Henderson, 2021/05/24
- [PATCH v7 74/92] target/arm: Implement SVE2 FCVTXNT, FCVTX, Richard Henderson, 2021/05/24
- [PATCH v7 75/92] target/arm: Implement SVE2 FLOGB, Richard Henderson, 2021/05/24
- [PATCH v7 73/92] target/arm: Implement SVE2 FCVTLT, Richard Henderson, 2021/05/24
- [PATCH v7 76/92] target/arm: Share table of sve load functions, Richard Henderson, 2021/05/24
- [PATCH v7 77/92] target/arm: Tidy do_ldrq, Richard Henderson, 2021/05/24
- [PATCH v7 79/92] target/arm: Implement 128-bit ZIP, UZP, TRN, Richard Henderson, 2021/05/24
- [PATCH v7 78/92] target/arm: Implement SVE2 LD1RO, Richard Henderson, 2021/05/24
- [PATCH v7 82/92] target/arm: Implement SVE2 fp multiply-add long, Richard Henderson, 2021/05/24
- [PATCH v7 80/92] target/arm: Implement SVE2 bitwise shift immediate, Richard Henderson, 2021/05/24
- [PATCH v7 81/92] target/arm: Move endian adjustment macros to vec_internal.h,
Richard Henderson <=
- [PATCH v7 83/92] target/arm: Implement aarch64 SUDOT, USDOT, Richard Henderson, 2021/05/24
- [PATCH v7 85/92] target/arm: Remove unused fpst from VDOT_scalar, Richard Henderson, 2021/05/24
- [PATCH v7 87/92] target/arm: Split out do_neon_ddda, Richard Henderson, 2021/05/24
- [PATCH v7 84/92] target/arm: Split out do_neon_ddda_fpst, Richard Henderson, 2021/05/24
- [PATCH v7 88/92] target/arm: Split decode of VSDOT and VUDOT, Richard Henderson, 2021/05/24
- [PATCH v7 89/92] target/arm: Implement aarch32 VSUDOT, VUSDOT, Richard Henderson, 2021/05/24
- [PATCH v7 86/92] target/arm: Fix decode for VDOT (indexed), Richard Henderson, 2021/05/24
- [PATCH v7 90/92] target/arm: Implement integer matrix multiply accumulate, Richard Henderson, 2021/05/24
- [PATCH v7 92/92] target/arm: Enable SVE2 and related extensions, Richard Henderson, 2021/05/24
- [PATCH v7 91/92] linux-user/aarch64: Enable hwcap bits for sve2 and related extensions, Richard Henderson, 2021/05/24