From patchwork Fri Dec 17 17:31:47 2010 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: 75927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 420BA1007D3 for ; Sat, 18 Dec 2010 04:34:56 +1100 (EST) Received: from localhost ([127.0.0.1]:49021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTeBi-0004Vo-7W for incoming@patchwork.ozlabs.org; Fri, 17 Dec 2010 12:33:50 -0500 Received: from [140.186.70.92] (port=48727 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTeBE-0004Ug-KU for qemu-devel@nongnu.org; Fri, 17 Dec 2010 12:33:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTeBA-0008Jm-Mv for qemu-devel@nongnu.org; Fri, 17 Dec 2010 12:33:20 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:36064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTeB9-0008JC-Ew for qemu-devel@nongnu.org; Fri, 17 Dec 2010 12:33:16 -0500 Received: from smtp04.web.de ( [172.20.0.225]) by fmmailgate02.web.de (Postfix) with ESMTP id C634A18E5A3D7; Fri, 17 Dec 2010 18:33:13 +0100 (CET) Received: from [87.173.96.148] (helo=localhost.localdomain) by smtp04.web.de with asmtp (WEB.DE 4.110 #2) id 1PTeB6-0001Ar-00; Fri, 17 Dec 2010 18:33:12 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Fri, 17 Dec 2010 18:31:47 +0100 Message-Id: <1292607107-17491-1-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.3 MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX1+ZNOnnONra8Vbt8W+lOHUskeRMnjTu9tL6MzmX hZXdt7vA5IPd6eLfY8xWFFfa8YBj3bu8HKj6Bf5ydlhOOMewL6 nJc8Z+5nLLRNkNcBWBZA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Michael Lotz Subject: [Qemu-devel] [PATCH] softfloat: Fix function signature mismatches by using POSIX integer types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Don't reinvent C99 types like uint8_t by typedef'ing uint8 etc. On BeOS and Haiku, system headers {be,os}/support/SupportDefs.h do define [u]int{8,16,32,64}, but they define [u]int32 as long, so assumptions that int32 and int can be used interchangeably must be avoided. Inspired by mmlr's original port to Haiku. Fix stray occurrences of softfloat-internal types outside fpu/. Cc: Michael Lotz Cc: Peter Maydell Signed-off-by: Andreas Färber --- Available for testing from: git://repo.or.cz/qemu/afaerber.git softfloat fpu/softfloat-macros.h | 44 +++--- fpu/softfloat-specialize.h | 2 +- fpu/softfloat.c | 352 ++++++++++++++++++++++---------------------- fpu/softfloat.h | 55 +++----- hw/apic.c | 2 +- hw/wdt_ib700.c | 2 +- target-i386/cpu.h | 8 +- 7 files changed, 226 insertions(+), 239 deletions(-) diff --git a/fpu/softfloat-macros.h b/fpu/softfloat-macros.h index 7838228..d635779 100644 --- a/fpu/softfloat-macros.h +++ b/fpu/softfloat-macros.h @@ -39,7 +39,7 @@ these four paragraphs for those parts of this code that are retained. | The result is stored in the location pointed to by `zPtr'. *----------------------------------------------------------------------------*/ -INLINE void shift32RightJamming( bits32 a, int16 count, bits32 *zPtr ) +INLINE void shift32RightJamming( bits32 a, int16_t count, bits32 *zPtr ) { bits32 z; @@ -65,7 +65,7 @@ INLINE void shift32RightJamming( bits32 a, int16 count, bits32 *zPtr ) | The result is stored in the location pointed to by `zPtr'. *----------------------------------------------------------------------------*/ -INLINE void shift64RightJamming( bits64 a, int16 count, bits64 *zPtr ) +INLINE void shift64RightJamming( bits64 a, int16_t count, bits64 *zPtr ) { bits64 z; @@ -101,10 +101,10 @@ INLINE void shift64RightJamming( bits64 a, int16 count, bits64 *zPtr ) INLINE void shift64ExtraRightJamming( - bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) + bits64 a0, bits64 a1, int16_t count, bits64 *z0Ptr, bits64 *z1Ptr ) { bits64 z0, z1; - int8 negCount = ( - count ) & 63; + int8_t negCount = ( - count ) & 63; if ( count == 0 ) { z1 = a1; @@ -138,10 +138,10 @@ INLINE void INLINE void shift128Right( - bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) + bits64 a0, bits64 a1, int16_t count, bits64 *z0Ptr, bits64 *z1Ptr ) { bits64 z0, z1; - int8 negCount = ( - count ) & 63; + int8_t negCount = ( - count ) & 63; if ( count == 0 ) { z1 = a1; @@ -173,10 +173,10 @@ INLINE void INLINE void shift128RightJamming( - bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) + bits64 a0, bits64 a1, int16_t count, bits64 *z0Ptr, bits64 *z1Ptr ) { bits64 z0, z1; - int8 negCount = ( - count ) & 63; + int8_t negCount = ( - count ) & 63; if ( count == 0 ) { z1 = a1; @@ -227,14 +227,14 @@ INLINE void bits64 a0, bits64 a1, bits64 a2, - int16 count, + int16_t count, bits64 *z0Ptr, bits64 *z1Ptr, bits64 *z2Ptr ) { bits64 z0, z1, z2; - int8 negCount = ( - count ) & 63; + int8_t negCount = ( - count ) & 63; if ( count == 0 ) { z2 = a2; @@ -282,7 +282,7 @@ INLINE void INLINE void shortShift128Left( - bits64 a0, bits64 a1, int16 count, bits64 *z0Ptr, bits64 *z1Ptr ) + bits64 a0, bits64 a1, int16_t count, bits64 *z0Ptr, bits64 *z1Ptr ) { *z1Ptr = a1<>27 ) & 15; @@ -609,9 +609,9 @@ static bits32 estimateSqrt32( int16 aExp, bits32 a ) | `a'. If `a' is zero, 32 is returned. *----------------------------------------------------------------------------*/ -static int8 countLeadingZeros32( bits32 a ) +static int8_t countLeadingZeros32( bits32 a ) { - static const int8 countLeadingZerosHigh[] = { + static const int8_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, @@ -629,7 +629,7 @@ static int8 countLeadingZeros32( bits32 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; + int8_t shiftCount; shiftCount = 0; if ( a < 0x10000 ) { @@ -650,9 +650,9 @@ static int8 countLeadingZeros32( bits32 a ) | `a'. If `a' is zero, 64 is returned. *----------------------------------------------------------------------------*/ -static int8 countLeadingZeros64( bits64 a ) +static int8_t countLeadingZeros64( bits64 a ) { - int8 shiftCount; + int8_t shiftCount; shiftCount = 0; if ( a < ( (bits64) 1 )<<32 ) { diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h index 8e6aceb..f5d3ec2 100644 --- a/fpu/softfloat-specialize.h +++ b/fpu/softfloat-specialize.h @@ -43,7 +43,7 @@ these four paragraphs for those parts of this code that are retained. | should be simply `float_exception_flags |= flags;'. *----------------------------------------------------------------------------*/ -void float_raise( int8 flags STATUS_PARAM ) +void float_raise( int8_t flags STATUS_PARAM ) { STATUS(float_exception_flags) |= flags; } diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 0b82797..9ebc1b2 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -79,12 +79,12 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM) | positive or negative integer is returned. *----------------------------------------------------------------------------*/ -static int32 roundAndPackInt32( flag zSign, bits64 absZ STATUS_PARAM) +static int32_t roundAndPackInt32( flag zSign, bits64 absZ STATUS_PARAM) { - int8 roundingMode; + int8_t roundingMode; flag roundNearestEven; - int8 roundIncrement, roundBits; - int32 z; + int8_t roundIncrement, roundBits; + int32_t z; roundingMode = STATUS(float_rounding_mode); roundNearestEven = ( roundingMode == float_round_nearest_even ); @@ -129,11 +129,11 @@ static int32 roundAndPackInt32( flag zSign, bits64 absZ STATUS_PARAM) | returned. *----------------------------------------------------------------------------*/ -static int64 roundAndPackInt64( flag zSign, bits64 absZ0, bits64 absZ1 STATUS_PARAM) +static int64_t roundAndPackInt64( flag zSign, bits64 absZ0, bits64 absZ1 STATUS_PARAM) { - int8 roundingMode; + int8_t roundingMode; flag roundNearestEven, increment; - int64 z; + int64_t z; roundingMode = STATUS(float_rounding_mode); roundNearestEven = ( roundingMode == float_round_nearest_even ); @@ -185,7 +185,7 @@ INLINE bits32 extractFloat32Frac( float32 a ) | Returns the exponent bits of the single-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -INLINE int16 extractFloat32Exp( float32 a ) +INLINE int16_t extractFloat32Exp( float32 a ) { return ( float32_val(a)>>23 ) & 0xFF; @@ -211,9 +211,9 @@ INLINE flag extractFloat32Sign( float32 a ) *----------------------------------------------------------------------------*/ static void - normalizeFloat32Subnormal( bits32 aSig, int16 *zExpPtr, bits32 *zSigPtr ) + normalizeFloat32Subnormal( bits32 aSig, int16_t *zExpPtr, bits32 *zSigPtr ) { - int8 shiftCount; + int8_t shiftCount; shiftCount = countLeadingZeros32( aSig ) - 8; *zSigPtr = aSig<>52 ) & 0x7FF; @@ -375,9 +375,9 @@ INLINE flag extractFloat64Sign( float64 a ) *----------------------------------------------------------------------------*/ static void - normalizeFloat64Subnormal( bits64 aSig, int16 *zExpPtr, bits64 *zSigPtr ) + normalizeFloat64Subnormal( bits64 aSig, int16_t *zExpPtr, bits64 *zSigPtr ) { - int8 shiftCount; + int8_t shiftCount; shiftCount = countLeadingZeros64( aSig ) - 11; *zSigPtr = aSig<>48 ) & 0x7FFF; @@ -847,12 +847,12 @@ static void normalizeFloat128Subnormal( bits64 aSig0, bits64 aSig1, - int32 *zExpPtr, + int32_t *zExpPtr, bits64 *zSig0Ptr, bits64 *zSig1Ptr ) { - int8 shiftCount; + int8_t shiftCount; if ( aSig0 == 0 ) { shiftCount = countLeadingZeros64( aSig1 ) - 15; @@ -888,7 +888,7 @@ static void *----------------------------------------------------------------------------*/ INLINE float128 - packFloat128( flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 ) + packFloat128( flag zSign, int32_t zExp, bits64 zSig0, bits64 zSig1 ) { float128 z; @@ -921,9 +921,9 @@ INLINE float128 static float128 roundAndPackFloat128( - flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1, bits64 zSig2 STATUS_PARAM) + flag zSign, int32_t zExp, bits64 zSig0, bits64 zSig1, bits64 zSig2 STATUS_PARAM) { - int8 roundingMode; + int8_t roundingMode; flag roundNearestEven, increment, isTiny; roundingMode = STATUS(float_rounding_mode); @@ -1022,9 +1022,9 @@ static float128 static float128 normalizeRoundAndPackFloat128( - flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 STATUS_PARAM) + flag zSign, int32_t zExp, bits64 zSig0, bits64 zSig1 STATUS_PARAM) { - int8 shiftCount; + int8_t shiftCount; bits64 zSig2; if ( zSig0 == 0 ) { @@ -1054,7 +1054,7 @@ static float128 | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -float32 int32_to_float32( int32 a STATUS_PARAM ) +float32 int32_to_float32( int32_t a STATUS_PARAM ) { flag zSign; @@ -1071,11 +1071,11 @@ float32 int32_to_float32( int32 a STATUS_PARAM ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -float64 int32_to_float64( int32 a STATUS_PARAM ) +float64 int32_to_float64( int32_t a STATUS_PARAM ) { flag zSign; - uint32 absA; - int8 shiftCount; + uint32_t absA; + int8_t shiftCount; bits64 zSig; if ( a == 0 ) return float64_zero; @@ -1096,11 +1096,11 @@ float64 int32_to_float64( int32 a STATUS_PARAM ) | Arithmetic. *----------------------------------------------------------------------------*/ -floatx80 int32_to_floatx80( int32 a STATUS_PARAM ) +floatx80 int32_to_floatx80( int32_t a STATUS_PARAM ) { flag zSign; - uint32 absA; - int8 shiftCount; + uint32_t absA; + int8_t shiftCount; bits64 zSig; if ( a == 0 ) return packFloatx80( 0, 0, 0 ); @@ -1122,11 +1122,11 @@ floatx80 int32_to_floatx80( int32 a STATUS_PARAM ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -float128 int32_to_float128( int32 a STATUS_PARAM ) +float128 int32_to_float128( int32_t a STATUS_PARAM ) { flag zSign; - uint32 absA; - int8 shiftCount; + uint32_t absA; + int8_t shiftCount; bits64 zSig0; if ( a == 0 ) return packFloat128( 0, 0, 0, 0 ); @@ -1146,11 +1146,11 @@ float128 int32_to_float128( int32 a STATUS_PARAM ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -float32 int64_to_float32( int64 a STATUS_PARAM ) +float32 int64_to_float32( int64_t a STATUS_PARAM ) { flag zSign; - uint64 absA; - int8 shiftCount; + uint64_t absA; + int8_t shiftCount; if ( a == 0 ) return float32_zero; zSign = ( a < 0 ); @@ -1172,9 +1172,9 @@ float32 int64_to_float32( int64 a STATUS_PARAM ) } -float32 uint64_to_float32( uint64 a STATUS_PARAM ) +float32 uint64_to_float32( uint64_t a STATUS_PARAM ) { - int8 shiftCount; + int8_t shiftCount; if ( a == 0 ) return float32_zero; shiftCount = countLeadingZeros64( a ) - 40; @@ -1199,7 +1199,7 @@ float32 uint64_to_float32( uint64 a STATUS_PARAM ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -float64 int64_to_float64( int64 a STATUS_PARAM ) +float64 int64_to_float64( int64_t a STATUS_PARAM ) { flag zSign; @@ -1212,7 +1212,7 @@ float64 int64_to_float64( int64 a STATUS_PARAM ) } -float64 uint64_to_float64( uint64 a STATUS_PARAM ) +float64 uint64_to_float64( uint64_t a STATUS_PARAM ) { if ( a == 0 ) return float64_zero; return normalizeRoundAndPackFloat64( 0, 0x43C, a STATUS_VAR ); @@ -1228,11 +1228,11 @@ float64 uint64_to_float64( uint64 a STATUS_PARAM ) | Arithmetic. *----------------------------------------------------------------------------*/ -floatx80 int64_to_floatx80( int64 a STATUS_PARAM ) +floatx80 int64_to_floatx80( int64_t a STATUS_PARAM ) { flag zSign; - uint64 absA; - int8 shiftCount; + uint64_t absA; + int8_t shiftCount; if ( a == 0 ) return packFloatx80( 0, 0, 0 ); zSign = ( a < 0 ); @@ -1252,12 +1252,12 @@ floatx80 int64_to_floatx80( int64 a STATUS_PARAM ) | according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -float128 int64_to_float128( int64 a STATUS_PARAM ) +float128 int64_to_float128( int64_t a STATUS_PARAM ) { flag zSign; - uint64 absA; - int8 shiftCount; - int32 zExp; + uint64_t absA; + int8_t shiftCount; + int32_t zExp; bits64 zSig0, zSig1; if ( a == 0 ) return packFloat128( 0, 0, 0, 0 ); @@ -1291,10 +1291,10 @@ float128 int64_to_float128( int64 a STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int32 float32_to_int32( float32 a STATUS_PARAM ) +int32_t float32_to_int32( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits32 aSig; bits64 aSig64; @@ -1321,12 +1321,12 @@ int32 float32_to_int32( float32 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int32 float32_to_int32_round_to_zero( float32 a STATUS_PARAM ) +int32_t float32_to_int32_round_to_zero( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits32 aSig; - int32 z; + int32_t z; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); @@ -1363,10 +1363,10 @@ int32 float32_to_int32_round_to_zero( float32 a STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 float32_to_int64( float32 a STATUS_PARAM ) +int64_t float32_to_int64( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits32 aSig; bits64 aSig64, aSigExtra; @@ -1399,13 +1399,13 @@ int64 float32_to_int64( float32 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int64 float32_to_int64_round_to_zero( float32 a STATUS_PARAM ) +int64_t float32_to_int64_round_to_zero( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits32 aSig; bits64 aSig64; - int64 z; + int64_t z; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); @@ -1445,7 +1445,7 @@ int64 float32_to_int64_round_to_zero( float32 a STATUS_PARAM ) float64 float32_to_float64( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits32 aSig; aSig = extractFloat32Frac( a ); @@ -1476,7 +1476,7 @@ float64 float32_to_float64( float32 a STATUS_PARAM ) floatx80 float32_to_floatx80( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits32 aSig; aSig = extractFloat32Frac( a ); @@ -1509,7 +1509,7 @@ floatx80 float32_to_floatx80( float32 a STATUS_PARAM ) float128 float32_to_float128( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits32 aSig; aSig = extractFloat32Frac( a ); @@ -1540,9 +1540,9 @@ float128 float32_to_float128( float32 a STATUS_PARAM ) float32 float32_round_to_int( float32 a STATUS_PARAM) { flag aSign; - int16 aExp; + int16_t aExp; bits32 lastBitMask, roundBitsMask; - int8 roundingMode; + int8_t roundingMode; bits32 z; aExp = extractFloat32Exp( a ); @@ -1599,9 +1599,9 @@ float32 float32_round_to_int( float32 a STATUS_PARAM) static float32 addFloat32Sigs( float32 a, float32 b, flag zSign STATUS_PARAM) { - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits32 aSig, bSig, zSig; - int16 expDiff; + int16_t expDiff; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); @@ -1673,9 +1673,9 @@ static float32 addFloat32Sigs( float32 a, float32 b, flag zSign STATUS_PARAM) static float32 subFloat32Sigs( float32 a, float32 b, flag zSign STATUS_PARAM) { - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits32 aSig, bSig, zSig; - int16 expDiff; + int16_t expDiff; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); @@ -1789,7 +1789,7 @@ float32 float32_sub( float32 a, float32 b STATUS_PARAM ) float32 float32_mul( float32 a, float32 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits32 aSig, bSig; bits64 zSig64; bits32 zSig; @@ -1849,7 +1849,7 @@ float32 float32_mul( float32 a, float32 b STATUS_PARAM ) float32 float32_div( float32 a, float32 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits32 aSig, bSig, zSig; aSig = extractFloat32Frac( a ); @@ -1911,7 +1911,7 @@ float32 float32_div( float32 a, float32 b STATUS_PARAM ) float32 float32_rem( float32 a, float32 b STATUS_PARAM ) { flag aSign, zSign; - int16 aExp, bExp, expDiff; + int16_t aExp, bExp, expDiff; bits32 aSig, bSig; bits32 q; bits64 aSig64, bSig64, q64; @@ -2010,7 +2010,7 @@ float32 float32_rem( float32 a, float32 b STATUS_PARAM ) float32 float32_sqrt( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, zExp; + int16_t aExp, zExp; bits32 aSig, zSig; bits64 rem, term; @@ -2095,7 +2095,7 @@ static const float64 float32_exp2_coefficients[15] = float32 float32_exp2( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits32 aSig; float64 r, x, xn; int i; @@ -2142,7 +2142,7 @@ float32 float32_exp2( float32 a STATUS_PARAM ) float32 float32_log2( float32 a STATUS_PARAM ) { flag aSign, zSign; - int16 aExp; + int16_t aExp; bits32 aSig, zSig, i; aSig = extractFloat32Frac( a ); @@ -2347,10 +2347,10 @@ int float32_lt_quiet( float32 a, float32 b STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int32 float64_to_int32( float64 a STATUS_PARAM ) +int32_t float64_to_int32( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits64 aSig; aSig = extractFloat64Frac( a ); @@ -2374,12 +2374,12 @@ int32 float64_to_int32( float64 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int32 float64_to_int32_round_to_zero( float64 a STATUS_PARAM ) +int32_t float64_to_int32_round_to_zero( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits64 aSig, savedASig; - int32 z; + int32_t z; aSig = extractFloat64Frac( a ); aExp = extractFloat64Exp( a ); @@ -2420,10 +2420,10 @@ int32 float64_to_int32_round_to_zero( float64 a STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 float64_to_int64( float64 a STATUS_PARAM ) +int64_t float64_to_int64( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits64 aSig, aSigExtra; aSig = extractFloat64Frac( a ); @@ -2462,12 +2462,12 @@ int64 float64_to_int64( float64 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int64 float64_to_int64_round_to_zero( float64 a STATUS_PARAM ) +int64_t float64_to_int64_round_to_zero( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int16_t aExp, shiftCount; bits64 aSig; - int64 z; + int64_t z; aSig = extractFloat64Frac( a ); aExp = extractFloat64Exp( a ); @@ -2514,7 +2514,7 @@ int64 float64_to_int64_round_to_zero( float64 a STATUS_PARAM ) float32 float64_to_float32( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits64 aSig; bits32 zSig; @@ -2546,7 +2546,7 @@ float32 float64_to_float32( float64 a STATUS_PARAM ) | than the desired result exponent whenever `zSig' is a complete, normalized | significand. *----------------------------------------------------------------------------*/ -static bits16 packFloat16(flag zSign, int16 zExp, bits16 zSig) +static bits16 packFloat16(flag zSign, int16_t zExp, bits16 zSig) { return (((bits32)zSign) << 15) + (((bits32)zExp) << 10) + zSig; } @@ -2557,7 +2557,7 @@ static bits16 packFloat16(flag zSign, int16 zExp, bits16 zSig) float32 float16_to_float32( bits16 a, flag ieee STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits32 aSig; aSign = a >> 15; @@ -2573,7 +2573,7 @@ float32 float16_to_float32( bits16 a, flag ieee STATUS_PARAM ) return packFloat32(aSign, 0xff, aSig << 13); } if (aExp == 0) { - int8 shiftCount; + int8_t shiftCount; if (aSig == 0) { return packFloat32(aSign, 0, 0); @@ -2589,11 +2589,11 @@ float32 float16_to_float32( bits16 a, flag ieee STATUS_PARAM ) bits16 float32_to_float16( float32 a, flag ieee STATUS_PARAM) { flag aSign; - int16 aExp; + int16_t aExp; bits32 aSig; bits32 mask; bits32 increment; - int8 roundingMode; + int8_t roundingMode; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); @@ -2685,7 +2685,7 @@ bits16 float32_to_float16( float32 a, flag ieee STATUS_PARAM) floatx80 float64_to_floatx80( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits64 aSig; aSig = extractFloat64Frac( a ); @@ -2719,7 +2719,7 @@ floatx80 float64_to_floatx80( float64 a STATUS_PARAM ) float128 float64_to_float128( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits64 aSig, zSig0, zSig1; aSig = extractFloat64Frac( a ); @@ -2751,9 +2751,9 @@ float128 float64_to_float128( float64 a STATUS_PARAM ) float64 float64_round_to_int( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits64 lastBitMask, roundBitsMask; - int8 roundingMode; + int8_t roundingMode; bits64 z; aExp = extractFloat64Exp( a ); @@ -2823,9 +2823,9 @@ float64 float64_trunc_to_int( float64 a STATUS_PARAM) static float64 addFloat64Sigs( float64 a, float64 b, flag zSign STATUS_PARAM ) { - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits64 aSig, bSig, zSig; - int16 expDiff; + int16_t expDiff; aSig = extractFloat64Frac( a ); aExp = extractFloat64Exp( a ); @@ -2897,9 +2897,9 @@ static float64 addFloat64Sigs( float64 a, float64 b, flag zSign STATUS_PARAM ) static float64 subFloat64Sigs( float64 a, float64 b, flag zSign STATUS_PARAM ) { - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits64 aSig, bSig, zSig; - int16 expDiff; + int16_t expDiff; aSig = extractFloat64Frac( a ); aExp = extractFloat64Exp( a ); @@ -3013,7 +3013,7 @@ float64 float64_sub( float64 a, float64 b STATUS_PARAM ) float64 float64_mul( float64 a, float64 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits64 aSig, bSig, zSig0, zSig1; aSig = extractFloat64Frac( a ); @@ -3071,7 +3071,7 @@ float64 float64_mul( float64 a, float64 b STATUS_PARAM ) float64 float64_div( float64 a, float64 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int16 aExp, bExp, zExp; + int16_t aExp, bExp, zExp; bits64 aSig, bSig, zSig; bits64 rem0, rem1; bits64 term0, term1; @@ -3141,7 +3141,7 @@ float64 float64_div( float64 a, float64 b STATUS_PARAM ) float64 float64_rem( float64 a, float64 b STATUS_PARAM ) { flag aSign, zSign; - int16 aExp, bExp, expDiff; + int16_t aExp, bExp, expDiff; bits64 aSig, bSig; bits64 q, alternateASig; sbits64 sigMean; @@ -3225,7 +3225,7 @@ float64 float64_rem( float64 a, float64 b STATUS_PARAM ) float64 float64_sqrt( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, zExp; + int16_t aExp, zExp; bits64 aSig, zSig, doubleZSig; bits64 rem0, rem1, term0, term1; @@ -3275,7 +3275,7 @@ float64 float64_sqrt( float64 a STATUS_PARAM ) float64 float64_log2( float64 a STATUS_PARAM ) { flag aSign, zSign; - int16 aExp; + int16_t aExp; bits64 aSig, aSig0, aSig1, zSig, i; aSig = extractFloat64Frac( a ); @@ -3483,10 +3483,10 @@ int float64_lt_quiet( float64 a, float64 b STATUS_PARAM ) | overflows, the largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int32 floatx80_to_int32( floatx80 a STATUS_PARAM ) +int32_t floatx80_to_int32( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig; aSig = extractFloatx80Frac( a ); @@ -3510,12 +3510,12 @@ int32 floatx80_to_int32( floatx80 a STATUS_PARAM ) | sign as `a' is returned. *----------------------------------------------------------------------------*/ -int32 floatx80_to_int32_round_to_zero( floatx80 a STATUS_PARAM ) +int32_t floatx80_to_int32_round_to_zero( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig, savedASig; - int32 z; + int32_t z; aSig = extractFloatx80Frac( a ); aExp = extractFloatx80Exp( a ); @@ -3555,10 +3555,10 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a STATUS_PARAM ) | overflows, the largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 floatx80_to_int64( floatx80 a STATUS_PARAM ) +int64_t floatx80_to_int64( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig, aSigExtra; aSig = extractFloatx80Frac( a ); @@ -3595,12 +3595,12 @@ int64 floatx80_to_int64( floatx80 a STATUS_PARAM ) | sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 floatx80_to_int64_round_to_zero( floatx80 a STATUS_PARAM ) +int64_t floatx80_to_int64_round_to_zero( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig; - int64 z; + int64_t z; aSig = extractFloatx80Frac( a ); aExp = extractFloatx80Exp( a ); @@ -3639,7 +3639,7 @@ int64 floatx80_to_int64_round_to_zero( floatx80 a STATUS_PARAM ) float32 floatx80_to_float32( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 aSig; aSig = extractFloatx80Frac( a ); @@ -3667,7 +3667,7 @@ float32 floatx80_to_float32( floatx80 a STATUS_PARAM ) float64 floatx80_to_float64( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 aSig, zSig; aSig = extractFloatx80Frac( a ); @@ -3697,7 +3697,7 @@ float64 floatx80_to_float64( floatx80 a STATUS_PARAM ) float128 floatx80_to_float128( floatx80 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits64 aSig, zSig0, zSig1; aSig = extractFloatx80Frac( a ); @@ -3723,9 +3723,9 @@ float128 floatx80_to_float128( floatx80 a STATUS_PARAM ) floatx80 floatx80_round_to_int( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 lastBitMask, roundBitsMask; - int8 roundingMode; + int8_t roundingMode; floatx80 z; aExp = extractFloatx80Exp( a ); @@ -3796,9 +3796,9 @@ floatx80 floatx80_round_to_int( floatx80 a STATUS_PARAM ) static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign STATUS_PARAM) { - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig, bSig, zSig0, zSig1; - int32 expDiff; + int32_t expDiff; aSig = extractFloatx80Frac( a ); aExp = extractFloatx80Exp( a ); @@ -3862,9 +3862,9 @@ static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign STATUS_PARAM static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign STATUS_PARAM ) { - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig, bSig, zSig0, zSig1; - int32 expDiff; + int32_t expDiff; floatx80 z; aSig = extractFloatx80Frac( a ); @@ -3971,7 +3971,7 @@ floatx80 floatx80_sub( floatx80 a, floatx80 b STATUS_PARAM ) floatx80 floatx80_mul( floatx80 a, floatx80 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig, bSig, zSig0, zSig1; floatx80 z; @@ -4030,7 +4030,7 @@ floatx80 floatx80_mul( floatx80 a, floatx80 b STATUS_PARAM ) floatx80 floatx80_div( floatx80 a, floatx80 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig, bSig, zSig0, zSig1; bits64 rem0, rem1, rem2, term0, term1, term2; floatx80 z; @@ -4110,7 +4110,7 @@ floatx80 floatx80_div( floatx80 a, floatx80 b STATUS_PARAM ) floatx80 floatx80_rem( floatx80 a, floatx80 b STATUS_PARAM ) { flag aSign, zSign; - int32 aExp, bExp, expDiff; + int32_t aExp, bExp, expDiff; bits64 aSig0, aSig1, bSig; bits64 q, term0, term1, alternateASig0, alternateASig1; floatx80 z; @@ -4206,7 +4206,7 @@ floatx80 floatx80_rem( floatx80 a, floatx80 b STATUS_PARAM ) floatx80 floatx80_sqrt( floatx80 a STATUS_PARAM ) { flag aSign; - int32 aExp, zExp; + int32_t aExp, zExp; bits64 aSig0, aSig1, zSig0, zSig1, doubleZSig0; bits64 rem0, rem1, rem2, rem3, term0, term1, term2, term3; floatx80 z; @@ -4476,10 +4476,10 @@ int floatx80_lt_quiet( floatx80 a, floatx80 b STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int32 float128_to_int32( float128 a STATUS_PARAM ) +int32_t float128_to_int32( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig0, aSig1; aSig1 = extractFloat128Frac1( a ); @@ -4505,12 +4505,12 @@ int32 float128_to_int32( float128 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int32 float128_to_int32_round_to_zero( float128 a STATUS_PARAM ) +int32_t float128_to_int32_round_to_zero( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig0, aSig1, savedASig; - int32 z; + int32_t z; aSig1 = extractFloat128Frac1( a ); aSig0 = extractFloat128Frac0( a ); @@ -4553,10 +4553,10 @@ int32 float128_to_int32_round_to_zero( float128 a STATUS_PARAM ) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 float128_to_int64( float128 a STATUS_PARAM ) +int64_t float128_to_int64( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig0, aSig1; aSig1 = extractFloat128Frac1( a ); @@ -4596,12 +4596,12 @@ int64 float128_to_int64( float128 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int64 float128_to_int64_round_to_zero( float128 a STATUS_PARAM ) +int64_t float128_to_int64_round_to_zero( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp, shiftCount; + int32_t aExp, shiftCount; bits64 aSig0, aSig1; - int64 z; + int64_t z; aSig1 = extractFloat128Frac1( a ); aSig0 = extractFloat128Frac0( a ); @@ -4657,7 +4657,7 @@ int64 float128_to_int64_round_to_zero( float128 a STATUS_PARAM ) float32 float128_to_float32( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 aSig0, aSig1; bits32 zSig; @@ -4692,7 +4692,7 @@ float32 float128_to_float32( float128 a STATUS_PARAM ) float64 float128_to_float64( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 aSig0, aSig1; aSig1 = extractFloat128Frac1( a ); @@ -4727,7 +4727,7 @@ float64 float128_to_float64( float128 a STATUS_PARAM ) floatx80 float128_to_floatx80( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 aSig0, aSig1; aSig1 = extractFloat128Frac1( a ); @@ -4764,9 +4764,9 @@ floatx80 float128_to_floatx80( float128 a STATUS_PARAM ) float128 float128_round_to_int( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 lastBitMask, roundBitsMask; - int8 roundingMode; + int8_t roundingMode; float128 z; aExp = extractFloat128Exp( a ); @@ -4867,9 +4867,9 @@ float128 float128_round_to_int( float128 a STATUS_PARAM ) static float128 addFloat128Sigs( float128 a, float128 b, flag zSign STATUS_PARAM) { - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2; - int32 expDiff; + int32_t expDiff; aSig1 = extractFloat128Frac1( a ); aSig0 = extractFloat128Frac0( a ); @@ -4948,9 +4948,9 @@ static float128 addFloat128Sigs( float128 a, float128 b, flag zSign STATUS_PARAM static float128 subFloat128Sigs( float128 a, float128 b, flag zSign STATUS_PARAM) { - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1; - int32 expDiff; + int32_t expDiff; float128 z; aSig1 = extractFloat128Frac1( a ); @@ -5073,7 +5073,7 @@ float128 float128_sub( float128 a, float128 b STATUS_PARAM ) float128 float128_mul( float128 a, float128 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2, zSig3; float128 z; @@ -5137,7 +5137,7 @@ float128 float128_mul( float128 a, float128 b STATUS_PARAM ) float128 float128_div( float128 a, float128 b STATUS_PARAM ) { flag aSign, bSign, zSign; - int32 aExp, bExp, zExp; + int32_t aExp, bExp, zExp; bits64 aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2; bits64 rem0, rem1, rem2, rem3, term0, term1, term2, term3; float128 z; @@ -5221,7 +5221,7 @@ float128 float128_div( float128 a, float128 b STATUS_PARAM ) float128 float128_rem( float128 a, float128 b STATUS_PARAM ) { flag aSign, zSign; - int32 aExp, bExp, expDiff; + int32_t aExp, bExp, expDiff; bits64 aSig0, aSig1, bSig0, bSig1, q, term0, term1, term2; bits64 allZero, alternateASig0, alternateASig1, sigMean1; sbits64 sigMean0; @@ -5330,7 +5330,7 @@ float128 float128_rem( float128 a, float128 b STATUS_PARAM ) float128 float128_sqrt( float128 a STATUS_PARAM ) { flag aSign; - int32 aExp, zExp; + int32_t aExp, zExp; bits64 aSig0, aSig1, zSig0, zSig1, zSig2, doubleZSig0; bits64 rem0, rem1, rem2, rem3, term0, term1, term2, term3; float128 z; @@ -5586,17 +5586,17 @@ int float128_lt_quiet( float128 a, float128 b STATUS_PARAM ) #endif /* misc functions */ -float32 uint32_to_float32( unsigned int a STATUS_PARAM ) +float32 uint32_to_float32( uint32_t a STATUS_PARAM ) { return int64_to_float32(a STATUS_VAR); } -float64 uint32_to_float64( unsigned int a STATUS_PARAM ) +float64 uint32_to_float64( uint32_t a STATUS_PARAM ) { return int64_to_float64(a STATUS_VAR); } -unsigned int float32_to_uint32( float32 a STATUS_PARAM ) +uint32_t float32_to_uint32( float32 a STATUS_PARAM ) { int64_t v; unsigned int res; @@ -5614,7 +5614,7 @@ unsigned int float32_to_uint32( float32 a STATUS_PARAM ) return res; } -unsigned int float32_to_uint32_round_to_zero( float32 a STATUS_PARAM ) +uint32_t float32_to_uint32_round_to_zero( float32 a STATUS_PARAM ) { int64_t v; unsigned int res; @@ -5632,7 +5632,7 @@ unsigned int float32_to_uint32_round_to_zero( float32 a STATUS_PARAM ) return res; } -unsigned int float64_to_uint32( float64 a STATUS_PARAM ) +uint32_t float64_to_uint32( float64 a STATUS_PARAM ) { int64_t v; unsigned int res; @@ -5650,7 +5650,7 @@ unsigned int float64_to_uint32( float64 a STATUS_PARAM ) return res; } -unsigned int float64_to_uint32_round_to_zero( float64 a STATUS_PARAM ) +uint32_t float64_to_uint32_round_to_zero( float64 a STATUS_PARAM ) { int64_t v; unsigned int res; @@ -5790,7 +5790,7 @@ int float128_compare_quiet( float128 a, float128 b STATUS_PARAM ) float32 float32_scalbn( float32 a, int n STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits32 aSig; aSig = extractFloat32Frac( a ); @@ -5813,7 +5813,7 @@ float32 float32_scalbn( float32 a, int n STATUS_PARAM ) float64 float64_scalbn( float64 a, int n STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits64 aSig; aSig = extractFloat64Frac( a ); @@ -5837,7 +5837,7 @@ float64 float64_scalbn( float64 a, int n STATUS_PARAM ) floatx80 floatx80_scalbn( floatx80 a, int n STATUS_PARAM ) { flag aSign; - int16 aExp; + int16_t aExp; bits64 aSig; aSig = extractFloatx80Frac( a ); @@ -5860,7 +5860,7 @@ floatx80 floatx80_scalbn( floatx80 a, int n STATUS_PARAM ) float128 float128_scalbn( float128 a, int n STATUS_PARAM ) { flag aSign; - int32 aExp; + int32_t aExp; bits64 aSig0, aSig1; aSig1 = extractFloat128Frac1( a ); diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 9528825..8f0dfbd 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -41,23 +41,10 @@ these four paragraphs for those parts of this code that are retained. /*---------------------------------------------------------------------------- | Each of the following `typedef's defines the most convenient type that holds -| integers of at least as many bits as specified. For example, `uint8' should -| be the most convenient type that can hold unsigned integers of as many as -| 8 bits. The `flag' type must be able to hold either a 0 or 1. For most -| implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed -| to the same as `int'. +| integers of at least as many bits as specified. +| The `flag' type must be able to hold either a 0 or 1. *----------------------------------------------------------------------------*/ typedef uint8_t flag; -typedef uint8_t uint8; -typedef int8_t int8; -#ifndef _AIX -typedef int uint16; -typedef int int16; -#endif -typedef unsigned int uint32; -typedef signed int int32; -typedef uint64_t uint64; -typedef int64_t int64; /*---------------------------------------------------------------------------- | Each of the following `typedef's defines a type that holds integers @@ -216,20 +203,20 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM); | Routine to raise any or all of the software IEC/IEEE floating-point | exception flags. *----------------------------------------------------------------------------*/ -void float_raise( int8 flags STATUS_PARAM); +void float_raise( int8_t flags STATUS_PARAM); /*---------------------------------------------------------------------------- | Software IEC/IEEE integer-to-floating-point conversion routines. *----------------------------------------------------------------------------*/ -float32 int32_to_float32( int STATUS_PARAM ); -float64 int32_to_float64( int STATUS_PARAM ); -float32 uint32_to_float32( unsigned int STATUS_PARAM ); -float64 uint32_to_float64( unsigned int STATUS_PARAM ); +float32 int32_to_float32( int32_t STATUS_PARAM ); +float64 int32_to_float64( int32_t STATUS_PARAM ); +float32 uint32_to_float32( uint32_t STATUS_PARAM ); +float64 uint32_to_float64( uint32_t STATUS_PARAM ); #ifdef FLOATX80 -floatx80 int32_to_floatx80( int STATUS_PARAM ); +floatx80 int32_to_floatx80( int32_t STATUS_PARAM ); #endif #ifdef FLOAT128 -float128 int32_to_float128( int STATUS_PARAM ); +float128 int32_to_float128( int32_t STATUS_PARAM ); #endif float32 int64_to_float32( int64_t STATUS_PARAM ); float32 uint64_to_float32( uint64_t STATUS_PARAM ); @@ -251,10 +238,10 @@ float32 float16_to_float32( bits16, flag 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 STATUS_PARAM ); -unsigned int float32_to_uint32_round_to_zero( float32 STATUS_PARAM ); +int32_t float32_to_int32( float32 STATUS_PARAM ); +int32_t float32_to_int32_round_to_zero( float32 STATUS_PARAM ); +uint32_t float32_to_uint32( float32 STATUS_PARAM ); +uint32_t float32_to_uint32_round_to_zero( float32 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 ); @@ -321,10 +308,10 @@ INLINE int float32_is_zero(float32 a) /*---------------------------------------------------------------------------- | 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 ); +int32_t float64_to_int32( float64 STATUS_PARAM ); +int32_t float64_to_int32_round_to_zero( float64 STATUS_PARAM ); +uint32_t float64_to_uint32( float64 STATUS_PARAM ); +uint32_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 a STATUS_PARAM); @@ -395,8 +382,8 @@ INLINE int float64_is_zero(float64 a) /*---------------------------------------------------------------------------- | 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 ); +int32_t floatx80_to_int32( floatx80 STATUS_PARAM ); +int32_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 ); @@ -459,8 +446,8 @@ INLINE int floatx80_is_zero(floatx80 a) /*---------------------------------------------------------------------------- | Software IEC/IEEE quadruple-precision conversion routines. *----------------------------------------------------------------------------*/ -int float128_to_int32( float128 STATUS_PARAM ); -int float128_to_int32_round_to_zero( float128 STATUS_PARAM ); +int32_t float128_to_int32( float128 STATUS_PARAM ); +int32_t float128_to_int32_round_to_zero( float128 STATUS_PARAM ); int64_t float128_to_int64( float128 STATUS_PARAM ); int64_t float128_to_int64_round_to_zero( float128 STATUS_PARAM ); float32 float128_to_float32( float128 STATUS_PARAM ); diff --git a/hw/apic.c b/hw/apic.c index a5a53fb..ff581f0 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -765,7 +765,7 @@ static uint32_t apic_mem_readl(void *opaque, target_phys_addr_t addr) return val; } -static void apic_send_msi(target_phys_addr_t addr, uint32 data) +static void apic_send_msi(target_phys_addr_t addr, uint32_t data) { uint8_t dest = (addr & MSI_ADDR_DEST_ID_MASK) >> MSI_ADDR_DEST_ID_SHIFT; uint8_t vector = (data & MSI_DATA_VECTOR_MASK) >> MSI_DATA_VECTOR_SHIFT; diff --git a/hw/wdt_ib700.c b/hw/wdt_ib700.c index b6235eb..1248464 100644 --- a/hw/wdt_ib700.c +++ b/hw/wdt_ib700.c @@ -53,7 +53,7 @@ static void ib700_write_enable_reg(void *vp, uint32_t addr, uint32_t data) 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0 }; - int64 timeout; + int64_t timeout; ib700_debug("addr = %x, data = %x\n", addr, data); diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 06e40f3..f0c07cd 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -737,10 +737,10 @@ typedef struct CPUX86State { user */ struct DeviceState *apic_state; - uint64 mcg_cap; - uint64 mcg_status; - uint64 mcg_ctl; - uint64 mce_banks[MCE_BANKS_DEF*4]; + uint64_t mcg_cap; + uint64_t mcg_status; + uint64_t mcg_ctl; + uint64_t mce_banks[MCE_BANKS_DEF*4]; uint64_t tsc_aux;