[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 55/71] target/arm: Implement REVD
From: |
Richard Henderson |
Subject: |
[PATCH v2 55/71] target/arm: Implement REVD |
Date: |
Tue, 7 Jun 2022 13:32:50 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/helper-sve.h | 2 ++
target/arm/sve_helper.c | 16 ++++++++++++++++
target/arm/translate-sve.c | 2 ++
target/arm/sve.decode | 1 +
4 files changed, 21 insertions(+)
diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h
index ab0333400f..cc4e1d8948 100644
--- a/target/arm/helper-sve.h
+++ b/target/arm/helper-sve.h
@@ -719,6 +719,8 @@ DEF_HELPER_FLAGS_4(sve_revh_d, TCG_CALL_NO_RWG, void, ptr,
ptr, ptr, i32)
DEF_HELPER_FLAGS_4(sve_revw_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_4(sme_revd_q, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+
DEF_HELPER_FLAGS_4(sve_rbit_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_4(sve_rbit_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_4(sve_rbit_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
index 9a26f253e0..5de82696b5 100644
--- a/target/arm/sve_helper.c
+++ b/target/arm/sve_helper.c
@@ -931,6 +931,22 @@ DO_ZPZ_D(sve_revh_d, uint64_t, hswap64)
DO_ZPZ_D(sve_revw_d, uint64_t, wswap64)
+void HELPER(sme_revd_q)(void *vd, void *vn, void *vg, uint32_t desc)
+{
+ intptr_t i, opr_sz = simd_oprsz(desc) / 8;
+ uint64_t *d = vd, *n = vn;
+ uint8_t *pg = vg;
+
+ for (i = 0; i < opr_sz; i += 2) {
+ if (pg[H1(i)] & 1) {
+ uint64_t n0 = n[i + 0];
+ uint64_t n1 = n[i + 1];
+ d[i + 0] = n1;
+ d[i + 1] = n0;
+ }
+ }
+}
+
DO_ZPZ(sve_rbit_b, uint8_t, H1, revbit8)
DO_ZPZ(sve_rbit_h, uint16_t, H1_2, revbit16)
DO_ZPZ(sve_rbit_s, uint32_t, H1_4, revbit32)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 58d0894e15..1129f1fc56 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -2896,6 +2896,8 @@ TRANS_FEAT(REVH, aa64_sve, gen_gvec_ool_arg_zpz,
revh_fns[a->esz], a, 0)
TRANS_FEAT(REVW, aa64_sve, gen_gvec_ool_arg_zpz,
a->esz == 3 ? gen_helper_sve_revw_d : NULL, a, 0)
+TRANS_FEAT(REVD, aa64_sme, gen_gvec_ool_arg_zpz, gen_helper_sme_revd_q, a, 0)
+
TRANS_FEAT(SPLICE, aa64_sve, gen_gvec_ool_arg_zpzz,
gen_helper_sve_splice, a, a->esz)
diff --git a/target/arm/sve.decode b/target/arm/sve.decode
index bf561c270a..d1e229fd6e 100644
--- a/target/arm/sve.decode
+++ b/target/arm/sve.decode
@@ -652,6 +652,7 @@ REVB 00000101 .. 1001 00 100 ... ..... .....
@rd_pg_rn
REVH 00000101 .. 1001 01 100 ... ..... ..... @rd_pg_rn
REVW 00000101 .. 1001 10 100 ... ..... ..... @rd_pg_rn
RBIT 00000101 .. 1001 11 100 ... ..... ..... @rd_pg_rn
+REVD 00000101 00 1011 10 100 ... ..... ..... @rd_pg_rn_e0
# SVE vector splice (predicated, destructive)
SPLICE 00000101 .. 101 100 100 ... ..... ..... @rdn_pg_rm
--
2.34.1
- [PATCH v2 49/71] target/arm: Implement SME ADDHA, ADDVA, (continued)
- [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
- [PATCH v2 55/71] target/arm: Implement REVD,
Richard Henderson <=
- [PATCH v2 56/71] target/arm: Implement SCLAMP, UCLAMP, Richard Henderson, 2022/06/07
- [PATCH v2 58/71] target/arm: Enable SME for -cpu max, Richard Henderson, 2022/06/07
- [PATCH v2 62/71] linux-user/aarch64: Tidy target_restore_sigframe error return, Richard Henderson, 2022/06/07
- [PATCH v2 60/71] linux-user/aarch64: Reset PSTATE.SM on syscalls, Richard Henderson, 2022/06/07
- [PATCH v2 65/71] linux-user/aarch64: Move sve record checks into restore, Richard Henderson, 2022/06/07
- [PATCH v2 63/71] linux-user/aarch64: Do not allow duplicate or short sve records, Richard Henderson, 2022/06/07
- [PATCH v2 64/71] linux-user/aarch64: Verify extra record lock succeeded, Richard Henderson, 2022/06/07
- [PATCH v2 67/71] linux-user: Rename sve prctls, Richard Henderson, 2022/06/07
- [PATCH v2 68/71] linux-user/aarch64: Implement PR_SME_GET_VL, PR_SME_SET_VL, Richard Henderson, 2022/06/07
- [PATCH v2 66/71] linux-user/aarch64: Implement SME signal handling, Richard Henderson, 2022/06/07