On 05/11/2014 17:43, Richard Henderson wrote:
On 10/29/2014 02:41 AM, Yongbok Kim wrote:
+void helper_msa_shf_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
+                       uint32_t ws, uint32_t imm)
+{
+    wr_t *pwd = &(env->active_fpu.fpr[wd].wr);
+    wr_t *pws = &(env->active_fpu.fpr[ws].wr);
+    wr_t wx, *pwx = &wx;
+    uint32_t i;
+
+    switch (df) {
+    case DF_BYTE:
+        for (i = 0; i < DF_ELEMENTS(DF_BYTE); i++) {
+            pwx->b[i] = pws->b[SHF_POS(i, imm)];
+        }
+        break;
+    case DF_HALF:
+        for (i = 0; i < DF_ELEMENTS(DF_HALF); i++) {
+            pwx->h[i] = pws->h[SHF_POS(i, imm)];
+        }
+        break;
Why pass DF to decode at runtime?  It's better to fully decode this at
translate time and call the correct function.

r~
Hi Richard,

Agreed. DF is already known in translation time.
I do have a plan to improve efficiency of MSA implementation.

Regards,
Yongbok

Reply via email to