mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 09:01:09 +00:00
fpu: Remove use of int_fast16_t in conversions to int16
Make the functions which convert floating point to 16 bit integer return int16_t rather than int_fast16_t, and correspondingly use int_fast16_t in their internal implementations where appropriate. (These functions are used only by the ARM target.) Backports commit 0bb721d7217ed4a1abb44f521c5c7ec185062d58 from qemu
This commit is contained in:
parent
69d31fbbab
commit
68cbe1b2ce
|
@ -1588,10 +1588,10 @@ int32_t float32_to_int32_round_to_zero( float32 a, float_status *status)
|
||||||
| returned.
|
| returned.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int_fast16_t float32_to_int16_round_to_zero(float32 a, float_status *status)
|
int16_t float32_to_int16_round_to_zero(float32 a, float_status *status)
|
||||||
{
|
{
|
||||||
flag aSign;
|
flag aSign;
|
||||||
int_fast16_t aExp, shiftCount;
|
int16_t aExp, shiftCount;
|
||||||
uint32_t aSig;
|
uint32_t aSig;
|
||||||
int32_t z;
|
int32_t z;
|
||||||
|
|
||||||
|
@ -3114,10 +3114,10 @@ int32_t float64_to_int32_round_to_zero( float64 a, float_status *status )
|
||||||
| returned.
|
| returned.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int_fast16_t float64_to_int16_round_to_zero(float64 a, float_status *status)
|
int16_t float64_to_int16_round_to_zero(float64 a, float_status *status)
|
||||||
{
|
{
|
||||||
flag aSign;
|
flag aSign;
|
||||||
int_fast16_t aExp, shiftCount;
|
int16_t aExp, shiftCount;
|
||||||
uint64_t aSig, savedASig;
|
uint64_t aSig, savedASig;
|
||||||
int32_t z;
|
int32_t z;
|
||||||
|
|
||||||
|
@ -7117,10 +7117,10 @@ uint32_t float32_to_uint32_round_to_zero( float32 a, float_status *status )
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int_fast16_t float32_to_int16(float32 a, float_status *status)
|
int16_t float32_to_int16(float32 a, float_status *status)
|
||||||
{
|
{
|
||||||
int32_t v;
|
int32_t v;
|
||||||
int_fast16_t res;
|
int16_t res;
|
||||||
int old_exc_flags = get_float_exception_flags(status);
|
int old_exc_flags = get_float_exception_flags(status);
|
||||||
|
|
||||||
v = float32_to_int32(a, status);
|
v = float32_to_int32(a, status);
|
||||||
|
@ -7137,10 +7137,10 @@ int_fast16_t float32_to_int16(float32 a, float_status *status)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint_fast16_t float32_to_uint16(float32 a, float_status *status)
|
uint16_t float32_to_uint16(float32 a, float_status *status)
|
||||||
{
|
{
|
||||||
int32_t v;
|
int32_t v;
|
||||||
uint_fast16_t res;
|
uint16_t res;
|
||||||
int old_exc_flags = get_float_exception_flags(status);
|
int old_exc_flags = get_float_exception_flags(status);
|
||||||
|
|
||||||
v = float32_to_int32(a, status);
|
v = float32_to_int32(a, status);
|
||||||
|
@ -7157,10 +7157,10 @@ uint_fast16_t float32_to_uint16(float32 a, float_status *status)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint_fast16_t float32_to_uint16_round_to_zero(float32 a, float_status *status)
|
uint16_t float32_to_uint16_round_to_zero(float32 a, float_status *status)
|
||||||
{
|
{
|
||||||
int64_t v;
|
int64_t v;
|
||||||
uint_fast16_t res;
|
uint16_t res;
|
||||||
int old_exc_flags = get_float_exception_flags(status);
|
int old_exc_flags = get_float_exception_flags(status);
|
||||||
|
|
||||||
v = float32_to_int64_round_to_zero(a, status);
|
v = float32_to_int64_round_to_zero(a, status);
|
||||||
|
@ -7210,10 +7210,10 @@ uint32_t float64_to_uint32_round_to_zero( float64 a, float_status *status )
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int_fast16_t float64_to_int16(float64 a, float_status *status)
|
int16_t float64_to_int16(float64 a, float_status *status)
|
||||||
{
|
{
|
||||||
int64_t v;
|
int64_t v;
|
||||||
int_fast16_t res;
|
int16_t res;
|
||||||
int old_exc_flags = get_float_exception_flags(status);
|
int old_exc_flags = get_float_exception_flags(status);
|
||||||
|
|
||||||
v = float64_to_int32(a, status);
|
v = float64_to_int32(a, status);
|
||||||
|
@ -7230,10 +7230,10 @@ int_fast16_t float64_to_int16(float64 a, float_status *status)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint_fast16_t float64_to_uint16(float64 a, float_status *status)
|
uint16_t float64_to_uint16(float64 a, float_status *status)
|
||||||
{
|
{
|
||||||
int64_t v;
|
int64_t v;
|
||||||
uint_fast16_t res;
|
uint16_t res;
|
||||||
int old_exc_flags = get_float_exception_flags(status);
|
int old_exc_flags = get_float_exception_flags(status);
|
||||||
|
|
||||||
v = float64_to_int32(a, status);
|
v = float64_to_int32(a, status);
|
||||||
|
@ -7250,10 +7250,10 @@ uint_fast16_t float64_to_uint16(float64 a, float_status *status)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint_fast16_t float64_to_uint16_round_to_zero(float64 a, float_status *status)
|
uint16_t float64_to_uint16_round_to_zero(float64 a, float_status *status)
|
||||||
{
|
{
|
||||||
int64_t v;
|
int64_t v;
|
||||||
uint_fast16_t res;
|
uint16_t res;
|
||||||
int old_exc_flags = get_float_exception_flags(status);
|
int old_exc_flags = get_float_exception_flags(status);
|
||||||
|
|
||||||
v = float64_to_int64_round_to_zero(a, status);
|
v = float64_to_int64_round_to_zero(a, status);
|
||||||
|
@ -7284,7 +7284,7 @@ uint_fast16_t float64_to_uint16_round_to_zero(float64 a, float_status *status)
|
||||||
uint64_t float64_to_uint64(float64 a, float_status *status)
|
uint64_t float64_to_uint64(float64 a, float_status *status)
|
||||||
{
|
{
|
||||||
flag aSign;
|
flag aSign;
|
||||||
int_fast16_t aExp, shiftCount;
|
int16_t aExp, shiftCount;
|
||||||
uint64_t aSig, aSigExtra;
|
uint64_t aSig, aSigExtra;
|
||||||
a = float64_squash_input_denormal(a, status);
|
a = float64_squash_input_denormal(a, status);
|
||||||
|
|
||||||
|
|
|
@ -366,10 +366,10 @@ extern const float16 float16_default_nan;
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| Software IEC/IEEE single-precision conversion routines.
|
| Software IEC/IEEE single-precision conversion routines.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
int_fast16_t float32_to_int16(float32, float_status *status);
|
int16_t float32_to_int16(float32, float_status *status);
|
||||||
uint_fast16_t float32_to_uint16(float32, float_status *status);
|
uint16_t float32_to_uint16(float32, float_status *status);
|
||||||
int_fast16_t float32_to_int16_round_to_zero(float32, float_status *status);
|
int16_t float32_to_int16_round_to_zero(float32, float_status *status);
|
||||||
uint_fast16_t float32_to_uint16_round_to_zero(float32, float_status *status);
|
uint16_t float32_to_uint16_round_to_zero(float32, float_status *status);
|
||||||
int32_t float32_to_int32( float32, float_status *status );
|
int32_t float32_to_int32( float32, float_status *status );
|
||||||
int32_t float32_to_int32_round_to_zero( float32, float_status *status );
|
int32_t float32_to_int32_round_to_zero( float32, float_status *status );
|
||||||
uint32_t float32_to_uint32( float32, float_status *status );
|
uint32_t float32_to_uint32( float32, float_status *status );
|
||||||
|
@ -478,10 +478,10 @@ extern const float32 float32_default_nan;
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
| Software IEC/IEEE double-precision conversion routines.
|
| Software IEC/IEEE double-precision conversion routines.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
int_fast16_t float64_to_int16(float64, float_status *status);
|
int16_t float64_to_int16(float64, float_status *status);
|
||||||
uint_fast16_t float64_to_uint16(float64, float_status *status);
|
uint16_t float64_to_uint16(float64, float_status *status);
|
||||||
int_fast16_t float64_to_int16_round_to_zero(float64, float_status *status);
|
int16_t float64_to_int16_round_to_zero(float64, float_status *status);
|
||||||
uint_fast16_t float64_to_uint16_round_to_zero(float64, float_status *status);
|
uint16_t float64_to_uint16_round_to_zero(float64, float_status *status);
|
||||||
int32_t float64_to_int32( float64, float_status *status );
|
int32_t float64_to_int32( float64, float_status *status );
|
||||||
int32_t float64_to_int32_round_to_zero( float64, float_status *status );
|
int32_t float64_to_int32_round_to_zero( float64, float_status *status );
|
||||||
uint32_t float64_to_uint32( float64, float_status *status );
|
uint32_t float64_to_uint32( float64, float_status *status );
|
||||||
|
|
Loading…
Reference in a new issue