[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/46] target/mips: Set set_default_nan_mode with set_snan_bit_is_
From: |
Richard Henderson |
Subject: |
[PULL 13/46] target/mips: Set set_default_nan_mode with set_snan_bit_is_one |
Date: |
Sun, 16 May 2021 07:33:58 -0500 |
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>
---
target/mips/fpu_helper.h | 10 ++++++++--
1 file 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)
--
2.25.1
- [PULL 01/46] qemu/host-utils: Use __builtin_bitreverseN, (continued)
- [PULL 01/46] qemu/host-utils: Use __builtin_bitreverseN, Richard Henderson, 2021/05/16
- [PULL 03/46] qemu/host-utils: Add wrappers for carry builtins, Richard Henderson, 2021/05/16
- [PULL 05/46] tests/fp: add quad support to the benchmark utility, Richard Henderson, 2021/05/16
- [PULL 02/46] qemu/host-utils: Add wrappers for overflow builtins, Richard Henderson, 2021/05/16
- [PULL 04/46] accel/tcg: Use add/sub overflow routines in tcg-runtime-gvec.c, Richard Henderson, 2021/05/16
- [PULL 06/46] softfloat: Move the binary point to the msb, Richard Henderson, 2021/05/16
- [PULL 09/46] softfloat: Tidy a * b + inf return, Richard Henderson, 2021/05/16
- [PULL 08/46] softfloat: Use float_raise in more places, Richard Henderson, 2021/05/16
- [PULL 10/46] softfloat: Add float_cmask and constants, Richard Henderson, 2021/05/16
- [PULL 11/46] softfloat: Use return_nan in float_to_float, Richard Henderson, 2021/05/16
- [PULL 13/46] target/mips: Set set_default_nan_mode with set_snan_bit_is_one,
Richard Henderson <=
- [PULL 16/46] softfloat: Move type-specific pack/unpack routines, Richard Henderson, 2021/05/16
- [PULL 14/46] softfloat: Do not produce a default_nan from parts_silence_nan, Richard Henderson, 2021/05/16
- [PULL 15/46] softfloat: Rename FloatParts to FloatParts64, Richard Henderson, 2021/05/16
- [PULL 20/46] softfloat: Use pointers with pack_raw, Richard Henderson, 2021/05/16
- [PULL 23/46] softfloat: Use pointers with ftype_round_pack_canonical, Richard Henderson, 2021/05/16
- [PULL 12/46] softfloat: fix return_nan vs default_nan_mode, Richard Henderson, 2021/05/16
- [PULL 17/46] softfloat: Use pointers with parts_default_nan, Richard Henderson, 2021/05/16
- [PULL 29/46] softfloat: Move pick_nan to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 33/46] softfloat: Use uadd64_carry, usub64_borrow in softfloat-macros.h, Richard Henderson, 2021/05/16
- [PULL 18/46] softfloat: Use pointers with unpack_raw, Richard Henderson, 2021/05/16