aboutsummaryrefslogtreecommitdiff
path: root/include/fpu
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2020-06-30 19:35:49 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2020-08-21 12:48:14 -0700
commitcc43c6925113c5bc8f1a0205375931d2e4807c99 (patch)
tree756ac99bf25877985fb5e310aa2ef587fb9aaba8 /include/fpu
parenta7d479ee51c5911c93ee931efe4c2413b54c8756 (diff)
softfloat: make NO_SIGNALING_NANS runtime property
target/xtensa, the only user of NO_SIGNALING_NANS macro has FPU implementations with and without the corresponding property. With NO_SIGNALING_NANS being a macro they cannot be a part of the same QEMU executable. Replace macro with new property in float_status to allow cores with different FPU implementations coexist. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: "Alex Bennée" <alex.bennee@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'include/fpu')
-rw-r--r--include/fpu/softfloat-helpers.h5
-rw-r--r--include/fpu/softfloat-types.h7
2 files changed, 11 insertions, 1 deletions
diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helpers.h
index 735ed6b653..e842f83a12 100644
--- a/include/fpu/softfloat-helpers.h
+++ b/include/fpu/softfloat-helpers.h
@@ -95,6 +95,11 @@ static inline void set_snan_bit_is_one(bool val, float_status *status)
status->snan_bit_is_one = val;
}
+static inline void set_no_signaling_nans(bool val, float_status *status)
+{
+ status->no_signaling_nans = val;
+}
+
static inline bool get_float_detect_tininess(float_status *status)
{
return status->tininess_before_rounding;
diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h
index 7680193ebc..d6f167c1b0 100644
--- a/include/fpu/softfloat-types.h
+++ b/include/fpu/softfloat-types.h
@@ -165,8 +165,13 @@ typedef struct float_status {
/* should denormalised inputs go to zero and set the input_denormal flag? */
bool flush_inputs_to_zero;
bool default_nan_mode;
- /* not always used -- see snan_bit_is_one() in softfloat-specialize.h */
+ /*
+ * The flags below are not used on all specializations and may
+ * constant fold away (see snan_bit_is_one()/no_signalling_nans() in
+ * softfloat-specialize.inc.c)
+ */
bool snan_bit_is_one;
+ bool no_signaling_nans;
} float_status;
#endif /* SOFTFLOAT_TYPES_H */