mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
fpu: Use accessors for ftz_before_rounding
Drop FloatFTZDetection and use #defines, like we do for tininess_before_rounding. Rename get_float_ftz_detection to get_ftz_before_rounding and move to softfloat.c, as there are no external users. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -411,8 +411,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, float_status *s,
|
||||
p->frac_lo &= ~round_mask;
|
||||
}
|
||||
fracN(shr)(p, frac_shift);
|
||||
} else if (get_flush_to_zero(s) &&
|
||||
s->ftz_detection == float_ftz_before_rounding) {
|
||||
} else if (get_flush_to_zero(s) && get_ftz_before_rounding(s)) {
|
||||
flags |= float_flag_output_denormal_flushed;
|
||||
p->cls = float_class_zero;
|
||||
exp = 0;
|
||||
@@ -463,7 +462,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, float_status *s,
|
||||
|
||||
if (is_tiny) {
|
||||
if (get_flush_to_zero(s)) {
|
||||
assert(s->ftz_detection == float_ftz_after_rounding);
|
||||
assert(!get_ftz_before_rounding(s));
|
||||
flags |= float_flag_output_denormal_flushed;
|
||||
p->cls = float_class_zero;
|
||||
exp = 0;
|
||||
|
||||
@@ -84,6 +84,11 @@ static inline bool get_tininess_before_rounding(const float_status *status)
|
||||
return status->tininess_before_rounding;
|
||||
}
|
||||
|
||||
static inline bool get_ftz_before_rounding(const float_status *status)
|
||||
{
|
||||
return status->ftz_before_rounding;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| For the deconstructed floating-point with fraction FRAC, return true
|
||||
| if the fraction represents a signalling NaN; otherwise false.
|
||||
|
||||
@@ -116,10 +116,9 @@ static inline void set_flush_inputs_to_zero(bool val, float_status *status)
|
||||
status->flush_inputs_to_zero = val;
|
||||
}
|
||||
|
||||
static inline void set_float_ftz_detection(FloatFTZDetection d,
|
||||
float_status *status)
|
||||
static inline void set_float_ftz_detection(bool val, float_status *status)
|
||||
{
|
||||
status->ftz_detection = d;
|
||||
status->ftz_before_rounding = val;
|
||||
}
|
||||
|
||||
static inline void set_default_nan_mode(bool val, float_status *status)
|
||||
@@ -198,9 +197,4 @@ static inline FloatSNaNRule get_snan_rule(float_status *status)
|
||||
return status->float_snan_rule;
|
||||
}
|
||||
|
||||
static inline FloatFTZDetection get_float_ftz_detection(const float_status *status)
|
||||
{
|
||||
return status->ftz_detection;
|
||||
}
|
||||
|
||||
#endif /* SOFTFLOAT_HELPERS_H */
|
||||
|
||||
@@ -341,10 +341,8 @@ typedef enum __attribute__((__packed__)) {
|
||||
* configure it matches the default for tininess_before_rounding
|
||||
* (i.e. "after rounding").
|
||||
*/
|
||||
typedef enum __attribute__((__packed__)) {
|
||||
float_ftz_after_rounding = 0,
|
||||
float_ftz_before_rounding = 1,
|
||||
} FloatFTZDetection;
|
||||
#define float_ftz_after_rounding false
|
||||
#define float_ftz_before_rounding true
|
||||
|
||||
/*
|
||||
* floatx80 is primarily used by x86 and m68k, and there are
|
||||
@@ -416,7 +414,7 @@ typedef struct float_status {
|
||||
/* should denormalised results go to zero and set output_denormal_flushed? */
|
||||
bool flush_to_zero;
|
||||
/* do we detect and flush denormal results before or after rounding? */
|
||||
FloatFTZDetection ftz_detection;
|
||||
bool ftz_before_rounding;
|
||||
/* should denormalised inputs go to zero and set input_denormal_flushed? */
|
||||
bool flush_inputs_to_zero;
|
||||
bool default_nan_mode;
|
||||
|
||||
Reference in New Issue
Block a user