Skip to contentSkip to conversation

target-mips: fix to clear MSACSR.Cause

PATCH In review Yongbok Kim 2 participants 2 messages Jun 30, 2015 – Jul 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-mips: fix to clear MSACSR.Cause

MSACSR.Cause bits are needed to be cleared before a vector floating-point instructions.
FEXDO.df, FEXUPL.df and FEXUPR.df were missed out.

---
 target-mips/msa_helper.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
target-mips/msa_helper.c +6 -0
index 26ffdc7..a1cb48f 100644
@@ -2642,6 +2642,8 @@ void helper_msa_fexdo_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
     wr_t *pwt = &(env->active_fpu.fpr[wt].wr);
     uint32_t i;
 
+    clear_msacsr_cause(env);
+
     switch (df) {
     case DF_WORD:
         for (i = 0; i < DF_ELEMENTS(DF_WORD); i++) {
@@ -3192,6 +3194,8 @@ void helper_msa_fexupl_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
     wr_t *pws = &(env->active_fpu.fpr[ws].wr);
     uint32_t i;
 
+    clear_msacsr_cause(env);
+
     switch (df) {
     case DF_WORD:
         for (i = 0; i < DF_ELEMENTS(DF_WORD); i++) {
@@ -3224,6 +3228,8 @@ void helper_msa_fexupr_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
     wr_t *pws = &(env->active_fpu.fpr[ws].wr);
     uint32_t i;
 
+    clear_msacsr_cause(env);
+
     switch (df) {
     case DF_WORD:
         for (i = 0; i < DF_ELEMENTS(DF_WORD); i++) {
Signature · 1 line
1.7.5.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Yongbok Kim

MSACSR.Cause bits are needed to be cleared before a vector floating-point instructions.
FEXDO.df, FEXUPL.df and FEXUPR.df were missed out.

---
 target-mips/msa_helper.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Signature · 2 lines
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net