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:
@@ -80,7 +80,11 @@ int floatx80_compare_quiet(floatx80 a, floatx80 b, struct float_status_t *status
|
|||||||
| for Binary Floating-Point Arithmetic.
|
| for Binary Floating-Point Arithmetic.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
BX_CPP_INLINE floatx80& floatx80_abs(floatx80 ®)
|
||||||
|
#else
|
||||||
BX_CPP_INLINE floatx80 floatx80_abs(floatx80 reg)
|
BX_CPP_INLINE floatx80 floatx80_abs(floatx80 reg)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
reg.exp &= 0x7FFF;
|
reg.exp &= 0x7FFF;
|
||||||
return reg;
|
return reg;
|
||||||
@@ -92,7 +96,11 @@ BX_CPP_INLINE floatx80 floatx80_abs(floatx80 reg)
|
|||||||
| Floating-Point Arithmetic.
|
| Floating-Point Arithmetic.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
BX_CPP_INLINE floatx80& floatx80_chs(floatx80 ®)
|
||||||
|
#else
|
||||||
BX_CPP_INLINE floatx80 floatx80_chs(floatx80 reg)
|
BX_CPP_INLINE floatx80 floatx80_chs(floatx80 reg)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
reg.exp ^= 0x8000;
|
reg.exp ^= 0x8000;
|
||||||
return reg;
|
return reg;
|
||||||
|
Reference in New Issue
Block a user