From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rmal9-0000h7-L7 for qemu-devel@nongnu.org; Sun, 15 Jan 2012 19:49:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rmal7-0000j2-HN for qemu-devel@nongnu.org; Sun, 15 Jan 2012 19:49:15 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58274 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rmal6-0000ir-TM for qemu-devel@nongnu.org; Sun, 15 Jan 2012 19:49:13 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 16 Jan 2012 01:46:58 +0100 Message-Id: <1326674823-13069-10-git-send-email-afaerber@suse.de> In-Reply-To: <1326674823-13069-1-git-send-email-afaerber@suse.de> References: <1326674823-13069-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 09/14] softfloat: Replace int8 type with int_fast8_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori , Stefan Weil , Jan Kiszka , Blue Swirl , Christophe Lyon , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Based on the following Coccinelle patch: @@ typedef int8, int_fast8_t; @@ -int8 +int_fast8_t Add typedef for pre-10 Solaris. Signed-off-by: Andreas F=C3=A4rber Cc: Ben Taylor --- fpu/softfloat-macros.h | 26 +++++++++--------- fpu/softfloat-specialize.h | 2 +- fpu/softfloat.c | 62 ++++++++++++++++++++++----------------= ------ fpu/softfloat.h | 3 +- osdep.h | 1 + 5 files changed, 47 insertions(+), 47 deletions(-) diff --git a/fpu/softfloat-macros.h b/fpu/softfloat-macros.h index b5164af..b82871a 100644 --- a/fpu/softfloat-macros.h +++ b/fpu/softfloat-macros.h @@ -120,7 +120,7 @@ INLINE void uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint= 64_t *z1Ptr) { uint64_t z0, z1; - int8 negCount =3D ( - count ) & 63; + int_fast8_t negCount =3D (-count) & 63; =20 if ( count =3D=3D 0 ) { z1 =3D a1; @@ -157,7 +157,7 @@ INLINE void uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint= 64_t *z1Ptr) { uint64_t z0, z1; - int8 negCount =3D ( - count ) & 63; + int_fast8_t negCount =3D (-count) & 63; =20 if ( count =3D=3D 0 ) { z1 =3D a1; @@ -192,7 +192,7 @@ INLINE void uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint= 64_t *z1Ptr) { uint64_t z0, z1; - int8 negCount =3D ( - count ) & 63; + int_fast8_t negCount =3D (-count) & 63; =20 if ( count =3D=3D 0 ) { z1 =3D a1; @@ -250,7 +250,7 @@ INLINE void ) { uint64_t z0, z1, z2; - int8 negCount =3D ( - count ) & 63; + int_fast8_t negCount =3D (-count) & 63; =20 if ( count =3D=3D 0 ) { z2 =3D a2; @@ -327,7 +327,7 @@ INLINE void ) { uint64_t z0, z1, z2; - int8 negCount; + int_fast8_t negCount; =20 z2 =3D a2<>27 ) & 15; @@ -625,7 +625,7 @@ static uint32_t estimateSqrt32(int_fast16_t aExp, uin= t32_t a) | `a'. If `a' is zero, 32 is returned. *-----------------------------------------------------------------------= -----*/ =20 -static int8 countLeadingZeros32( uint32_t a ) +static int_fast8_t countLeadingZeros32(uint32_t a) { #if SOFTFLOAT_GNUC_PREREQ(3, 4) if (a) { @@ -634,7 +634,7 @@ static int8 countLeadingZeros32( uint32_t a ) return 32; } #else - static const int8 countLeadingZerosHigh[] =3D { + static const int_fast8_t countLeadingZerosHigh[] =3D { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -652,7 +652,7 @@ static int8 countLeadingZeros32( uint32_t a ) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - int8 shiftCount; + int_fast8_t shiftCount; =20 shiftCount =3D 0; if ( a < 0x10000 ) { @@ -673,7 +673,7 @@ static int8 countLeadingZeros32( uint32_t a ) | `a'. If `a' is zero, 64 is returned. *-----------------------------------------------------------------------= -----*/ =20 -static int8 countLeadingZeros64( uint64_t a ) +static int_fast8_t countLeadingZeros64(uint64_t a) { #if SOFTFLOAT_GNUC_PREREQ(3, 4) if (a) { @@ -682,7 +682,7 @@ static int8 countLeadingZeros64( uint64_t a ) return 64; } #else - int8 shiftCount; + int_fast8_t shiftCount; =20 shiftCount =3D 0; if ( a < ( (uint64_t) 1 )<<32 ) { diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index c5e2dab..d57af1a 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -114,7 +114,7 @@ const float128 float128_default_nan =3D make_float128= (float128_default_nan_high, | should be simply `float_exception_flags |=3D flags;'. *-----------------------------------------------------------------------= -----*/ =20 -void float_raise( int8 flags STATUS_PARAM ) +void float_raise(int_fast8_t flags STATUS_PARAM) { STATUS(float_exception_flags) |=3D flags; } diff --git a/fpu/softfloat.c b/fpu/softfloat.c index a406a35..b5fa3ef 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -114,9 +114,9 @@ INLINE flag extractFloat16Sign(float16 a) =20 static int32 roundAndPackInt32( flag zSign, uint64_t absZ STATUS_PARAM) { - int8 roundingMode; + int_fast8_t roundingMode; flag roundNearestEven; - int8 roundIncrement, roundBits; + int_fast8_t roundIncrement, roundBits; int32 z; =20 roundingMode =3D STATUS(float_rounding_mode); @@ -164,7 +164,7 @@ static int32 roundAndPackInt32( flag zSign, uint64_t = absZ STATUS_PARAM) =20 static int64 roundAndPackInt64( flag zSign, uint64_t absZ0, uint64_t abs= Z1 STATUS_PARAM) { - int8 roundingMode; + int_fast8_t roundingMode; flag roundNearestEven, increment; int64 z; =20 @@ -261,7 +261,7 @@ static float32 float32_squash_input_denormal(float32 = a STATUS_PARAM) static void normalizeFloat32Subnormal(uint32_t aSig, int_fast16_t *zExpPtr, uint32_= t *zSigPtr) { - int8 shiftCount; + int_fast8_t shiftCount; =20 shiftCount =3D countLeadingZeros32( aSig ) - 8; *zSigPtr =3D aSig< */ typedef unsigned char uint_fast8_t; typedef unsigned int uint_fast16_t; +typedef signed char int_fast8_t; typedef signed int int_fast16_t; #endif =20 --=20 1.7.7