mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
softfloat: expand out STATUS macro
Expand out and remove the STATUS macro. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
+12
-12
@@ -172,7 +172,7 @@ const float128 float128_default_nan
|
||||
|
||||
void float_raise(int8 flags, float_status *status)
|
||||
{
|
||||
STATUS(float_exception_flags) |= flags;
|
||||
status->float_exception_flags |= flags;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
@@ -275,7 +275,7 @@ static float16 commonNaNToFloat16(commonNaNT a, float_status *status)
|
||||
{
|
||||
uint16_t mantissa = a.high>>54;
|
||||
|
||||
if (STATUS(default_nan_mode)) {
|
||||
if (status->default_nan_mode) {
|
||||
return float16_default_nan;
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ static float32 commonNaNToFloat32(commonNaNT a, float_status *status)
|
||||
{
|
||||
uint32_t mantissa = a.high>>41;
|
||||
|
||||
if ( STATUS(default_nan_mode) ) {
|
||||
if (status->default_nan_mode) {
|
||||
return float32_default_nan;
|
||||
}
|
||||
|
||||
@@ -633,7 +633,7 @@ static float32 propagateFloat32NaN(float32 a, float32 b, float_status *status)
|
||||
float_raise(float_flag_invalid, status);
|
||||
}
|
||||
|
||||
if ( STATUS(default_nan_mode) )
|
||||
if (status->default_nan_mode)
|
||||
return float32_default_nan;
|
||||
|
||||
if ((uint32_t)(av<<1) < (uint32_t)(bv<<1)) {
|
||||
@@ -684,7 +684,7 @@ static float32 propagateFloat32MulAddNaN(float32 a, float32 b,
|
||||
bIsQuietNaN, bIsSignalingNaN,
|
||||
cIsQuietNaN, cIsSignalingNaN, infzero, status);
|
||||
|
||||
if (STATUS(default_nan_mode)) {
|
||||
if (status->default_nan_mode) {
|
||||
/* Note that this check is after pickNaNMulAdd so that function
|
||||
* has an opportunity to set the Invalid flag.
|
||||
*/
|
||||
@@ -800,7 +800,7 @@ static float64 commonNaNToFloat64(commonNaNT a, float_status *status)
|
||||
{
|
||||
uint64_t mantissa = a.high>>12;
|
||||
|
||||
if ( STATUS(default_nan_mode) ) {
|
||||
if (status->default_nan_mode) {
|
||||
return float64_default_nan;
|
||||
}
|
||||
|
||||
@@ -836,7 +836,7 @@ static float64 propagateFloat64NaN(float64 a, float64 b, float_status *status)
|
||||
float_raise(float_flag_invalid, status);
|
||||
}
|
||||
|
||||
if ( STATUS(default_nan_mode) )
|
||||
if (status->default_nan_mode)
|
||||
return float64_default_nan;
|
||||
|
||||
if ((uint64_t)(av<<1) < (uint64_t)(bv<<1)) {
|
||||
@@ -887,7 +887,7 @@ static float64 propagateFloat64MulAddNaN(float64 a, float64 b,
|
||||
bIsQuietNaN, bIsSignalingNaN,
|
||||
cIsQuietNaN, cIsSignalingNaN, infzero, status);
|
||||
|
||||
if (STATUS(default_nan_mode)) {
|
||||
if (status->default_nan_mode) {
|
||||
/* Note that this check is after pickNaNMulAdd so that function
|
||||
* has an opportunity to set the Invalid flag.
|
||||
*/
|
||||
@@ -1019,7 +1019,7 @@ static floatx80 commonNaNToFloatx80(commonNaNT a, float_status *status)
|
||||
{
|
||||
floatx80 z;
|
||||
|
||||
if ( STATUS(default_nan_mode) ) {
|
||||
if (status->default_nan_mode) {
|
||||
z.low = floatx80_default_nan_low;
|
||||
z.high = floatx80_default_nan_high;
|
||||
return z;
|
||||
@@ -1057,7 +1057,7 @@ static floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b,
|
||||
float_raise(float_flag_invalid, status);
|
||||
}
|
||||
|
||||
if ( STATUS(default_nan_mode) ) {
|
||||
if (status->default_nan_mode) {
|
||||
a.low = floatx80_default_nan_low;
|
||||
a.high = floatx80_default_nan_high;
|
||||
return a;
|
||||
@@ -1176,7 +1176,7 @@ static float128 commonNaNToFloat128(commonNaNT a, float_status *status)
|
||||
{
|
||||
float128 z;
|
||||
|
||||
if ( STATUS(default_nan_mode) ) {
|
||||
if (status->default_nan_mode) {
|
||||
z.low = float128_default_nan_low;
|
||||
z.high = float128_default_nan_high;
|
||||
return z;
|
||||
@@ -1208,7 +1208,7 @@ static float128 propagateFloat128NaN(float128 a, float128 b,
|
||||
float_raise(float_flag_invalid, status);
|
||||
}
|
||||
|
||||
if ( STATUS(default_nan_mode) ) {
|
||||
if (status->default_nan_mode) {
|
||||
a.low = float128_default_nan_low;
|
||||
a.high = float128_default_nan_high;
|
||||
return a;
|
||||
|
||||
+141
-98
File diff suppressed because it is too large
Load Diff
+14
-16
@@ -108,8 +108,6 @@ typedef int64_t int64;
|
||||
|
||||
#define LIT64( a ) a##LL
|
||||
|
||||
#define STATUS(field) status->field
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
| Software IEC/IEEE floating-point ordering relations
|
||||
*----------------------------------------------------------------------------*/
|
||||
@@ -224,60 +222,60 @@ typedef struct float_status {
|
||||
|
||||
static inline void set_float_detect_tininess(int val, float_status *status)
|
||||
{
|
||||
STATUS(float_detect_tininess) = val;
|
||||
status->float_detect_tininess = val;
|
||||
}
|
||||
static inline void set_float_rounding_mode(int val, float_status *status)
|
||||
{
|
||||
STATUS(float_rounding_mode) = val;
|
||||
status->float_rounding_mode = val;
|
||||
}
|
||||
static inline void set_float_exception_flags(int val, float_status *status)
|
||||
{
|
||||
STATUS(float_exception_flags) = val;
|
||||
status->float_exception_flags = val;
|
||||
}
|
||||
static inline void set_floatx80_rounding_precision(int val,
|
||||
float_status *status)
|
||||
{
|
||||
STATUS(floatx80_rounding_precision) = val;
|
||||
status->floatx80_rounding_precision = val;
|
||||
}
|
||||
static inline void set_flush_to_zero(flag val, float_status *status)
|
||||
{
|
||||
STATUS(flush_to_zero) = val;
|
||||
status->flush_to_zero = val;
|
||||
}
|
||||
static inline void set_flush_inputs_to_zero(flag val, float_status *status)
|
||||
{
|
||||
STATUS(flush_inputs_to_zero) = val;
|
||||
status->flush_inputs_to_zero = val;
|
||||
}
|
||||
static inline void set_default_nan_mode(flag val, float_status *status)
|
||||
{
|
||||
STATUS(default_nan_mode) = val;
|
||||
status->default_nan_mode = val;
|
||||
}
|
||||
static inline int get_float_detect_tininess(float_status *status)
|
||||
{
|
||||
return STATUS(float_detect_tininess);
|
||||
return status->float_detect_tininess;
|
||||
}
|
||||
static inline int get_float_rounding_mode(float_status *status)
|
||||
{
|
||||
return STATUS(float_rounding_mode);
|
||||
return status->float_rounding_mode;
|
||||
}
|
||||
static inline int get_float_exception_flags(float_status *status)
|
||||
{
|
||||
return STATUS(float_exception_flags);
|
||||
return status->float_exception_flags;
|
||||
}
|
||||
static inline int get_floatx80_rounding_precision(float_status *status)
|
||||
{
|
||||
return STATUS(floatx80_rounding_precision);
|
||||
return status->floatx80_rounding_precision;
|
||||
}
|
||||
static inline flag get_flush_to_zero(float_status *status)
|
||||
{
|
||||
return STATUS(flush_to_zero);
|
||||
return status->flush_to_zero;
|
||||
}
|
||||
static inline flag get_flush_inputs_to_zero(float_status *status)
|
||||
{
|
||||
return STATUS(flush_inputs_to_zero);
|
||||
return status->flush_inputs_to_zero;
|
||||
}
|
||||
static inline flag get_default_nan_mode(float_status *status)
|
||||
{
|
||||
return STATUS(default_nan_mode);
|
||||
return status->default_nan_mode;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user