From patchwork Mon Jan 16 00:46:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 136221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 59508B6EEC for ; Mon, 16 Jan 2012 12:13:24 +1100 (EST) Received: from localhost ([::1]:45305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmamM-0003vC-0q for incoming@patchwork.ozlabs.org; Sun, 15 Jan 2012 19:50:30 -0500 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 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 648EF9043F; Mon, 16 Jan 2012 01:49:12 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Mon, 16 Jan 2012 01:46:58 +0100 Message-Id: <1326674823-13069-10-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Peter Maydell , Anthony Liguori , Stefan Weil , Jan Kiszka , Blue Swirl , Christophe Lyon , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Aurelien Jarno Subject: [Qemu-devel] [PATCH 09/14] softfloat: Replace int8 type with int_fast8_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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ärber 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, uint64_t *z1Ptr) { uint64_t z0, z1; - int8 negCount = ( - count ) & 63; + int_fast8_t negCount = (-count) & 63; if ( count == 0 ) { z1 = a1; @@ -157,7 +157,7 @@ INLINE void uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr) { uint64_t z0, z1; - int8 negCount = ( - count ) & 63; + int_fast8_t negCount = (-count) & 63; if ( count == 0 ) { z1 = a1; @@ -192,7 +192,7 @@ INLINE void uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr) { uint64_t z0, z1; - int8 negCount = ( - count ) & 63; + int_fast8_t negCount = (-count) & 63; if ( count == 0 ) { z1 = a1; @@ -250,7 +250,7 @@ INLINE void ) { uint64_t z0, z1, z2; - int8 negCount = ( - count ) & 63; + int_fast8_t negCount = (-count) & 63; if ( count == 0 ) { z2 = a2; @@ -327,7 +327,7 @@ INLINE void ) { uint64_t z0, z1, z2; - int8 negCount; + int_fast8_t negCount; z2 = a2<>27 ) & 15; @@ -625,7 +625,7 @@ static uint32_t estimateSqrt32(int_fast16_t aExp, uint32_t a) | `a'. If `a' is zero, 32 is returned. *----------------------------------------------------------------------------*/ -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[] = { + static const int_fast8_t countLeadingZerosHigh[] = { 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; shiftCount = 0; if ( a < 0x10000 ) { @@ -673,7 +673,7 @@ static int8 countLeadingZeros32( uint32_t a ) | `a'. If `a' is zero, 64 is returned. *----------------------------------------------------------------------------*/ -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; shiftCount = 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 = make_float128(float128_default_nan_high, | should be simply `float_exception_flags |= flags;'. *----------------------------------------------------------------------------*/ -void float_raise( int8 flags STATUS_PARAM ) +void float_raise(int_fast8_t flags STATUS_PARAM) { STATUS(float_exception_flags) |= 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) 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; roundingMode = STATUS(float_rounding_mode); @@ -164,7 +164,7 @@ static int32 roundAndPackInt32( flag zSign, uint64_t absZ STATUS_PARAM) static int64 roundAndPackInt64( flag zSign, uint64_t absZ0, uint64_t absZ1 STATUS_PARAM) { - int8 roundingMode; + int_fast8_t roundingMode; flag roundNearestEven, increment; int64 z; @@ -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; shiftCount = countLeadingZeros32( aSig ) - 8; *zSigPtr = 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