From 7dbfafc157290b52af6109b82b8398d10ef5c3b3 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 8 Jul 2022 20:45:24 +0530 Subject: target/arm: Implement REVD This is an SVE instruction that operates using the SVE vector length but that it is present only if SME is implemented. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20220708151540.18136-30-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/sve_helper.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'target/arm/sve_helper.c') diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index df16170469..d6f7ef94fe 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) -- cgit v1.2.3-55-g7522