Received: from [140.186.70.92] (port=40051 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwOP3-0005o3-9y for qemu-devel@nongnu.org; Sun, 06 Mar 2011 19:34:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwOP1-0000uj-Cq for qemu-devel@nongnu.org; Sun, 06 Mar 2011 19:34:24 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:60838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwOP0-0000uM-Ok for qemu-devel@nongnu.org; Sun, 06 Mar 2011 19:34:23 -0500 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate03.web.de (Postfix) with ESMTP id F1A79189984AB for ; Mon, 7 Mar 2011 01:34:21 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 7 Mar 2011 01:34:11 +0100 Message-Id: <1299458053-69428-8-git-send-email-andreas.faerber@web.de> In-Reply-To: <1299458053-69428-7-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> 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 08/10] softfloat: Use [u]int_fast32_t consistently List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= v5: * Initial. Signed-off-by: Andreas F=C3=A4rber --- fpu/softfloat-native.c | 42 +++++++++++++++++++++--------------------- fpu/softfloat-native.h | 32 ++++++++++++++++---------------- fpu/softfloat.c | 12 ++++++------ fpu/softfloat.h | 4 ++-- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c index 50355a4..2c08958 100644 --- a/fpu/softfloat-native.c +++ b/fpu/softfloat-native.c @@ -77,28 +77,28 @@ static double qemu_rint(double x) /*----------------------------------------------------------------------= ------ | Software IEC/IEEE integer-to-floating-point conversion routines. *-----------------------------------------------------------------------= -----*/ -float32 int32_to_float32(int v STATUS_PARAM) +float32 int32_to_float32(int_fast32_t v STATUS_PARAM) { return (float32)v; } =20 -float32 uint32_to_float32(unsigned int v STATUS_PARAM) +float32 uint32_to_float32(uint_fast32_t v STATUS_PARAM) { return (float32)v; } =20 -float64 int32_to_float64(int v STATUS_PARAM) +float64 int32_to_float64(int_fast32_t v STATUS_PARAM) { return (float64)v; } =20 -float64 uint32_to_float64(unsigned int v STATUS_PARAM) +float64 uint32_to_float64(uint_fast32_t v STATUS_PARAM) { return (float64)v; } =20 #ifdef FLOATX80 -floatx80 int32_to_floatx80(int v STATUS_PARAM) +floatx80 int32_to_floatx80(int_fast32_t v STATUS_PARAM) { return (floatx80)v; } @@ -144,13 +144,13 @@ static inline int long_to_int32(long a) /*----------------------------------------------------------------------= ------ | Software IEC/IEEE single-precision conversion routines. *-----------------------------------------------------------------------= -----*/ -int float32_to_int32( float32 a STATUS_PARAM) +int_fast32_t float32_to_int32( float32 a STATUS_PARAM) { return long_to_int32(lrintf(a)); } -int float32_to_int32_round_to_zero( float32 a STATUS_PARAM) +int_fast32_t float32_to_int32_round_to_zero( float32 a STATUS_PARAM) { - return (int)a; + return (int32_t)a; } int64_t float32_to_int64( float32 a STATUS_PARAM) { @@ -173,10 +173,10 @@ floatx80 float32_to_floatx80( float32 a STATUS_PARA= M) } #endif =20 -unsigned int float32_to_uint32( float32 a STATUS_PARAM) +uint_fast32_t float32_to_uint32( float32 a STATUS_PARAM) { int64_t v; - unsigned int res; + uint_fast32_t res; =20 v =3D llrintf(a); if (v < 0) { @@ -188,10 +188,10 @@ unsigned int float32_to_uint32( float32 a STATUS_PA= RAM) } return res; } -unsigned int float32_to_uint32_round_to_zero( float32 a STATUS_PARAM) +uint_fast32_t float32_to_uint32_round_to_zero( float32 a STATUS_PARAM) { int64_t v; - unsigned int res; + uint_fast32_t res; =20 v =3D (int64_t)a; if (v < 0) { @@ -266,13 +266,13 @@ int float32_is_quiet_nan( float32 a1 ) /*----------------------------------------------------------------------= ------ | Software IEC/IEEE double-precision conversion routines. *-----------------------------------------------------------------------= -----*/ -int float64_to_int32( float64 a STATUS_PARAM) +int_fast32_t float64_to_int32( float64 a STATUS_PARAM) { return long_to_int32(lrint(a)); } -int float64_to_int32_round_to_zero( float64 a STATUS_PARAM) +int_fast32_t float64_to_int32_round_to_zero( float64 a STATUS_PARAM) { - return (int)a; + return (int32_t)a; } int64_t float64_to_int64( float64 a STATUS_PARAM) { @@ -299,10 +299,10 @@ float128 float64_to_float128( float64 a STATUS_PARA= M) } #endif =20 -unsigned int float64_to_uint32( float64 a STATUS_PARAM) +uint_fast32_t float64_to_uint32( float64 a STATUS_PARAM) { int64_t v; - unsigned int res; + uint_fast32_t res; =20 v =3D llrint(a); if (v < 0) { @@ -314,10 +314,10 @@ unsigned int float64_to_uint32( float64 a STATUS_PA= RAM) } return res; } -unsigned int float64_to_uint32_round_to_zero( float64 a STATUS_PARAM) +uint_fast32_t float64_to_uint32_round_to_zero( float64 a STATUS_PARAM) { int64_t v; - unsigned int res; + uint_fast32_t res; =20 v =3D (int64_t)a; if (v < 0) { @@ -427,11 +427,11 @@ int float64_is_quiet_nan( float64 a1 ) /*----------------------------------------------------------------------= ------ | Software IEC/IEEE extended double-precision conversion routines. *-----------------------------------------------------------------------= -----*/ -int floatx80_to_int32( floatx80 a STATUS_PARAM) +int_fast32_t floatx80_to_int32( floatx80 a STATUS_PARAM) { return long_to_int32(lrintl(a)); } -int floatx80_to_int32_round_to_zero( floatx80 a STATUS_PARAM) +int_fast32_t floatx80_to_int32_round_to_zero( floatx80 a STATUS_PARAM) { return (int)a; } diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h index 80b5f28..6cf5dc3 100644 --- a/fpu/softfloat-native.h +++ b/fpu/softfloat-native.h @@ -150,15 +150,15 @@ void set_floatx80_rounding_precision(int val STATUS= _PARAM); /*----------------------------------------------------------------------= ------ | Software IEC/IEEE integer-to-floating-point conversion routines. *-----------------------------------------------------------------------= -----*/ -float32 int32_to_float32( int STATUS_PARAM); -float32 uint32_to_float32( unsigned int STATUS_PARAM); -float64 int32_to_float64( int STATUS_PARAM); -float64 uint32_to_float64( unsigned int STATUS_PARAM); +float32 int32_to_float32( int_fast32_t STATUS_PARAM); +float32 uint32_to_float32( uint_fast32_t STATUS_PARAM); +float64 int32_to_float64( int_fast32_t STATUS_PARAM); +float64 uint32_to_float64( uint_fast32_t STATUS_PARAM); #ifdef FLOATX80 -floatx80 int32_to_floatx80( int STATUS_PARAM); +floatx80 int32_to_floatx80( int_fast32_t STATUS_PARAM); #endif #ifdef FLOAT128 -float128 int32_to_float128( int STATUS_PARAM); +float128 int32_to_float128( int_fast32_t STATUS_PARAM); #endif float32 int64_to_float32( int64_t STATUS_PARAM); float32 uint64_to_float32( uint64_t STATUS_PARAM); @@ -174,10 +174,10 @@ float128 int64_to_float128( int64_t STATUS_PARAM); /*----------------------------------------------------------------------= ------ | Software IEC/IEEE single-precision conversion routines. *-----------------------------------------------------------------------= -----*/ -int float32_to_int32( float32 STATUS_PARAM); -int float32_to_int32_round_to_zero( float32 STATUS_PARAM); -unsigned int float32_to_uint32( float32 a STATUS_PARAM); -unsigned int float32_to_uint32_round_to_zero( float32 a STATUS_PARAM); +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 a STATUS_PARAM); +uint_fast32_t float32_to_uint32_round_to_zero( float32 a STATUS_PARAM); int64_t float32_to_int64( float32 STATUS_PARAM); int64_t float32_to_int64_round_to_zero( float32 STATUS_PARAM); float64 float32_to_float64( float32 STATUS_PARAM); @@ -279,10 +279,10 @@ INLINE float32 float32_scalbn(float32 a, int n) /*----------------------------------------------------------------------= ------ | Software IEC/IEEE double-precision conversion routines. *-----------------------------------------------------------------------= -----*/ -int float64_to_int32( float64 STATUS_PARAM ); -int float64_to_int32_round_to_zero( float64 STATUS_PARAM ); -unsigned int float64_to_uint32( float64 STATUS_PARAM ); -unsigned int float64_to_uint32_round_to_zero( float64 STATUS_PARAM ); +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_t float64_to_int64( float64 STATUS_PARAM ); int64_t float64_to_int64_round_to_zero( float64 STATUS_PARAM ); uint64_t float64_to_uint64( float64 STATUS_PARAM ); @@ -390,8 +390,8 @@ INLINE float64 float64_scalbn(float64 a, int n) /*----------------------------------------------------------------------= ------ | Software IEC/IEEE extended double-precision conversion routines. *-----------------------------------------------------------------------= -----*/ -int floatx80_to_int32( floatx80 STATUS_PARAM ); -int floatx80_to_int32_round_to_zero( floatx80 STATUS_PARAM ); +int_fast32_t floatx80_to_int32( floatx80 STATUS_PARAM ); +int_fast32_t floatx80_to_int32_round_to_zero( floatx80 STATUS_PARAM ); int64_t floatx80_to_int64( floatx80 STATUS_PARAM); int64_t floatx80_to_int64_round_to_zero( floatx80 STATUS_PARAM); float32 floatx80_to_float32( floatx80 STATUS_PARAM ); diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 7f0f603..d1e3a42 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -5819,20 +5819,20 @@ int float128_lt_quiet( float128 a, float128 b STA= TUS_PARAM ) #endif =20 /* misc functions */ -float32 uint32_to_float32( unsigned int a STATUS_PARAM ) +float32 uint32_to_float32( uint_fast32_t a STATUS_PARAM ) { return int64_to_float32(a STATUS_VAR); } =20 -float64 uint32_to_float64( unsigned int a STATUS_PARAM ) +float64 uint32_to_float64( uint_fast32_t a STATUS_PARAM ) { return int64_to_float64(a STATUS_VAR); } =20 -unsigned int float32_to_uint32( float32 a STATUS_PARAM ) +uint_fast32_t float32_to_uint32( float32 a STATUS_PARAM ) { int64_t v; - unsigned int res; + uint_fast32_t res; =20 v =3D float32_to_int64(a STATUS_VAR); if (v < 0) { @@ -5847,10 +5847,10 @@ unsigned int float32_to_uint32( float32 a STATUS_= PARAM ) return res; } =20 -unsigned int float32_to_uint32_round_to_zero( float32 a STATUS_PARAM ) +uint_fast32_t float32_to_uint32_round_to_zero( float32 a STATUS_PARAM ) { int64_t v; - unsigned int res; + uint_fast32_t res; =20 v =3D float32_to_int64_round_to_zero(a STATUS_VAR); if (v < 0) { diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 4c64d77..ce65530 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -234,8 +234,8 @@ void float_raise( int_fast8_t flags STATUS_PARAM); *-----------------------------------------------------------------------= -----*/ float32 int32_to_float32( int_fast32_t STATUS_PARAM ); float64 int32_to_float64( int_fast32_t STATUS_PARAM ); -float32 uint32_to_float32( unsigned int STATUS_PARAM ); -float64 uint32_to_float64( unsigned int STATUS_PARAM ); +float32 uint32_to_float32( uint_fast32_t STATUS_PARAM ); +float64 uint32_to_float64( uint_fast32_t STATUS_PARAM ); #ifdef FLOATX80 floatx80 int32_to_floatx80( int_fast32_t STATUS_PARAM ); #endif --=20 1.7.3.4