[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 44/81] target/arm: Implement SVE2 RSUBHNB, RSUBHNT
From: |
Richard Henderson |
Subject: |
[PATCH v3 44/81] target/arm: Implement SVE2 RSUBHNB, RSUBHNT |
Date: |
Fri, 18 Sep 2020 11:37:14 -0700 |
From: Stephen Long <steplong@quicinc.com>
This completes the section 'SVE2 integer add/subtract narrow high part'
Signed-off-by: Stephen Long <steplong@quicinc.com>
Message-Id: <20200417162231.10374-5-steplong@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
v2: Fix round bit type (laurent desnogues)
---
target/arm/helper-sve.h | 8 ++++++++
target/arm/sve.decode | 2 ++
target/arm/sve_helper.c | 10 ++++++++++
target/arm/translate-sve.c | 2 ++
4 files changed, 22 insertions(+)
diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h
index 4c57dde9a9..9e8641e1c0 100644
--- a/target/arm/helper-sve.h
+++ b/target/arm/helper-sve.h
@@ -2533,6 +2533,14 @@ DEF_HELPER_FLAGS_4(sve2_subhnt_h, TCG_CALL_NO_RWG, void,
ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_4(sve2_subhnt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_4(sve2_subhnt_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_4(sve2_rsubhnb_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_4(sve2_rsubhnb_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_4(sve2_rsubhnb_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+
+DEF_HELPER_FLAGS_4(sve2_rsubhnt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_4(sve2_rsubhnt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_4(sve2_rsubhnt_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
+
DEF_HELPER_FLAGS_5(sve2_match_ppzz_b, TCG_CALL_NO_RWG,
i32, ptr, ptr, ptr, ptr, i32)
DEF_HELPER_FLAGS_5(sve2_match_ppzz_h, TCG_CALL_NO_RWG,
diff --git a/target/arm/sve.decode b/target/arm/sve.decode
index 8ad2698bcf..3121eabbf8 100644
--- a/target/arm/sve.decode
+++ b/target/arm/sve.decode
@@ -1328,6 +1328,8 @@ RADDHNB 01000101 .. 1 ..... 011 010 ..... .....
@rd_rn_rm
RADDHNT 01000101 .. 1 ..... 011 011 ..... ..... @rd_rn_rm
SUBHNB 01000101 .. 1 ..... 011 100 ..... ..... @rd_rn_rm
SUBHNT 01000101 .. 1 ..... 011 101 ..... ..... @rd_rn_rm
+RSUBHNB 01000101 .. 1 ..... 011 110 ..... ..... @rd_rn_rm
+RSUBHNT 01000101 .. 1 ..... 011 111 ..... ..... @rd_rn_rm
### SVE2 Character Match
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
index 35681cf0c6..19fbf94189 100644
--- a/target/arm/sve_helper.c
+++ b/target/arm/sve_helper.c
@@ -2136,6 +2136,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t
desc) \
#define DO_ADDHN(N, M, SH) ((N + M) >> SH)
#define DO_RADDHN(N, M, SH) ((N + M + ((__typeof(N))1 << (SH - 1))) >> SH)
#define DO_SUBHN(N, M, SH) ((N - M) >> SH)
+#define DO_RSUBHN(N, M, SH) ((N - M + ((__typeof(N))1 << (SH - 1))) >> SH)
DO_BINOPNB(sve2_addhnb_h, uint16_t, uint8_t, 8, DO_ADDHN)
DO_BINOPNB(sve2_addhnb_s, uint32_t, uint16_t, 16, DO_ADDHN)
@@ -2161,6 +2162,15 @@ DO_BINOPNT(sve2_subhnt_h, uint16_t, uint8_t, 8, H1_2,
H1, DO_SUBHN)
DO_BINOPNT(sve2_subhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_SUBHN)
DO_BINOPNT(sve2_subhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_SUBHN)
+DO_BINOPNB(sve2_rsubhnb_h, uint16_t, uint8_t, 8, DO_RSUBHN)
+DO_BINOPNB(sve2_rsubhnb_s, uint32_t, uint16_t, 16, DO_RSUBHN)
+DO_BINOPNB(sve2_rsubhnb_d, uint64_t, uint32_t, 32, DO_RSUBHN)
+
+DO_BINOPNT(sve2_rsubhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_RSUBHN)
+DO_BINOPNT(sve2_rsubhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_RSUBHN)
+DO_BINOPNT(sve2_rsubhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_RSUBHN)
+
+#undef DO_RSUBHN
#undef DO_SUBHN
#undef DO_RADDHN
#undef DO_ADDHN
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 1c730a835f..e947a0ff25 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -7484,6 +7484,8 @@ DO_SVE2_ZZZ_NARROW(RADDHNT, raddhnt)
DO_SVE2_ZZZ_NARROW(SUBHNB, subhnb)
DO_SVE2_ZZZ_NARROW(SUBHNT, subhnt)
+DO_SVE2_ZZZ_NARROW(RSUBHNB, rsubhnb)
+DO_SVE2_ZZZ_NARROW(RSUBHNT, rsubhnt)
static bool do_sve2_ppzz_flags(DisasContext *s, arg_rprr_esz *a,
gen_helper_gvec_flags_4 *fn)
--
2.25.1
- [PATCH v3 53/81] target/arm: Split out formats for 2 vectors + 1 index, (continued)
- [PATCH v3 53/81] target/arm: Split out formats for 2 vectors + 1 index, Richard Henderson, 2020/09/18
- [PATCH v3 51/81] target/arm: Pass separate addend to {U, S}DOT helpers, Richard Henderson, 2020/09/18
- [PATCH v3 59/81] target/arm: Implement SVE2 integer multiply long (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 55/81] target/arm: Implement SVE2 integer multiply (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 60/81] target/arm: Implement SVE2 saturating multiply (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 63/81] target/arm: Implement SVE2 multiply-add long (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 65/81] target/arm: Implement SVE mixed sign dot product (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 64/81] target/arm: Implement SVE2 complex integer multiply-add (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 67/81] target/arm: Implement SVE2 crypto unary operations, Richard Henderson, 2020/09/18
- [PATCH v3 70/81] target/arm: Implement SVE2 TBL, TBX, Richard Henderson, 2020/09/18
- [PATCH v3 44/81] target/arm: Implement SVE2 RSUBHNB, RSUBHNT,
Richard Henderson <=
- [PATCH v3 54/81] target/arm: Split out formats for 3 vectors + 1 index, Richard Henderson, 2020/09/18
- [PATCH v3 57/81] target/arm: Implement SVE2 saturating multiply-add high (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 62/81] target/arm: Implement SVE2 saturating multiply high (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 58/81] target/arm: Implement SVE2 saturating multiply-add (indexed), Richard Henderson, 2020/09/18
- [PATCH v3 61/81] target/arm: Implement SVE2 signed saturating doubling multiply high, Richard Henderson, 2020/09/18
- [PATCH v3 69/81] target/arm: Implement SVE2 crypto constructive binary operations, Richard Henderson, 2020/09/18
- [PATCH v3 73/81] target/arm: Implement SVE2 FCVTXNT, FCVTX, Richard Henderson, 2020/09/18
- [PATCH v3 68/81] target/arm: Implement SVE2 crypto destructive binary operations, Richard Henderson, 2020/09/18
- [PATCH v3 77/81] target/arm: Implement 128-bit ZIP, UZP, TRN, Richard Henderson, 2020/09/18
- [PATCH v3 66/81] target/arm: Implement SVE mixed sign dot product, Richard Henderson, 2020/09/18