target/mips: Unroll loops in helpers for MSA logic instructions
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: <1559838440-9866-5-git-send-email-aleksandar.markovic@rt-rk.com>
This commit is contained in:
parent
7471df9f9e
commit
5d161bc818
@ -591,10 +591,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],
|
||||
@ -606,6 +602,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;
|
||||
|
Loading…
Reference in New Issue
Block a user