From: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
To: qemu-devel@nongnu.org
Cc: arikalo@wavecomp.com, amarkovic@wavecomp.com
Subject: [Qemu-devel] [PATCH v4 04/10] target/mips: Unroll loops in helpers for MSA logic instructions
Date: Thu, 6 Jun 2019 18:27:14 +0200 [thread overview]
Message-ID: <1559838440-9866-5-git-send-email-aleksandar.markovic@rt-rk.com> (raw)
In-Reply-To: <1559838440-9866-1-git-send-email-aleksandar.markovic@rt-rk.com>
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Unroll loops in helpers for MSA logic instructions for better
performance.
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com>
Message-Id: <1559745316-1454-4-git-send-email-aleksandar.markovic@rt-rk.com>
---
target/mips/msa_helper.c | 44 ++++++++++++++++++++++++++++++++++++++++----
1 file changed, 40 insertions(+), 4 deletions(-)
diff --git a/target/mips/msa_helper.c b/target/mips/msa_helper.c
index 7b73e22..a861155 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -268,10 +268,6 @@ void helper_msa_ ## FUNC(CPUMIPSState *env, uint32_t wd, uint32_t ws, \
} \
}
-MSA_FN_VECTOR(and_v, pwd->d[i], pws->d[i] & pwt->d[i])
-MSA_FN_VECTOR(or_v, pwd->d[i], pws->d[i] | pwt->d[i])
-MSA_FN_VECTOR(nor_v, pwd->d[i], ~(pws->d[i] | pwt->d[i]))
-MSA_FN_VECTOR(xor_v, pwd->d[i], pws->d[i] ^ pwt->d[i])
MSA_FN_VECTOR(bmnz_v, pwd->d[i],
BIT_MOVE_IF_NOT_ZERO(pwd->d[i], pws->d[i], pwt->d[i], DF_DOUBLE))
MSA_FN_VECTOR(bmz_v, pwd->d[i],
@@ -283,6 +279,46 @@ MSA_FN_VECTOR(bsel_v, pwd->d[i],
#undef BIT_SELECT
#undef MSA_FN_VECTOR
+void helper_msa_and_v(CPUMIPSState *env, uint32_t wd, uint32_t ws, uint32_t wt)
+{
+ wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
+ wr_t *pws = &(env->active_fpu.fpr[ws].wr);
+ wr_t *pwt = &(env->active_fpu.fpr[wt].wr);
+
+ pwd->d[0] = pws->d[0] & pwt->d[0];
+ pwd->d[1] = pws->d[1] & pwt->d[1];
+}
+
+void helper_msa_or_v(CPUMIPSState *env, uint32_t wd, uint32_t ws, uint32_t wt)
+{
+ wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
+ wr_t *pws = &(env->active_fpu.fpr[ws].wr);
+ wr_t *pwt = &(env->active_fpu.fpr[wt].wr);
+
+ pwd->d[0] = pws->d[0] | pwt->d[0];
+ pwd->d[1] = pws->d[1] | pwt->d[1];
+}
+
+void helper_msa_nor_v(CPUMIPSState *env, uint32_t wd, uint32_t ws, uint32_t wt)
+{
+ wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
+ wr_t *pws = &(env->active_fpu.fpr[ws].wr);
+ wr_t *pwt = &(env->active_fpu.fpr[wt].wr);
+
+ pwd->d[0] = ~(pws->d[0] | pwt->d[0]);
+ pwd->d[1] = ~(pws->d[1] | pwt->d[1]);
+}
+
+void helper_msa_xor_v(CPUMIPSState *env, uint32_t wd, uint32_t ws, uint32_t wt)
+{
+ wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
+ wr_t *pws = &(env->active_fpu.fpr[ws].wr);
+ wr_t *pwt = &(env->active_fpu.fpr[wt].wr);
+
+ pwd->d[0] = pws->d[0] ^ pwt->d[0];
+ pwd->d[1] = pws->d[1] ^ pwt->d[1];
+}
+
static inline int64_t msa_addv_df(uint32_t df, int64_t arg1, int64_t arg2)
{
return arg1 + arg2;
--
2.7.4
next prev parent reply other threads:[~2019-06-06 16:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 16:27 [Qemu-devel] [PATCH v4 00/10] Amend and clean up MSA support Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 01/10] target/mips: Fix space-related format issues im msa_helper.c Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 02/10] target/mips: Fix block-comment-related " Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 03/10] target/mips: Outline places for future MSA helpers Aleksandar Markovic
2019-06-06 16:27 ` Aleksandar Markovic [this message]
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 05/10] tests/tcg: target/mips: Amend and rearrange MSA wrappers Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 06/10] tests/tcg: target/mips: Add tests for MSA shift instructions Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 07/10] tests/tcg: target/mips: Move four tests to a better location Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 08/10] tests/tcg: target/mips: Add utility function reset_msa_registers() Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 09/10] tests/tcg: target/mips: Add tests for MSA FP max/min instructions Aleksandar Markovic
2019-06-06 16:27 ` [Qemu-devel] [PATCH v4 10/10] tests/tcg: target/mips: Add README for MSA tests Aleksandar Markovic
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=1559838440-9866-5-git-send-email-aleksandar.markovic@rt-rk.com \
--to=aleksandar.markovic@rt-rk.com \
--cc=amarkovic@wavecomp.com \
--cc=arikalo@wavecomp.com \
--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).