mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 05:25:11 +00:00
target/mips: Unroll loops in helpers for MSA logic instructions
Unroll loops in helpers for MSA logic instructions for better performance. Backports commit 5d161bc81877327bc0b2a6d8974e07ffdc6881a5 from qemu
This commit is contained in:
parent
8ec1ab6807
commit
93473b2e09
|
@ -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 a new issue