fpu: Use accessors for tininess_before_rounding

Rename get_float_detect_tininess to get_tininess_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:
Richard Henderson
2026-05-01 19:21:21 +10:00
parent 196242a0d9
commit 1126ebe189
5 changed files with 9 additions and 9 deletions

View File

@@ -418,7 +418,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, float_status *s,
exp = 0;
fracN(clear)(p);
} else {
bool is_tiny = s->tininess_before_rounding || exp < 0;
bool is_tiny = get_tininess_before_rounding(s) || exp < 0;
bool has_pseudo_denormals = fmt->has_explicit_bit &&
(get_floatx80_behaviour(s) & floatx80_pseudo_denormal_valid);

View File

@@ -79,6 +79,11 @@ this code that are retained.
* version 2 or later. See the COPYING file in the top-level directory.
*/
static inline bool get_tininess_before_rounding(const float_status *status)
{
return status->tininess_before_rounding;
}
/*----------------------------------------------------------------------------
| For the deconstructed floating-point with fraction FRAC, return true
| if the fraction represents a signalling NaN; otherwise false.

View File

@@ -4923,7 +4923,7 @@ floatx80 roundAndPackFloatx80(FloatX80RoundPrec roundingPrecision, bool zSign,
float_raise(float_flag_output_denormal_flushed, status);
return packFloatx80(zSign, 0, 0);
}
isTiny = status->tininess_before_rounding
isTiny = get_tininess_before_rounding(status)
|| (zExp < 0 )
|| (zSig0 <= zSig0 + roundIncrement);
shift64RightJamming( zSig0, 1 - zExp, &zSig0 );
@@ -4997,7 +4997,7 @@ floatx80 roundAndPackFloatx80(FloatX80RoundPrec roundingPrecision, bool zSign,
return floatx80_default_inf(zSign, status);
}
if ( zExp <= 0 ) {
isTiny = status->tininess_before_rounding
isTiny = get_tininess_before_rounding(status)
|| (zExp < 0)
|| !increment
|| (zSig0 < UINT64_C(0xFFFFFFFFFFFFFFFF));

View File

@@ -132,11 +132,6 @@ static inline void set_snan_rule(FloatSNaNRule val, float_status *status)
status->float_snan_rule = val;
}
static inline bool get_float_detect_tininess(const float_status *status)
{
return status->tininess_before_rounding;
}
static inline FloatRoundMode get_float_rounding_mode(const float_status *status)
{
return status->float_rounding_mode;

View File

@@ -1011,7 +1011,7 @@ void run_test(void)
verCases_tininessCode = 0;
slowfloat_detectTininess = tmode;
qsf.tininess_before_rounding = sf_tininess_to_qemu(tmode);
set_float_detect_tininess(sf_tininess_to_qemu(tmode), &qsf);
if (attrs & FUNC_EFF_TININESSMODE ||
((attrs & FUNC_EFF_TININESSMODE_REDUCEDPREC) &&