mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-08-04 14:31:25 +00:00
softfloat: define floatx80_round()
Add a function to round a floatx80 to the defined precision (floatx80_rounding_precision) Backports commit 0f72129281765ed64d26353284059f2bdcde7a23 from qemu
This commit is contained in:
parent
20b610390d
commit
4e8e8572c3
|
@ -5046,6 +5046,22 @@ float128 floatx80_to_float128(floatx80 a, float_status *status)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------------
|
||||||
|
| Rounds the extended double-precision floating-point value `a'
|
||||||
|
| to the precision provided by floatx80_rounding_precision and returns the
|
||||||
|
| result as an extended double-precision floating-point value.
|
||||||
|
| The operation is performed according to the IEC/IEEE Standard for Binary
|
||||||
|
| Floating-Point Arithmetic.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
floatx80 floatx80_round(floatx80 a, float_status *status)
|
||||||
|
{
|
||||||
|
return roundAndPackFloatx80(status->floatx80_rounding_precision,
|
||||||
|
extractFloatx80Sign(a),
|
||||||
|
extractFloatx80Exp(a),
|
||||||
|
extractFloatx80Frac(a), 0, status);
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| Rounds the extended double-precision floating-point value `a' to an integer,
|
| Rounds the extended double-precision floating-point value `a' to an integer,
|
||||||
| and returns the result as an extended quadruple-precision floating-point
|
| and returns the result as an extended quadruple-precision floating-point
|
||||||
|
|
|
@ -608,6 +608,7 @@ float128 floatx80_to_float128(floatx80, float_status *status);
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| Software IEC/IEEE extended double-precision operations.
|
| Software IEC/IEEE extended double-precision operations.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
floatx80 floatx80_round(floatx80 a, float_status *status);
|
||||||
floatx80 floatx80_round_to_int(floatx80, float_status *status);
|
floatx80 floatx80_round_to_int(floatx80, float_status *status);
|
||||||
floatx80 floatx80_add(floatx80, floatx80, float_status *status);
|
floatx80 floatx80_add(floatx80, floatx80, float_status *status);
|
||||||
floatx80 floatx80_sub(floatx80, floatx80, float_status *status);
|
floatx80 floatx80_sub(floatx80, floatx80, float_status *status);
|
||||||
|
|
Loading…
Reference in a new issue