summaryrefslogtreecommitdiffstats
path: root/target/mips/fpu_helper.h
diff options
context:
space:
mode:
authorRichard Henderson2020-10-22 18:17:46 +0200
committerRichard Henderson2021-05-16 14:13:51 +0200
commite9e5534ff30a0441d2efa59004e3f815177e7c10 (patch)
tree672ca41df08711f12b393a69ae72eab42ff1392a /target/mips/fpu_helper.h
parentsoftfloat: fix return_nan vs default_nan_mode (diff)
downloadqemu-e9e5534ff30a0441d2efa59004e3f815177e7c10.tar.gz
qemu-e9e5534ff30a0441d2efa59004e3f815177e7c10.tar.xz
qemu-e9e5534ff30a0441d2efa59004e3f815177e7c10.zip
target/mips: Set set_default_nan_mode with set_snan_bit_is_one
This behavior is currently hard-coded in parts_silence_nan, but setting this bit properly will allow this to be cleaned up. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/mips/fpu_helper.h')
-rw-r--r--target/mips/fpu_helper.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/target/mips/fpu_helper.h b/target/mips/fpu_helper.h
index 1c2d6d35a7..ad1116e8c1 100644
--- a/target/mips/fpu_helper.h
+++ b/target/mips/fpu_helper.h
@@ -27,8 +27,14 @@ static inline void restore_flush_mode(CPUMIPSState *env)
static inline void restore_snan_bit_mode(CPUMIPSState *env)
{
- set_snan_bit_is_one((env->active_fpu.fcr31 & (1 << FCR31_NAN2008)) == 0,
- &env->active_fpu.fp_status);
+ bool nan2008 = env->active_fpu.fcr31 & (1 << FCR31_NAN2008);
+
+ /*
+ * With nan2008, SNaNs are silenced in the usual way.
+ * Before that, SNaNs are not silenced; default nans are produced.
+ */
+ set_snan_bit_is_one(!nan2008, &env->active_fpu.fp_status);
+ set_default_nan_mode(!nan2008, &env->active_fpu.fp_status);
}
static inline void restore_fp_status(CPUMIPSState *env)