Correct the floatx80_abs() and floatx80_chs() declarations when used with C++ code - fixes the sign in some trigonometric instruction, fixes Quake on SoftFloat.

This commit is contained in:
OBattler
2023-05-07 22:59:18 +02:00
parent ee4ee8e1bd
commit db568b8658

View File

@@ -80,7 +80,11 @@ int floatx80_compare_quiet(floatx80 a, floatx80 b, struct float_status_t *status
| for Binary Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
BX_CPP_INLINE floatx80& floatx80_abs(floatx80 &reg)
#else
BX_CPP_INLINE floatx80 floatx80_abs(floatx80 reg)
#endif
{
reg.exp &= 0x7FFF;
return reg;
@@ -92,7 +96,11 @@ BX_CPP_INLINE floatx80 floatx80_abs(floatx80 reg)
| Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
BX_CPP_INLINE floatx80& floatx80_chs(floatx80 &reg)
#else
BX_CPP_INLINE floatx80 floatx80_chs(floatx80 reg)
#endif
{
reg.exp ^= 0x8000;
return reg;