softfloat: Convert float128_silence_nan to parts

This is the minimal change that also introduces float128_params,
float128_unpack_raw, and float128_pack_raw without running into
unused symbol Werrors.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2020-10-23 16:36:19 -07:00
parent 4109b9ea8a
commit 0018b1f41b
2 changed files with 89 additions and 32 deletions

View file

@ -197,6 +197,12 @@ static void parts64_silence_nan(FloatParts64 *p, float_status *status)
p->cls = float_class_qnan;
}
static void parts128_silence_nan(FloatParts128 *p, float_status *status)
{
p->frac_hi = parts_silence_nan_frac(p->frac_hi, status);
p->cls = float_class_qnan;
}
/*----------------------------------------------------------------------------
| The pattern for a default generated extended double-precision NaN.
*----------------------------------------------------------------------------*/
@ -1062,25 +1068,6 @@ bool float128_is_signaling_nan(float128 a, float_status *status)
}
}
/*----------------------------------------------------------------------------
| Returns a quiet NaN from a signalling NaN for the quadruple-precision
| floating point value `a'.
*----------------------------------------------------------------------------*/
float128 float128_silence_nan(float128 a, float_status *status)
{
if (no_signaling_nans(status)) {
g_assert_not_reached();
} else {
if (snan_bit_is_one(status)) {
return float128_default_nan(status);
} else {
a.high |= UINT64_C(0x0000800000000000);
return a;
}
}
}
/*----------------------------------------------------------------------------
| Returns the result of converting the quadruple-precision floating-point NaN
| `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid