From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: [PATCH 3/4] target/arm: Optimize MVE arithmetic ops
Date: Thu, 2 Sep 2021 16:09:09 +0100 [thread overview]
Message-ID: <20210902150910.15748-4-peter.maydell@linaro.org> (raw)
In-Reply-To: <20210902150910.15748-1-peter.maydell@linaro.org>
Optimize MVE arithmetic ops when we have a TCG
vector operation we can use.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/translate-mve.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/target/arm/translate-mve.c b/target/arm/translate-mve.c
index 087d60f0d81..5bc5a3a2063 100644
--- a/target/arm/translate-mve.c
+++ b/target/arm/translate-mve.c
@@ -827,7 +827,7 @@ static bool trans_VPSEL(DisasContext *s, arg_2op *a)
return do_2op(s, a, gen_helper_mve_vpsel);
}
-#define DO_2OP(INSN, FN) \
+#define DO_2OP_VEC(INSN, FN, VECFN) \
static bool trans_##INSN(DisasContext *s, arg_2op *a) \
{ \
static MVEGenTwoOpFn * const fns[] = { \
@@ -836,20 +836,22 @@ static bool trans_VPSEL(DisasContext *s, arg_2op *a)
gen_helper_mve_##FN##w, \
NULL, \
}; \
- return do_2op(s, a, fns[a->size]); \
+ return do_2op_vec(s, a, fns[a->size], VECFN); \
}
-DO_2OP(VADD, vadd)
-DO_2OP(VSUB, vsub)
-DO_2OP(VMUL, vmul)
+#define DO_2OP(INSN, FN) DO_2OP_VEC(INSN, FN, NULL)
+
+DO_2OP_VEC(VADD, vadd, tcg_gen_gvec_add)
+DO_2OP_VEC(VSUB, vsub, tcg_gen_gvec_sub)
+DO_2OP_VEC(VMUL, vmul, tcg_gen_gvec_mul)
DO_2OP(VMULH_S, vmulhs)
DO_2OP(VMULH_U, vmulhu)
DO_2OP(VRMULH_S, vrmulhs)
DO_2OP(VRMULH_U, vrmulhu)
-DO_2OP(VMAX_S, vmaxs)
-DO_2OP(VMAX_U, vmaxu)
-DO_2OP(VMIN_S, vmins)
-DO_2OP(VMIN_U, vminu)
+DO_2OP_VEC(VMAX_S, vmaxs, tcg_gen_gvec_smax)
+DO_2OP_VEC(VMAX_U, vmaxu, tcg_gen_gvec_umax)
+DO_2OP_VEC(VMIN_S, vmins, tcg_gen_gvec_smin)
+DO_2OP_VEC(VMIN_U, vminu, tcg_gen_gvec_umin)
DO_2OP(VABD_S, vabds)
DO_2OP(VABD_U, vabdu)
DO_2OP(VHADD_S, vhadds)
--
2.20.1
next prev parent reply other threads:[~2021-09-02 15:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 15:09 [PATCH 0/4] target/arm: Use TCG vector ops for MVE Peter Maydell
2021-09-02 15:09 ` [PATCH 1/4] target/arm: Add TB flag for "MVE insns not predicated" Peter Maydell
2021-09-03 13:57 ` Richard Henderson
2021-09-03 14:17 ` Peter Maydell
2021-09-03 15:28 ` Richard Henderson
2021-09-03 16:30 ` Peter Maydell
2021-09-07 14:11 ` Richard Henderson
2021-09-07 14:22 ` Richard Henderson
2021-09-10 16:00 ` Peter Maydell
2021-09-12 12:48 ` Richard Henderson
2021-09-09 13:46 ` Peter Maydell
2021-09-10 6:46 ` Richard Henderson
2021-09-10 9:30 ` Peter Maydell
2021-09-10 13:08 ` Richard Henderson
2021-09-09 14:53 ` Peter Maydell
2021-09-02 15:09 ` [PATCH 2/4] target/arm: Optimize MVE logic ops Peter Maydell
2021-09-02 16:19 ` Philippe Mathieu-Daudé
2021-09-03 13:58 ` Richard Henderson
2021-09-02 15:09 ` Peter Maydell [this message]
2021-09-02 16:20 ` [PATCH 3/4] target/arm: Optimize MVE arithmetic ops Philippe Mathieu-Daudé
2021-09-03 13:59 ` Richard Henderson
2021-09-02 15:09 ` [PATCH 4/4] target/arm: Optimize MVE VNEG, VABS Peter Maydell
2021-09-02 16:21 ` Philippe Mathieu-Daudé
2021-09-03 14:00 ` Richard Henderson
2021-09-03 15:14 ` [PATCH 0/4] target/arm: Use TCG vector ops for MVE Richard Henderson
2021-09-03 15:20 ` Peter Maydell
2021-09-03 15:36 ` Richard Henderson
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=20210902150910.15748-4-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).