qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, steplong@quicinc.com
Subject: [PATCH v2 073/100] target/arm: Implement SVE2 integer multiply-add (indexed)
Date: Wed, 17 Jun 2020 21:26:17 -0700	[thread overview]
Message-ID: <20200618042644.1685561-74-richard.henderson@linaro.org> (raw)
In-Reply-To: <20200618042644.1685561-1-richard.henderson@linaro.org>

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/helper.h        | 14 ++++++++++++++
 target/arm/sve.decode      |  8 ++++++++
 target/arm/translate-sve.c | 23 +++++++++++++++++++++++
 target/arm/vec_helper.c    | 25 +++++++++++++++++++++++++
 4 files changed, 70 insertions(+)

diff --git a/target/arm/helper.h b/target/arm/helper.h
index ce81a16a58..7964d299f6 100644
--- a/target/arm/helper.h
+++ b/target/arm/helper.h
@@ -793,6 +793,20 @@ DEF_HELPER_FLAGS_4(gvec_mul_idx_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
 DEF_HELPER_FLAGS_4(gvec_mul_idx_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
 DEF_HELPER_FLAGS_4(gvec_mul_idx_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
 
+DEF_HELPER_FLAGS_5(gvec_mla_idx_h, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_5(gvec_mla_idx_s, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_5(gvec_mla_idx_d, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+
+DEF_HELPER_FLAGS_5(gvec_mls_idx_h, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_5(gvec_mls_idx_s, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+DEF_HELPER_FLAGS_5(gvec_mls_idx_d, TCG_CALL_NO_RWG,
+                   void, ptr, ptr, ptr, ptr, i32)
+
 #ifdef TARGET_AARCH64
 #include "helper-a64.h"
 #include "helper-sve.h"
diff --git a/target/arm/sve.decode b/target/arm/sve.decode
index fa0a572da6..467a93052f 100644
--- a/target/arm/sve.decode
+++ b/target/arm/sve.decode
@@ -785,6 +785,14 @@ SDOT_zzxw_d     01000100 .. 1 ..... 000000 ..... .....          @rrxr_d
 UDOT_zzxw_s     01000100 .. 1 ..... 000001 ..... .....          @rrxr_s
 UDOT_zzxw_d     01000100 .. 1 ..... 000001 ..... .....          @rrxr_d
 
+# SVE2 integer multiply-add (indexed)
+MLA_zzxz_h      01000100 .. 1 ..... 000010 ..... .....          @rrxr_h
+MLA_zzxz_s      01000100 .. 1 ..... 000010 ..... .....          @rrxr_s
+MLA_zzxz_d      01000100 .. 1 ..... 000010 ..... .....          @rrxr_d
+MLS_zzxz_h      01000100 .. 1 ..... 000011 ..... .....          @rrxr_h
+MLS_zzxz_s      01000100 .. 1 ..... 000011 ..... .....          @rrxr_s
+MLS_zzxz_d      01000100 .. 1 ..... 000011 ..... .....          @rrxr_d
+
 # SVE2 integer multiply (indexed)
 MUL_zzx_h       01000100 .. 1 ..... 111110 ..... .....          @rrx_h
 MUL_zzx_s       01000100 .. 1 ..... 111110 ..... .....          @rrx_s
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index dd2cd22061..0fb88f4aa5 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -3870,6 +3870,29 @@ DO_SVE2_RRX(trans_MUL_zzx_d, gen_helper_gvec_mul_idx_d)
 
 #undef DO_SVE2_RRX
 
+static bool do_sve2_zzxz_ool(DisasContext *s, arg_rrxr_esz *a,
+                             gen_helper_gvec_4 *fn)
+{
+    if (!dc_isar_feature(aa64_sve2, s)) {
+        return false;
+    }
+    return do_zzxz_ool(s, a, fn);
+}
+
+#define DO_SVE2_RRXR(NAME, FUNC) \
+    static bool NAME(DisasContext *s, arg_rrxr_esz *a)  \
+    { return do_sve2_zzxz_ool(s, a, FUNC); }
+
+DO_SVE2_RRXR(trans_MLA_zzxz_h, gen_helper_gvec_mla_idx_h)
+DO_SVE2_RRXR(trans_MLA_zzxz_s, gen_helper_gvec_mla_idx_s)
+DO_SVE2_RRXR(trans_MLA_zzxz_d, gen_helper_gvec_mla_idx_d)
+
+DO_SVE2_RRXR(trans_MLS_zzxz_h, gen_helper_gvec_mls_idx_h)
+DO_SVE2_RRXR(trans_MLS_zzxz_s, gen_helper_gvec_mls_idx_s)
+DO_SVE2_RRXR(trans_MLS_zzxz_d, gen_helper_gvec_mls_idx_d)
+
+#undef DO_SVE2_RRXR
+
 /*
  *** SVE Floating Point Multiply-Add Indexed Group
  */
diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c
index 08eadf06fc..fb8596c1fd 100644
--- a/target/arm/vec_helper.c
+++ b/target/arm/vec_helper.c
@@ -883,6 +883,31 @@ DO_MUL_IDX(gvec_mul_idx_d, uint64_t, )
 
 #undef DO_MUL_IDX
 
+#define DO_MLA_IDX(NAME, TYPE, OP, H) \
+void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc)   \
+{                                                                          \
+    intptr_t i, j, oprsz = simd_oprsz(desc), segment = 16 / sizeof(TYPE);  \
+    intptr_t idx = simd_data(desc);                                        \
+    TYPE *d = vd, *n = vn, *m = vm, *a = va;                               \
+    for (i = 0; i < oprsz / sizeof(TYPE); i += segment) {                  \
+        TYPE mm = m[H(i + idx)];                                           \
+        for (j = 0; j < segment; j++) {                                    \
+            d[i + j] = a[i + j] OP n[i + j] * mm;                          \
+        }                                                                  \
+    }                                                                      \
+    clear_tail(d, oprsz, simd_maxsz(desc));                                \
+}
+
+DO_MLA_IDX(gvec_mla_idx_h, uint16_t, +, H2)
+DO_MLA_IDX(gvec_mla_idx_s, uint32_t, +, H4)
+DO_MLA_IDX(gvec_mla_idx_d, uint64_t, +,   )
+
+DO_MLA_IDX(gvec_mls_idx_h, uint16_t, -, H2)
+DO_MLA_IDX(gvec_mls_idx_s, uint32_t, -, H4)
+DO_MLA_IDX(gvec_mls_idx_d, uint64_t, -,   )
+
+#undef DO_MLA_IDX
+
 #define DO_FMUL_IDX(NAME, TYPE, H) \
 void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \
 {                                                                          \
-- 
2.25.1



  parent reply	other threads:[~2020-06-18  5:02 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18  4:25 [PATCH v2 000/100] target/arm: Implement SVE2 Richard Henderson
2020-06-18  4:25 ` [PATCH v2 001/100] tcg: Save/restore vecop_list around minmax fallback Richard Henderson
2020-06-18  4:25 ` [PATCH v2 002/100] qemu/int128: Add int128_lshift Richard Henderson
2020-06-18  4:25 ` [PATCH v2 003/100] target/arm: Split out gen_gvec_fn_zz Richard Henderson
2020-06-18  4:25 ` [PATCH v2 004/100] target/arm: Split out gen_gvec_fn_zzz, do_zzz_fn Richard Henderson
2020-06-18  4:25 ` [PATCH v2 005/100] target/arm: Rearrange {sve, fp}_check_access assert Richard Henderson
2020-06-18  4:25 ` [PATCH v2 006/100] target/arm: Merge do_vector2_p into do_mov_p Richard Henderson
2020-06-18  4:25 ` [PATCH v2 007/100] target/arm: Clean up 4-operand predicate expansion Richard Henderson
2020-06-18  4:25 ` [PATCH v2 008/100] target/arm: Use tcg_gen_gvec_bitsel for trans_SEL_pppp Richard Henderson
2020-06-18  4:25 ` [PATCH v2 009/100] target/arm: Split out gen_gvec_ool_zzzp Richard Henderson
2020-06-18  4:25 ` [PATCH v2 010/100] target/arm: Merge helper_sve_clr_* and helper_sve_movz_* Richard Henderson
2020-06-18  4:25 ` [PATCH v2 011/100] target/arm: Split out gen_gvec_ool_zzp Richard Henderson
2020-06-18  4:25 ` [PATCH v2 012/100] target/arm: Split out gen_gvec_ool_zzz Richard Henderson
2020-06-18  4:25 ` [PATCH v2 013/100] target/arm: Split out gen_gvec_ool_zz Richard Henderson
2020-06-18  4:25 ` [PATCH v2 014/100] target/arm: Add ID_AA64ZFR0 fields and isar_feature_aa64_sve2 Richard Henderson
2020-06-18  4:25 ` [PATCH v2 015/100] target/arm: Enable SVE2 and some extensions Richard Henderson
2020-06-18  4:25 ` [PATCH v2 016/100] target/arm: Implement SVE2 Integer Multiply - Unpredicated Richard Henderson
2020-06-18  4:25 ` [PATCH v2 017/100] target/arm: Implement SVE2 integer pairwise add and accumulate long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 018/100] target/arm: Implement SVE2 integer unary operations (predicated) Richard Henderson
2020-06-18  4:25 ` [PATCH v2 019/100] target/arm: Split out saturating/rounding shifts from neon Richard Henderson
2020-06-18  4:25 ` [PATCH v2 020/100] target/arm: Implement SVE2 saturating/rounding bitwise shift left (predicated) Richard Henderson
2020-06-18  4:25 ` [PATCH v2 021/100] target/arm: Implement SVE2 integer halving add/subtract (predicated) Richard Henderson
2020-06-18  4:25 ` [PATCH v2 022/100] target/arm: Implement SVE2 integer pairwise arithmetic Richard Henderson
2020-06-18  4:25 ` [PATCH v2 023/100] target/arm: Implement SVE2 saturating add/subtract (predicated) Richard Henderson
2020-06-18  4:25 ` [PATCH v2 024/100] target/arm: Implement SVE2 integer add/subtract long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 025/100] target/arm: Implement SVE2 integer add/subtract interleaved long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 026/100] target/arm: Implement SVE2 integer add/subtract wide Richard Henderson
2020-06-18  4:25 ` [PATCH v2 027/100] target/arm: Implement SVE2 integer multiply long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 028/100] target/arm: Implement PMULLB and PMULLT Richard Henderson
2020-06-18  4:25 ` [PATCH v2 029/100] target/arm: Tidy SVE tszimm shift formats Richard Henderson
2020-06-18  4:25 ` [PATCH v2 030/100] target/arm: Implement SVE2 bitwise shift left long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 031/100] target/arm: Implement SVE2 bitwise exclusive-or interleaved Richard Henderson
2020-06-18  4:25 ` [PATCH v2 032/100] target/arm: Implement SVE2 bitwise permute Richard Henderson
2020-06-18  4:25 ` [PATCH v2 033/100] target/arm: Implement SVE2 complex integer add Richard Henderson
2020-06-18  4:25 ` [PATCH v2 034/100] target/arm: Implement SVE2 integer absolute difference and accumulate long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 035/100] target/arm: Implement SVE2 integer add/subtract long with carry Richard Henderson
2020-06-18  4:25 ` [PATCH v2 036/100] target/arm: Implement SVE2 bitwise shift right and accumulate Richard Henderson
2020-06-18  4:25 ` [PATCH v2 037/100] target/arm: Implement SVE2 bitwise shift and insert Richard Henderson
2020-06-18  4:25 ` [PATCH v2 038/100] target/arm: Implement SVE2 integer absolute difference and accumulate Richard Henderson
2020-06-18  4:25 ` [PATCH v2 039/100] target/arm: Implement SVE2 saturating extract narrow Richard Henderson
2020-06-18  4:25 ` [PATCH v2 040/100] target/arm: Implement SVE2 floating-point pairwise Richard Henderson
2020-06-18  4:25 ` [PATCH v2 041/100] target/arm: Implement SVE2 SHRN, RSHRN Richard Henderson
2020-06-18  4:25 ` [PATCH v2 042/100] target/arm: Implement SVE2 SQSHRUN, SQRSHRUN Richard Henderson
2020-06-18  4:25 ` [PATCH v2 043/100] target/arm: Implement SVE2 UQSHRN, UQRSHRN Richard Henderson
2020-06-18  4:25 ` [PATCH v2 044/100] target/arm: Implement SVE2 SQSHRN, SQRSHRN Richard Henderson
2020-06-18  4:25 ` [PATCH v2 045/100] target/arm: Implement SVE2 WHILEGT, WHILEGE, WHILEHI, WHILEHS Richard Henderson
2020-06-18  4:25 ` [PATCH v2 046/100] target/arm: Implement SVE2 WHILERW, WHILEWR Richard Henderson
2020-06-18  4:25 ` [PATCH v2 047/100] target/arm: Implement SVE2 bitwise ternary operations Richard Henderson
2020-06-18  4:25 ` [PATCH v2 048/100] target/arm: Implement SVE2 MATCH, NMATCH Richard Henderson
2020-06-18  4:25 ` [PATCH v2 049/100] target/arm: Implement SVE2 saturating multiply-add long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 050/100] target/arm: Generalize inl_qrdmlah_* helper functions Richard Henderson
2020-06-18  4:25 ` [PATCH v2 051/100] target/arm: Implement SVE2 saturating multiply-add high Richard Henderson
2020-06-18  4:25 ` [PATCH v2 052/100] target/arm: Implement SVE2 integer multiply-add long Richard Henderson
2020-06-18  4:25 ` [PATCH v2 053/100] target/arm: Implement SVE2 complex integer multiply-add Richard Henderson
2020-06-18  4:25 ` [PATCH v2 054/100] target/arm: Implement SVE2 ADDHNB, ADDHNT Richard Henderson
2020-06-18  4:25 ` [PATCH v2 055/100] target/arm: Implement SVE2 RADDHNB, RADDHNT Richard Henderson
2020-06-18  4:26 ` [PATCH v2 056/100] target/arm: Implement SVE2 SUBHNB, SUBHNT Richard Henderson
2020-06-18  4:26 ` [PATCH v2 057/100] target/arm: Implement SVE2 RSUBHNB, RSUBHNT Richard Henderson
2020-06-18  4:26 ` [PATCH v2 058/100] target/arm: Implement SVE2 HISTCNT, HISTSEG Richard Henderson
2020-06-18  4:26 ` [PATCH v2 059/100] target/arm: Implement SVE2 XAR Richard Henderson
2020-06-18  4:26 ` [PATCH v2 060/100] target/arm: Implement SVE2 scatter store insns Richard Henderson
2020-06-18  4:26 ` [PATCH v2 061/100] target/arm: Implement SVE2 gather load insns Richard Henderson
2020-06-18  4:26 ` [PATCH v2 062/100] target/arm: Implement SVE2 FMMLA Richard Henderson
2020-06-18  4:26 ` [PATCH v2 063/100] target/arm: Implement SVE2 SPLICE, EXT Richard Henderson
2020-06-18  4:26 ` [PATCH v2 064/100] target/arm: Fix sve_uzp_p vs odd vector lengths Richard Henderson
2020-06-18  4:26 ` [PATCH v2 065/100] target/arm: Fix sve_zip_p " Richard Henderson
2020-06-18  4:26 ` [PATCH v2 066/100] target/arm: Fix sve_punpk_p " Richard Henderson
2020-06-18  4:26 ` [PATCH v2 067/100] target/arm: Pass separate addend to {U, S}DOT helpers Richard Henderson
2020-06-18  4:26 ` [PATCH v2 068/100] target/arm: Pass separate addend to FCMLA helpers Richard Henderson
2020-06-18  4:26 ` [PATCH v2 069/100] target/arm: Split out formats for 2 vectors + 1 index Richard Henderson
2020-06-18  4:26 ` [PATCH v2 070/100] target/arm: Split out formats for 3 " Richard Henderson
2020-06-18  4:26 ` [PATCH v2 071/100] target/arm: Implement SVE2 integer multiply (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 072/100] target/arm: Use helper_gvec_mul_idx_* for aa64 advsimd Richard Henderson
2020-06-18  4:26 ` Richard Henderson [this message]
2020-06-18  4:26 ` [PATCH v2 074/100] target/arm: Use helper_gvec_ml{a, s}_idx_* " Richard Henderson
2020-06-18  4:26 ` [PATCH v2 075/100] target/arm: Implement SVE2 saturating multiply-add high (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 076/100] target/arm: Implement SVE2 saturating multiply-add (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 077/100] target/arm: Implement SVE2 integer multiply long (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 078/100] target/arm: Implement SVE2 saturating multiply (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 079/100] target/arm: Implement SVE2 signed saturating doubling multiply high Richard Henderson
2020-06-18  4:26 ` [PATCH v2 080/100] target/arm: Use helper_neon_sq{, r}dmul_* for aa64 advsimd Richard Henderson
2020-06-18  4:26 ` [PATCH v2 081/100] target/arm: Implement SVE2 saturating multiply high (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 082/100] target/arm: Implement SVE2 multiply-add long (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 083/100] target/arm: Implement SVE2 complex integer multiply-add (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 084/100] target/arm: Implement SVE mixed sign dot product (indexed) Richard Henderson
2020-06-18  4:26 ` [PATCH v2 085/100] target/arm: Implement SVE mixed sign dot product Richard Henderson
2020-06-18  4:26 ` [PATCH v2 086/100] target/arm: Implement SVE2 crypto unary operations Richard Henderson
2020-06-18  4:26 ` [PATCH v2 087/100] target/arm: Implement SVE2 crypto destructive binary operations Richard Henderson
2020-06-18  4:26 ` [PATCH v2 088/100] target/arm: Implement SVE2 crypto constructive " Richard Henderson
2020-06-18  4:26 ` [PATCH v2 089/100] target/arm: Implement SVE2 TBL, TBX Richard Henderson
2020-06-18  4:26 ` [PATCH v2 090/100] target/arm: Implement SVE2 FCVTNT Richard Henderson
2020-06-18  4:26 ` [PATCH v2 091/100] target/arm: Implement SVE2 FCVTLT Richard Henderson
2020-06-18  4:26 ` [PATCH v2 092/100] target/arm: Implement SVE2 FCVTXNT, FCVTX Richard Henderson
2020-06-18  4:26 ` [PATCH v2 093/100] softfloat: Add float16_is_normal Richard Henderson
2020-06-18  4:26 ` [PATCH v2 094/100] target/arm: Implement SVE2 FLOGB Richard Henderson
2020-06-18  4:26 ` [PATCH v2 095/100] tcg: Implement 256-bit dup for tcg_gen_gvec_dup_mem Richard Henderson
2020-06-18  4:26 ` [PATCH v2 096/100] target/arm: Share table of sve load functions Richard Henderson
2020-06-18  4:26 ` [PATCH v2 097/100] target/arm: Implement SVE2 LD1RO Richard Henderson
2020-06-18  4:26 ` [PATCH v2 098/100] target/arm: Implement 128-bit ZIP, UZP, TRN Richard Henderson
2020-06-18  4:26 ` [PATCH v2 099/100] target/arm: Implement SVE2 bitwise shift immediate Richard Henderson
2020-06-18  4:26 ` [PATCH v2 100/100] target/arm: Implement SVE2 fp multiply-add long Richard Henderson
2020-06-18  5:32 ` [PATCH v2 000/100] target/arm: Implement SVE2 no-reply
2020-06-18  5:55 ` no-reply
2020-07-07 21:36 ` LIU Zhiwei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618042644.1685561-74-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steplong@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).