Received: from [140.186.70.92] (port=40082 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwOP4-0005ow-Cd for qemu-devel@nongnu.org; Sun, 06 Mar 2011 19:34:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwOP2-0000v1-Bg for qemu-devel@nongnu.org; Sun, 06 Mar 2011 19:34:26 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:37775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwOP1-0000ud-CB for qemu-devel@nongnu.org; Sun, 06 Mar 2011 19:34:24 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 7 Mar 2011 01:34:12 +0100 Message-Id: <1299458053-69428-9-git-send-email-andreas.faerber@web.de> In-Reply-To: <1299458053-69428-8-git-send-email-andreas.faerber@web.de> References: <1294169951-5153-5-git-send-email-andreas.faerber@web.de> <1299458053-69428-1-git-send-email-andreas.faerber@web.de> <1299458053-69428-2-git-send-email-andreas.faerber@web.de> <1299458053-69428-3-git-send-email-andreas.faerber@web.de> <1299458053-69428-4-git-send-email-andreas.faerber@web.de> <1299458053-69428-5-git-send-email-andreas.faerber@web.de> <1299458053-69428-6-git-send-email-andreas.faerber@web.de> <1299458053-69428-7-git-send-email-andreas.faerber@web.de> <1299458053-69428-8-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v5 09/10] softfloat: Drop [u]int64 types in favor of [u]int_fast64_t List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= v5: * Initial. Cc: Peter Maydell Signed-off-by: Andreas F=C3=A4rber --- fpu/softfloat.c | 48 ++++++++++++++++++++++++------------------------ fpu/softfloat.h | 34 ++++++++++++++++------------------ 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index d1e3a42..6b2cbd7 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -159,11 +159,11 @@ static int_fast32_t roundAndPackInt32( flag zSign, = uint64_t absZ STATUS_PARAM) | returned. *-----------------------------------------------------------------------= -----*/ =20 -static int64 roundAndPackInt64( flag zSign, uint64_t absZ0, uint64_t abs= Z1 STATUS_PARAM) +static int_fast64_t roundAndPackInt64( flag zSign, uint64_t absZ0, uint6= 4_t absZ1 STATUS_PARAM) { int_fast8_t roundingMode; flag roundNearestEven, increment; - int64 z; + int_fast64_t z; =20 roundingMode =3D STATUS(float_rounding_mode); roundNearestEven =3D ( roundingMode =3D=3D float_round_nearest_even = ); @@ -660,7 +660,7 @@ static floatx80 { int_fast8_t roundingMode; flag roundNearestEven, increment, isTiny; - int64 roundIncrement, roundMask, roundBits; + int_fast64_t roundIncrement, roundMask, roundBits; =20 roundingMode =3D STATUS(float_rounding_mode); roundNearestEven =3D ( roundingMode =3D=3D float_round_nearest_even = ); @@ -1206,10 +1206,10 @@ float128 int32_to_float128( int_fast32_t a STATUS= _PARAM ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmeti= c. *-----------------------------------------------------------------------= -----*/ =20 -float32 int64_to_float32( int64 a STATUS_PARAM ) +float32 int64_to_float32( int_fast64_t a STATUS_PARAM ) { flag zSign; - uint64 absA; + uint_fast64_t absA; int_fast8_t shiftCount; =20 if ( a =3D=3D 0 ) return float32_zero; @@ -1232,7 +1232,7 @@ float32 int64_to_float32( int64 a STATUS_PARAM ) =20 } =20 -float32 uint64_to_float32( uint64 a STATUS_PARAM ) +float32 uint64_to_float32( uint_fast64_t a STATUS_PARAM ) { int_fast8_t shiftCount; =20 @@ -1259,7 +1259,7 @@ float32 uint64_to_float32( uint64 a STATUS_PARAM ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmeti= c. *-----------------------------------------------------------------------= -----*/ =20 -float64 int64_to_float64( int64 a STATUS_PARAM ) +float64 int64_to_float64( int_fast64_t a STATUS_PARAM ) { flag zSign; =20 @@ -1272,7 +1272,7 @@ float64 int64_to_float64( int64 a STATUS_PARAM ) =20 } =20 -float64 uint64_to_float64( uint64 a STATUS_PARAM ) +float64 uint64_to_float64( uint_fast64_t a STATUS_PARAM ) { if ( a =3D=3D 0 ) return float64_zero; return normalizeRoundAndPackFloat64( 0, 0x43C, a STATUS_VAR ); @@ -1288,10 +1288,10 @@ float64 uint64_to_float64( uint64 a STATUS_PARAM = ) | Arithmetic. *-----------------------------------------------------------------------= -----*/ =20 -floatx80 int64_to_floatx80( int64 a STATUS_PARAM ) +floatx80 int64_to_floatx80( int_fast64_t a STATUS_PARAM ) { flag zSign; - uint64 absA; + uint_fast64_t absA; int_fast8_t shiftCount; =20 if ( a =3D=3D 0 ) return packFloatx80( 0, 0, 0 ); @@ -1312,10 +1312,10 @@ floatx80 int64_to_floatx80( int64 a STATUS_PARAM = ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmeti= c. *-----------------------------------------------------------------------= -----*/ =20 -float128 int64_to_float128( int64 a STATUS_PARAM ) +float128 int64_to_float128( int_fast64_t a STATUS_PARAM ) { flag zSign; - uint64 absA; + uint_fast64_t absA; int_fast8_t shiftCount; int_fast32_t zExp; uint64_t zSig0, zSig1; @@ -1474,7 +1474,7 @@ int_fast16_t float32_to_int16_round_to_zero( float3= 2 a STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 float32_to_int64( float32 a STATUS_PARAM ) +int_fast64_t float32_to_int64( float32 a STATUS_PARAM ) { flag aSign; int_fast16_t aExp, shiftCount; @@ -1511,13 +1511,13 @@ int64 float32_to_int64( float32 a STATUS_PARAM ) | returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 float32_to_int64_round_to_zero( float32 a STATUS_PARAM ) +int_fast64_t float32_to_int64_round_to_zero( float32 a STATUS_PARAM ) { flag aSign; int_fast16_t aExp, shiftCount; uint32_t aSig; uint64_t aSig64; - int64 z; + int_fast64_t z; a =3D float32_squash_input_denormal(a STATUS_VAR); =20 aSig =3D extractFloat32Frac( a ); @@ -2616,7 +2616,7 @@ int_fast16_t float64_to_int16_round_to_zero( float6= 4 a STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 float64_to_int64( float64 a STATUS_PARAM ) +int_fast64_t float64_to_int64( float64 a STATUS_PARAM ) { flag aSign; int_fast16_t aExp, shiftCount; @@ -2659,12 +2659,12 @@ int64 float64_to_int64( float64 a STATUS_PARAM ) | returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 float64_to_int64_round_to_zero( float64 a STATUS_PARAM ) +int_fast64_t float64_to_int64_round_to_zero( float64 a STATUS_PARAM ) { flag aSign; int_fast16_t aExp, shiftCount; uint64_t aSig; - int64 z; + int_fast64_t z; a =3D float64_squash_input_denormal(a STATUS_VAR); =20 aSig =3D extractFloat64Frac( a ); @@ -3788,7 +3788,7 @@ int_fast32_t floatx80_to_int32_round_to_zero( float= x80 a STATUS_PARAM ) | overflows, the largest integer with the same sign as `a' is returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 floatx80_to_int64( floatx80 a STATUS_PARAM ) +int_fast64_t floatx80_to_int64( floatx80 a STATUS_PARAM ) { flag aSign; int_fast32_t aExp, shiftCount; @@ -3828,12 +3828,12 @@ int64 floatx80_to_int64( floatx80 a STATUS_PARAM = ) | sign as `a' is returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 floatx80_to_int64_round_to_zero( floatx80 a STATUS_PARAM ) +int_fast64_t floatx80_to_int64_round_to_zero( floatx80 a STATUS_PARAM ) { flag aSign; int_fast32_t aExp, shiftCount; uint64_t aSig; - int64 z; + int_fast64_t z; =20 aSig =3D extractFloatx80Frac( a ); aExp =3D extractFloatx80Exp( a ); @@ -4786,7 +4786,7 @@ int_fast32_t float128_to_int32_round_to_zero( float= 128 a STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 float128_to_int64( float128 a STATUS_PARAM ) +int_fast64_t float128_to_int64( float128 a STATUS_PARAM ) { flag aSign; int_fast32_t aExp, shiftCount; @@ -4829,12 +4829,12 @@ int64 float128_to_int64( float128 a STATUS_PARAM = ) | returned. *-----------------------------------------------------------------------= -----*/ =20 -int64 float128_to_int64_round_to_zero( float128 a STATUS_PARAM ) +int_fast64_t float128_to_int64_round_to_zero( float128 a STATUS_PARAM ) { flag aSign; int_fast32_t aExp, shiftCount; uint64_t aSig0, aSig1; - int64 z; + int_fast64_t z; =20 aSig1 =3D extractFloat128Frac1( a ); aSig0 =3D extractFloat128Frac0( a ); diff --git a/fpu/softfloat.h b/fpu/softfloat.h index ce65530..f638a4d 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -54,8 +54,6 @@ these four paragraphs for those parts of this code that= are retained. | to the same as `int'. *-----------------------------------------------------------------------= -----*/ typedef uint8_t flag; -typedef uint64_t uint64; -typedef int64_t int64; =20 #define LIT64( a ) a##LL #define INLINE static inline @@ -242,15 +240,15 @@ floatx80 int32_to_floatx80( int_fast32_t STATUS_PAR= AM ); #ifdef FLOAT128 float128 int32_to_float128( int_fast32_t STATUS_PARAM ); #endif -float32 int64_to_float32( int64 STATUS_PARAM ); -float32 uint64_to_float32( uint64 STATUS_PARAM ); -float64 int64_to_float64( int64 STATUS_PARAM ); -float64 uint64_to_float64( uint64 STATUS_PARAM ); +float32 int64_to_float32( int_fast64_t STATUS_PARAM ); +float32 uint64_to_float32( uint_fast64_t STATUS_PARAM ); +float64 int64_to_float64( int_fast64_t STATUS_PARAM ); +float64 uint64_to_float64( uint_fast64_t STATUS_PARAM ); #ifdef FLOATX80 -floatx80 int64_to_floatx80( int64 STATUS_PARAM ); +floatx80 int64_to_floatx80( int_fast64_t STATUS_PARAM ); #endif #ifdef FLOAT128 -float128 int64_to_float128( int64 STATUS_PARAM ); +float128 int64_to_float128( int_fast64_t STATUS_PARAM ); #endif =20 /*----------------------------------------------------------------------= ------ @@ -286,8 +284,8 @@ int_fast32_t float32_to_int32( float32 STATUS_PARAM )= ; int_fast32_t float32_to_int32_round_to_zero( float32 STATUS_PARAM ); uint_fast32_t float32_to_uint32( float32 STATUS_PARAM ); uint_fast32_t float32_to_uint32_round_to_zero( float32 STATUS_PARAM ); -int64 float32_to_int64( float32 STATUS_PARAM ); -int64 float32_to_int64_round_to_zero( float32 STATUS_PARAM ); +int_fast64_t float32_to_int64( float32 STATUS_PARAM ); +int_fast64_t float32_to_int64_round_to_zero( float32 STATUS_PARAM ); float64 float32_to_float64( float32 STATUS_PARAM ); #ifdef FLOATX80 floatx80 float32_to_floatx80( float32 STATUS_PARAM ); @@ -396,10 +394,10 @@ int_fast32_t float64_to_int32( float64 STATUS_PARAM= ); int_fast32_t float64_to_int32_round_to_zero( float64 STATUS_PARAM ); uint_fast32_t float64_to_uint32( float64 STATUS_PARAM ); uint_fast32_t float64_to_uint32_round_to_zero( float64 STATUS_PARAM ); -int64 float64_to_int64( float64 STATUS_PARAM ); -int64 float64_to_int64_round_to_zero( float64 STATUS_PARAM ); -uint64 float64_to_uint64 (float64 a STATUS_PARAM); -uint64 float64_to_uint64_round_to_zero (float64 a STATUS_PARAM); +int_fast64_t float64_to_int64( float64 STATUS_PARAM ); +int_fast64_t float64_to_int64_round_to_zero( float64 STATUS_PARAM ); +uint_fast64_t float64_to_uint64 (float64 a STATUS_PARAM); +uint_fast64_t float64_to_uint64_round_to_zero (float64 a STATUS_PARAM); float32 float64_to_float32( float64 STATUS_PARAM ); #ifdef FLOATX80 floatx80 float64_to_floatx80( float64 STATUS_PARAM ); @@ -501,8 +499,8 @@ INLINE float64 float64_set_sign(float64 a, int sign) *-----------------------------------------------------------------------= -----*/ int_fast32_t floatx80_to_int32( floatx80 STATUS_PARAM ); int_fast32_t floatx80_to_int32_round_to_zero( floatx80 STATUS_PARAM ); -int64 floatx80_to_int64( floatx80 STATUS_PARAM ); -int64 floatx80_to_int64_round_to_zero( floatx80 STATUS_PARAM ); +int_fast64_t floatx80_to_int64( floatx80 STATUS_PARAM ); +int_fast64_t floatx80_to_int64_round_to_zero( floatx80 STATUS_PARAM ); float32 floatx80_to_float32( floatx80 STATUS_PARAM ); float64 floatx80_to_float64( floatx80 STATUS_PARAM ); #ifdef FLOAT128 @@ -584,8 +582,8 @@ INLINE int floatx80_is_any_nan(floatx80 a) *-----------------------------------------------------------------------= -----*/ int_fast32_t float128_to_int32( float128 STATUS_PARAM ); int_fast32_t float128_to_int32_round_to_zero( float128 STATUS_PARAM ); -int64 float128_to_int64( float128 STATUS_PARAM ); -int64 float128_to_int64_round_to_zero( float128 STATUS_PARAM ); +int_fast64_t float128_to_int64( float128 STATUS_PARAM ); +int_fast64_t float128_to_int64_round_to_zero( float128 STATUS_PARAM ); float32 float128_to_float32( float128 STATUS_PARAM ); float64 float128_to_float64( float128 STATUS_PARAM ); #ifdef FLOATX80 --=20 1.7.3.4