qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
To: qemu-devel@nongnu.org
Cc: arikalo@wavecomp.com
Subject: [PATCH v2 19/20] target/mips: msa: Simplify and move helper for MOVE.V
Date: Wed, 25 Sep 2019 14:46:11 +0200	[thread overview]
Message-ID: <1569415572-19635-20-git-send-email-aleksandar.markovic@rt-rk.com> (raw)
In-Reply-To: <1569415572-19635-1-git-send-email-aleksandar.markovic@rt-rk.com>

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Achieves clearer code and slightly better performance.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 target/mips/helper.h     |  2 +-
 target/mips/msa_helper.c | 31 +++++++++++++------------------
 2 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/target/mips/helper.h b/target/mips/helper.h
index cc216f7..3b1a965 100644
--- a/target/mips/helper.h
+++ b/target/mips/helper.h
@@ -887,6 +887,7 @@ DEF_HELPER_4(msa_mod_s_h, void, env, i32, i32, i32)
 DEF_HELPER_4(msa_mod_s_w, void, env, i32, i32, i32)
 DEF_HELPER_4(msa_mod_s_d, void, env, i32, i32, i32)
 
+DEF_HELPER_3(msa_move_v, void, env, i32, i32)
 
 DEF_HELPER_4(msa_andi_b, void, env, i32, i32, i32)
 DEF_HELPER_4(msa_ori_b, void, env, i32, i32, i32)
@@ -977,7 +978,6 @@ DEF_HELPER_5(msa_splati_df, void, env, i32, i32, i32, i32)
 DEF_HELPER_5(msa_insve_df, void, env, i32, i32, i32, i32)
 DEF_HELPER_3(msa_ctcmsa, void, env, tl, i32)
 DEF_HELPER_2(msa_cfcmsa, tl, env, i32)
-DEF_HELPER_3(msa_move_v, void, env, i32, i32)
 
 DEF_HELPER_5(msa_fcaf_df, void, env, i32, i32, i32, i32)
 DEF_HELPER_5(msa_fcun_df, void, env, i32, i32, i32, i32)
diff --git a/target/mips/msa_helper.c b/target/mips/msa_helper.c
index 8ad9d42..cece69b 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -1974,7 +1974,19 @@ void helper_msa_mod_u_d(CPUMIPSState *env, uint32_t wd, uint32_t ws, uint32_t wt
  * +---------------+----------------------------------------------------------+
  */
 
-/* TODO: insert Move group helpers here */
+static inline void msa_move_v(wr_t *pwd, wr_t *pws)
+{
+    pwd->d[0] = pws->d[0];
+    pwd->d[1] = pws->d[1];
+}
+
+void helper_msa_move_v(CPUMIPSState *env, uint32_t wd, uint32_t ws)
+{
+    wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
+    wr_t *pws = &(env->active_fpu.fpr[ws].wr);
+
+    msa_move_v(pwd, pws);
+}
 
 
 /*
@@ -2031,15 +2043,6 @@ void helper_msa_mod_u_d(CPUMIPSState *env, uint32_t wd, uint32_t ws, uint32_t wt
 /* TODO: insert Shift group helpers here */
 
 
-static inline void msa_move_v(wr_t *pwd, wr_t *pws)
-{
-    uint32_t i;
-
-    for (i = 0; i < DF_ELEMENTS(DF_DOUBLE); i++) {
-        pwd->d[i] = pws->d[i];
-    }
-}
-
 #define MSA_FN_IMM8(FUNC, DEST, OPERATION)                              \
 void helper_msa_ ## FUNC(CPUMIPSState *env, uint32_t wd, uint32_t ws,   \
         uint32_t i8)                                                    \
@@ -3826,14 +3829,6 @@ target_ulong helper_msa_cfcmsa(CPUMIPSState *env, uint32_t cs)
     return 0;
 }
 
-void helper_msa_move_v(CPUMIPSState *env, uint32_t wd, uint32_t ws)
-{
-    wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
-    wr_t *pws = &(env->active_fpu.fpr[ws].wr);
-
-    msa_move_v(pwd, pws);
-}
-
 void helper_msa_fill_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
                         uint32_t rs)
 {
-- 
2.7.4



  parent reply	other threads:[~2019-09-25 13:02 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 12:45 [PATCH v2 00/20] target/mips: Misc cleanups for September/October 2019 Aleksandar Markovic
2019-09-25 12:45 ` [PATCH v2 01/20] target/mips: Clean up helper.c Aleksandar Markovic
2019-09-25 15:27   ` Philippe Mathieu-Daudé
2019-09-27  4:32     ` Aleksandar Markovic
2019-09-27  8:55       ` Philippe Mathieu-Daudé
2019-09-27 12:03       ` Markus Armbruster
2019-09-27 12:22         ` Peter Maydell
2019-09-27 13:11           ` Aleksandar Markovic
2019-09-28 14:54             ` Markus Armbruster
2019-09-25 12:45 ` [PATCH v2 02/20] target/mips: Clean up internal.h Aleksandar Markovic
2019-09-25 15:07   ` Philippe Mathieu-Daudé
2019-09-25 12:45 ` [PATCH v2 03/20] target/mips: Clean up kvm_mips.h Aleksandar Markovic
2019-09-25 15:08   ` Philippe Mathieu-Daudé
2019-09-25 12:45 ` [PATCH v2 04/20] target/mips: Clean up mips-defs.h Aleksandar Markovic
2019-09-25 15:10   ` Philippe Mathieu-Daudé
2019-09-25 12:45 ` [PATCH v2 05/20] target/mips: Clean up op_helper.c Aleksandar Markovic
2019-09-25 15:24   ` Philippe Mathieu-Daudé
2019-09-25 12:45 ` [PATCH v2 06/20] target/mips: Clean up translate.c Aleksandar Markovic
2019-09-25 12:45 ` [PATCH v2 07/20] target/mips: msa: Split helpers for <NLOC|NLZC>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 08/20] target/mips: msa: Split helpers for PCNT.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 09/20] target/mips: msa: Split helpers for BINS<L|R>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 10/20] target/mips: msa: Unroll loops and demacro <BMNZ|BMZ|BSEL>.V Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 11/20] target/mips: msa: Split helpers for B<CLR|NEG|SEL>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 12/20] target/mips: msa: Split helpers for AVE_<S|U>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 13/20] target/mips: msa: Split helpers for AVER_<S|U>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 14/20] target/mips: msa: Split helpers for CEQ.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 15/20] target/mips: msa: Split helpers for CLE_<S|U>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 16/20] target/mips: msa: Split helpers for CLT_<S|U>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 17/20] target/mips: msa: Split helpers for DIV_<S|U>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` [PATCH v2 18/20] target/mips: msa: Split helpers for MOD_<S|U>.<B|H|W|D> Aleksandar Markovic
2019-09-25 12:46 ` Aleksandar Markovic [this message]
2019-09-25 12:46 ` [PATCH v2 20/20] target/mips: msa: Move helpers for <AND|NOR|OR|XOR>.V Aleksandar Markovic
2019-09-25 14:09 ` [EXTERNAL][PATCH v2 00/20] target/mips: Misc cleanups for September/October 2019 Aleksandar Rikalo
2019-09-25 14:13 ` Aleksandar Rikalo
2019-10-01 15:26 ` [PATCH " 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=1569415572-19635-20-git-send-email-aleksandar.markovic@rt-rk.com \
    --to=aleksandar.markovic@rt-rk.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).