[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 19/20] target/mips: msa: Simplify and move helper for MOVE.V
From: |
Aleksandar Markovic |
Subject: |
[PATCH v2 19/20] target/mips: msa: Simplify and move helper for MOVE.V |
Date: |
Wed, 25 Sep 2019 14:46:11 +0200 |
From: Aleksandar Markovic <address@hidden>
Achieves clearer code and slightly better performance.
Signed-off-by: Aleksandar Markovic <address@hidden>
---
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
- [PATCH v2 02/20] target/mips: Clean up internal.h, (continued)
- [PATCH v2 02/20] target/mips: Clean up internal.h, Aleksandar Markovic, 2019/09/25
- [PATCH v2 06/20] target/mips: Clean up translate.c, Aleksandar Markovic, 2019/09/25
- [PATCH v2 07/20] target/mips: msa: Split helpers for <NLOC|NLZC>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 09/20] target/mips: msa: Split helpers for BINS<L|R>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 01/20] target/mips: Clean up helper.c, Aleksandar Markovic, 2019/09/25
- [PATCH v2 08/20] target/mips: msa: Split helpers for PCNT.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 11/20] target/mips: msa: Split helpers for B<CLR|NEG|SEL>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 20/20] target/mips: msa: Move helpers for <AND|NOR|OR|XOR>.V, Aleksandar Markovic, 2019/09/25
- [PATCH v2 19/20] target/mips: msa: Simplify and move helper for MOVE.V,
Aleksandar Markovic <=
- [PATCH v2 17/20] target/mips: msa: Split helpers for DIV_<S|U>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 14/20] target/mips: msa: Split helpers for CEQ.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 13/20] target/mips: msa: Split helpers for AVER_<S|U>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 15/20] target/mips: msa: Split helpers for CLE_<S|U>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 12/20] target/mips: msa: Split helpers for AVE_<S|U>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 16/20] target/mips: msa: Split helpers for CLT_<S|U>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 18/20] target/mips: msa: Split helpers for MOD_<S|U>.<B|H|W|D>, Aleksandar Markovic, 2019/09/25
- [PATCH v2 05/20] target/mips: Clean up op_helper.c, Aleksandar Markovic, 2019/09/25
- Re: [EXTERNAL][PATCH v2 00/20] target/mips: Misc cleanups for September/October 2019, Aleksandar Rikalo, 2019/09/25