softfloat: Fix warn about implicit conversion from int to int8_t

Change the flag type to 'uint8_t' to fix the implicit conversion error.

Backports commit dfd607671037ff46d5b16ade10e10efdf0d260be from qemu
This commit is contained in:
Pranith Kumar 2018-02-25 22:54:32 -05:00 committed by Lioncash
parent 4c880fba9d
commit 1b19fe260a
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
3 changed files with 60 additions and 60 deletions

View file

@ -196,7 +196,7 @@ float128 float128_default_nan(float_status *status)
| should be simply `float_exception_flags |= flags;'.
*----------------------------------------------------------------------------*/
void float_raise(int8_t flags, float_status *status)
void float_raise(uint8_t flags, float_status *status)
{
status->float_exception_flags |= flags;
}

View file

@ -439,7 +439,7 @@ static float32 roundAndPackFloat32(flag zSign, int zExp, uint32_t zSig, float_st
}
if ( zExp < 0 ) {
if (status->flush_to_zero) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
return packFloat32(zSign, 0, 0);
}
isTiny =
@ -625,7 +625,7 @@ static float64 roundAndPackFloat64(flag zSign, int zExp, uint64_t zSig, float_st
}
if ( zExp < 0 ) {
if (status->flush_to_zero) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
return packFloat64(zSign, 0, 0);
}
isTiny =
@ -809,7 +809,7 @@ static floatx80
}
if ( zExp <= 0 ) {
if (status->flush_to_zero) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
return packFloatx80(zSign, 0, 0);
}
isTiny =
@ -1155,7 +1155,7 @@ static float128
}
if ( zExp < 0 ) {
if (status->flush_to_zero) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
return packFloat128(zSign, 0, 0, 0);
}
isTiny =
@ -2022,7 +2022,7 @@ static float32 addFloat32Sigs(float32 a, float32 b, flag zSign, float_status *st
if ( aExp == 0 ) {
if (status->flush_to_zero) {
if (aSig | bSig) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
}
return packFloat32(zSign, 0, 0);
}
@ -2504,7 +2504,7 @@ float32 float32_muladd(float32 a, float32 b, float32 c, int flags, float_status
}
/* Exact zero plus a denorm */
if (status->flush_to_zero) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
return packFloat32(cSign ^ signflip, 0, 0);
}
}
@ -3812,7 +3812,7 @@ static float64 addFloat64Sigs(float64 a, float64 b, flag zSign, float_status *st
if ( aExp == 0 ) {
if (status->flush_to_zero) {
if (aSig | bSig) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
}
return packFloat64(zSign, 0, 0);
}
@ -4286,7 +4286,7 @@ float64 float64_muladd(float64 a, float64 b, float64 c, int flags, float_status
}
/* Exact zero plus a denorm */
if (status->flush_to_zero) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
return packFloat64(cSign ^ signflip, 0, 0);
}
}
@ -6358,7 +6358,7 @@ static float128 addFloat128Sigs(float128 a, float128 b, flag zSign, float_status
if ( aExp == 0 ) {
if (status->flush_to_zero) {
if (zSig0 | zSig1) {
float_raise((int8_t)float_flag_output_denormal, status);
float_raise(float_flag_output_denormal, status);
}
return packFloat128(zSign, 0, 0, 0);
}

View file

@ -206,7 +206,7 @@ enum {
typedef struct float_status {
signed char float_detect_tininess;
signed char float_rounding_mode;
signed char float_exception_flags;
uint8_t float_exception_flags;
signed char floatx80_rounding_precision;
/* should denormalised results go to zero and set the inexact flag? */
flag flush_to_zero;
@ -281,7 +281,7 @@ static inline flag get_default_nan_mode(float_status *status)
| Routine to raise any or all of the software IEC/IEEE floating-point
| exception flags.
*----------------------------------------------------------------------------*/
void float_raise( int8_t flags, float_status *status);
void float_raise(uint8_t flags, float_status *status);
/*----------------------------------------------------------------------------
| If `a' is denormal and we are in flush-to-zero mode then set the