diff options
author | Richard Henderson | 2020-11-21 21:51:14 +0100 |
---|---|---|
committer | Richard Henderson | 2021-06-03 23:09:02 +0200 |
commit | 45a76b71abadedb2ff77ea1cc4d03a13cf6f9f8b (patch) | |
tree | cea7eb9a5cc5d8610df74407b0ba59f1d2370b44 /fpu | |
parent | softfloat: Convert floatx80_sqrt to FloatParts (diff) | |
download | qemu-45a76b71abadedb2ff77ea1cc4d03a13cf6f9f8b.tar.gz qemu-45a76b71abadedb2ff77ea1cc4d03a13cf6f9f8b.tar.xz qemu-45a76b71abadedb2ff77ea1cc4d03a13cf6f9f8b.zip |
softfloat: Convert floatx80_round to FloatParts
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'fpu')
-rw-r--r-- | fpu/softfloat.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 5a320e5302..74787d5a6e 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -5792,10 +5792,12 @@ float128 floatx80_to_float128(floatx80 a, float_status *status) floatx80 floatx80_round(floatx80 a, float_status *status) { - return roundAndPackFloatx80(status->floatx80_rounding_precision, - extractFloatx80Sign(a), - extractFloatx80Exp(a), - extractFloatx80Frac(a), 0, status); + FloatParts128 p; + + if (!floatx80_unpack_canonical(&p, a, status)) { + return floatx80_default_nan(status); + } + return floatx80_round_pack_canonical(&p, status); } /*---------------------------------------------------------------------------- |