[PATCH 10/11] target/mips: Do not check MSACSR_FS_MASK in update_msacsr

Richard Henderson posted 11 patches 4 years, 8 months ago
Maintainers: Aurelien Jarno <aurelien@aurel32.net>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, "Alex Bennée" <alex.bennee@linaro.org>, Peter Maydell <peter.maydell@linaro.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Eduardo Habkost <ehabkost@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>
[PATCH 10/11] target/mips: Do not check MSACSR_FS_MASK in update_msacsr
Posted by Richard Henderson 4 years, 8 months ago
The FS_MASK has already been taken into account with
restore_msa_fp_status.  The definition of iflush and
oflush is that we *have* flushed to zero.

Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/mips/tcg/msa_helper.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/mips/tcg/msa_helper.c b/target/mips/tcg/msa_helper.c
index 2f89abe166..ffe6e630ed 100644
--- a/target/mips/tcg/msa_helper.c
+++ b/target/mips/tcg/msa_helper.c
@@ -6225,8 +6225,7 @@ static int update_msacsr(CPUMIPSState *env, int action, int denormal)
     enable = GET_FP_ENABLE(env->active_tc.msacsr) | FP_UNIMPLEMENTED;
 
     /* Set Inexact (I) when flushing inputs to zero */
-    if ((ieee_exception_flags & float_flag_iflush_denormal) &&
-            (env->active_tc.msacsr & MSACSR_FS_MASK) != 0) {
+    if (ieee_exception_flags & float_flag_iflush_denormal) {
         if (action & CLEAR_IS_INEXACT) {
             mips_exception_flags &= ~FP_INEXACT;
         } else {
@@ -6235,8 +6234,7 @@ static int update_msacsr(CPUMIPSState *env, int action, int denormal)
     }
 
     /* Set Inexact (I) and Underflow (U) when flushing outputs to zero */
-    if ((ieee_exception_flags & float_flag_oflush_denormal) &&
-            (env->active_tc.msacsr & MSACSR_FS_MASK) != 0) {
+    if (ieee_exception_flags & float_flag_oflush_denormal) {
         mips_exception_flags |= FP_INEXACT;
         if (action & CLEAR_FS_UNDERFLOW) {
             mips_exception_flags &= ~FP_UNDERFLOW;
-- 
2.25.1


Re: [PATCH 10/11] target/mips: Do not check MSACSR_FS_MASK in update_msacsr
Posted by Philippe Mathieu-Daudé 4 years, 7 months ago
On 5/27/21 6:14 AM, Richard Henderson wrote:
> The FS_MASK has already been taken into account with
> restore_msa_fp_status.  The definition of iflush and
> oflush is that we *have* flushed to zero.
> 
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/mips/tcg/msa_helper.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>