From patchwork Tue Jan 4 19:39:10 2011 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: 77524 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]) by ozlabs.org (Postfix) with ESMTP id 02C05B70FF for ; Wed, 5 Jan 2011 06:50:29 +1100 (EST) Received: from localhost ([127.0.0.1]:57085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaCoe-0003z2-67 for incoming@patchwork.ozlabs.org; Tue, 04 Jan 2011 14:45:08 -0500 Received: from [140.186.70.92] (port=59907 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaCj2-0001HS-Q7 for qemu-devel@nongnu.org; Tue, 04 Jan 2011 14:39:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaCj0-0004nr-Ho for qemu-devel@nongnu.org; Tue, 04 Jan 2011 14:39:20 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:55445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaCiz-0004nb-MF for qemu-devel@nongnu.org; Tue, 04 Jan 2011 14:39:18 -0500 Received: from smtp01.web.de ( [172.20.0.243]) by fmmailgate02.web.de (Postfix) with ESMTP id 896B1192E8102; Tue, 4 Jan 2011 20:39:16 +0100 (CET) Received: from [84.148.25.93] (helo=af.local) by smtp01.web.de with asmtp (WEB.DE 4.110 #2) id 1PaCix-0005go-00; Tue, 04 Jan 2011 20:39:15 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 4 Jan 2011 20:39:10 +0100 Message-Id: <1294169951-5153-4-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1294169951-5153-3-git-send-email-andreas.faerber@web.de> References: <1294169951-5153-1-git-send-email-andreas.faerber@web.de> <1294169951-5153-2-git-send-email-andreas.faerber@web.de> <1294169951-5153-3-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX18xFyrgkhStDzbuT8GFCE4gj8mexCh2/xx7i5sg 9N2Ax0XSrqofDZ5UTCF4smGEWthxdfFXxQlrsfAqYzJxRTMgqX PMeNguGVwUewniUu1wCw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Peter Maydell , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH v4 4/5] softfloat: Drop [u]int16 types in favor of [u]int_fast16_t 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 AIX already didn't use our definition, so let's start ripping out this one: As pointed out by Peter Maydell, int16 is currently int on most supported platforms, so let's replace it with int_fast16_t, allowing the system to use a wider type if appropriate. Note that Darwin uses [u]int16_t now, whereas Haiku uses [u]int32_t. v3: * Split off. Use [u]int_fast16_t rather than [u]int16_t. v2: * Rebased. Fix two new instances of int16. Cc: Peter Maydell Cc: malc Signed-off-by: Andreas Färber --- fpu/softfloat-macros.h | 18 ++++---- fpu/softfloat.c | 114 ++++++++++++++++++++++++------------------------ fpu/softfloat.h | 8 +--- 3 files changed, 68 insertions(+), 72 deletions(-) diff --git a/fpu/softfloat-macros.h b/fpu/softfloat-macros.h index 3128e60..7b350c0 100644 --- a/fpu/softfloat-macros.h +++ b/fpu/softfloat-macros.h @@ -44,7 +44,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( uint32_t a, int16 count, uint32_t *zPtr ) +INLINE void shift32RightJamming( uint32_t a, int_fast16_t count, uint32_t *zPtr ) { uint32_t z; @@ -70,7 +70,7 @@ INLINE void shift32RightJamming( uint32_t a, int16 count, uint32_t *zPtr ) | The result is stored in the location pointed to by `zPtr'. *----------------------------------------------------------------------------*/ -INLINE void shift64RightJamming( uint64_t a, int16 count, uint64_t *zPtr ) +INLINE void shift64RightJamming( uint64_t a, int_fast16_t count, uint64_t *zPtr ) { uint64_t z; @@ -106,7 +106,7 @@ INLINE void shift64RightJamming( uint64_t a, int16 count, uint64_t *zPtr ) INLINE void shift64ExtraRightJamming( - uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr ) + uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint64_t z0, z1; int8 negCount = ( - count ) & 63; @@ -143,7 +143,7 @@ INLINE void INLINE void shift128Right( - uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr ) + uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint64_t z0, z1; int8 negCount = ( - count ) & 63; @@ -178,7 +178,7 @@ INLINE void INLINE void shift128RightJamming( - uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr ) + uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { uint64_t z0, z1; int8 negCount = ( - count ) & 63; @@ -232,7 +232,7 @@ INLINE void uint64_t a0, uint64_t a1, uint64_t a2, - int16 count, + int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr, uint64_t *z2Ptr @@ -287,7 +287,7 @@ INLINE void INLINE void shortShift128Left( - uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr ) + uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr ) { *z1Ptr = a1<>23 ) & 0xFF; @@ -216,7 +216,7 @@ INLINE flag extractFloat32Sign( float32 a ) *----------------------------------------------------------------------------*/ static void - normalizeFloat32Subnormal( uint32_t aSig, int16 *zExpPtr, uint32_t *zSigPtr ) + normalizeFloat32Subnormal( uint32_t aSig, int_fast16_t *zExpPtr, uint32_t *zSigPtr ) { int8 shiftCount; @@ -237,7 +237,7 @@ static void | significand. *----------------------------------------------------------------------------*/ -INLINE float32 packFloat32( flag zSign, int16 zExp, uint32_t zSig ) +INLINE float32 packFloat32( flag zSign, int_fast16_t zExp, uint32_t zSig ) { return make_float32( @@ -267,7 +267,7 @@ INLINE float32 packFloat32( flag zSign, int16 zExp, uint32_t zSig ) | Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -static float32 roundAndPackFloat32( flag zSign, int16 zExp, uint32_t zSig STATUS_PARAM) +static float32 roundAndPackFloat32( flag zSign, int_fast16_t zExp, uint32_t zSig STATUS_PARAM) { int8 roundingMode; flag roundNearestEven; @@ -330,7 +330,7 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, uint32_t zSig STATUS *----------------------------------------------------------------------------*/ static float32 - normalizeRoundAndPackFloat32( flag zSign, int16 zExp, uint32_t zSig STATUS_PARAM) + normalizeRoundAndPackFloat32( flag zSign, int_fast16_t zExp, uint32_t zSig STATUS_PARAM) { int8 shiftCount; @@ -354,7 +354,7 @@ INLINE uint64_t extractFloat64Frac( float64 a ) | Returns the exponent bits of the double-precision floating-point value `a'. *----------------------------------------------------------------------------*/ -INLINE int16 extractFloat64Exp( float64 a ) +INLINE int_fast16_t extractFloat64Exp( float64 a ) { return ( float64_val(a)>>52 ) & 0x7FF; @@ -380,7 +380,7 @@ INLINE flag extractFloat64Sign( float64 a ) *----------------------------------------------------------------------------*/ static void - normalizeFloat64Subnormal( uint64_t aSig, int16 *zExpPtr, uint64_t *zSigPtr ) + normalizeFloat64Subnormal( uint64_t aSig, int_fast16_t *zExpPtr, uint64_t *zSigPtr ) { int8 shiftCount; @@ -401,7 +401,7 @@ static void | significand. *----------------------------------------------------------------------------*/ -INLINE float64 packFloat64( flag zSign, int16 zExp, uint64_t zSig ) +INLINE float64 packFloat64( flag zSign, int_fast16_t zExp, uint64_t zSig ) { return make_float64( @@ -431,11 +431,11 @@ INLINE float64 packFloat64( flag zSign, int16 zExp, uint64_t zSig ) | Binary Floating-Point Arithmetic. *----------------------------------------------------------------------------*/ -static float64 roundAndPackFloat64( flag zSign, int16 zExp, uint64_t zSig STATUS_PARAM) +static float64 roundAndPackFloat64( flag zSign, int_fast16_t zExp, uint64_t zSig STATUS_PARAM) { int8 roundingMode; flag roundNearestEven; - int16 roundIncrement, roundBits; + int_fast16_t roundIncrement, roundBits; flag isTiny; roundingMode = STATUS(float_rounding_mode); @@ -494,7 +494,7 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, uint64_t zSig STATUS *----------------------------------------------------------------------------*/ static float64 - normalizeRoundAndPackFloat64( flag zSign, int16 zExp, uint64_t zSig STATUS_PARAM) + normalizeRoundAndPackFloat64( flag zSign, int_fast16_t zExp, uint64_t zSig STATUS_PARAM) { int8 shiftCount; @@ -1299,7 +1299,7 @@ float128 int64_to_float128( int64 a STATUS_PARAM ) int32 float32_to_int32( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint32_t aSig; uint64_t aSig64; @@ -1329,7 +1329,7 @@ int32 float32_to_int32( float32 a STATUS_PARAM ) int32 float32_to_int32_round_to_zero( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint32_t aSig; int32 z; @@ -1368,10 +1368,10 @@ int32 float32_to_int32_round_to_zero( float32 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int16 float32_to_int16_round_to_zero( float32 a STATUS_PARAM ) +int_fast16_t float32_to_int16_round_to_zero( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint32_t aSig; int32 z; @@ -1420,7 +1420,7 @@ int16 float32_to_int16_round_to_zero( float32 a STATUS_PARAM ) int64 float32_to_int64( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint32_t aSig; uint64_t aSig64, aSigExtra; @@ -1456,7 +1456,7 @@ int64 float32_to_int64( float32 a STATUS_PARAM ) int64 float32_to_int64_round_to_zero( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint32_t aSig; uint64_t aSig64; int64 z; @@ -1499,7 +1499,7 @@ int64 float32_to_int64_round_to_zero( float32 a STATUS_PARAM ) float64 float32_to_float64( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig; aSig = extractFloat32Frac( a ); @@ -1530,7 +1530,7 @@ float64 float32_to_float64( float32 a STATUS_PARAM ) floatx80 float32_to_floatx80( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig; aSig = extractFloat32Frac( a ); @@ -1563,7 +1563,7 @@ floatx80 float32_to_floatx80( float32 a STATUS_PARAM ) float128 float32_to_float128( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig; aSig = extractFloat32Frac( a ); @@ -1594,7 +1594,7 @@ float128 float32_to_float128( float32 a STATUS_PARAM ) float32 float32_round_to_int( float32 a STATUS_PARAM) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t lastBitMask, roundBitsMask; int8 roundingMode; uint32_t z; @@ -1653,9 +1653,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; + int_fast16_t aExp, bExp, zExp; uint32_t aSig, bSig, zSig; - int16 expDiff; + int_fast16_t expDiff; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); @@ -1727,9 +1727,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; + int_fast16_t aExp, bExp, zExp; uint32_t aSig, bSig, zSig; - int16 expDiff; + int_fast16_t expDiff; aSig = extractFloat32Frac( a ); aExp = extractFloat32Exp( a ); @@ -1843,7 +1843,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; + int_fast16_t aExp, bExp, zExp; uint32_t aSig, bSig; uint64_t zSig64; uint32_t zSig; @@ -1903,7 +1903,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; + int_fast16_t aExp, bExp, zExp; uint32_t aSig, bSig, zSig; aSig = extractFloat32Frac( a ); @@ -1965,7 +1965,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; + int_fast16_t aExp, bExp, expDiff; uint32_t aSig, bSig; uint32_t q; uint64_t aSig64, bSig64, q64; @@ -2064,7 +2064,7 @@ float32 float32_rem( float32 a, float32 b STATUS_PARAM ) float32 float32_sqrt( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp, zExp; + int_fast16_t aExp, zExp; uint32_t aSig, zSig; uint64_t rem, term; @@ -2149,7 +2149,7 @@ static const float64 float32_exp2_coefficients[15] = float32 float32_exp2( float32 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig; float64 r, x, xn; int i; @@ -2196,7 +2196,7 @@ float32 float32_exp2( float32 a STATUS_PARAM ) float32 float32_log2( float32 a STATUS_PARAM ) { flag aSign, zSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig, zSig, i; aSig = extractFloat32Frac( a ); @@ -2404,7 +2404,7 @@ int float32_lt_quiet( float32 a, float32 b STATUS_PARAM ) int32 float64_to_int32( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint64_t aSig; aSig = extractFloat64Frac( a ); @@ -2431,7 +2431,7 @@ int32 float64_to_int32( float64 a STATUS_PARAM ) int32 float64_to_int32_round_to_zero( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint64_t aSig, savedASig; int32 z; @@ -2474,10 +2474,10 @@ int32 float64_to_int32_round_to_zero( float64 a STATUS_PARAM ) | returned. *----------------------------------------------------------------------------*/ -int16 float64_to_int16_round_to_zero( float64 a STATUS_PARAM ) +int_fast16_t float64_to_int16_round_to_zero( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint64_t aSig, savedASig; int32 z; @@ -2528,7 +2528,7 @@ int16 float64_to_int16_round_to_zero( float64 a STATUS_PARAM ) int64 float64_to_int64( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint64_t aSig, aSigExtra; aSig = extractFloat64Frac( a ); @@ -2570,7 +2570,7 @@ int64 float64_to_int64( float64 a STATUS_PARAM ) int64 float64_to_int64_round_to_zero( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, shiftCount; + int_fast16_t aExp, shiftCount; uint64_t aSig; int64 z; @@ -2619,7 +2619,7 @@ int64 float64_to_int64_round_to_zero( float64 a STATUS_PARAM ) float32 float64_to_float32( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint64_t aSig; uint32_t zSig; @@ -2651,7 +2651,7 @@ float32 float64_to_float32( float64 a STATUS_PARAM ) | than the desired result exponent whenever `zSig' is a complete, normalized | significand. *----------------------------------------------------------------------------*/ -static uint16_t packFloat16(flag zSign, int16 zExp, uint16_t zSig) +static uint16_t packFloat16(flag zSign, int_fast16_t zExp, uint16_t zSig) { return (((uint32_t)zSign) << 15) + (((uint32_t)zExp) << 10) + zSig; } @@ -2662,7 +2662,7 @@ static uint16_t packFloat16(flag zSign, int16 zExp, uint16_t zSig) float32 float16_to_float32( uint16_t a, flag ieee STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig; aSign = a >> 15; @@ -2694,7 +2694,7 @@ float32 float16_to_float32( uint16_t a, flag ieee STATUS_PARAM ) uint16_t float32_to_float16( float32 a, flag ieee STATUS_PARAM) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig; uint32_t mask; uint32_t increment; @@ -2790,7 +2790,7 @@ uint16_t float32_to_float16( float32 a, flag ieee STATUS_PARAM) floatx80 float64_to_floatx80( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint64_t aSig; aSig = extractFloat64Frac( a ); @@ -2824,7 +2824,7 @@ floatx80 float64_to_floatx80( float64 a STATUS_PARAM ) float128 float64_to_float128( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint64_t aSig, zSig0, zSig1; aSig = extractFloat64Frac( a ); @@ -2856,7 +2856,7 @@ float128 float64_to_float128( float64 a STATUS_PARAM ) float64 float64_round_to_int( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint64_t lastBitMask, roundBitsMask; int8 roundingMode; uint64_t z; @@ -2928,9 +2928,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; + int_fast16_t aExp, bExp, zExp; uint64_t aSig, bSig, zSig; - int16 expDiff; + int_fast16_t expDiff; aSig = extractFloat64Frac( a ); aExp = extractFloat64Exp( a ); @@ -3002,9 +3002,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; + int_fast16_t aExp, bExp, zExp; uint64_t aSig, bSig, zSig; - int16 expDiff; + int_fast16_t expDiff; aSig = extractFloat64Frac( a ); aExp = extractFloat64Exp( a ); @@ -3118,7 +3118,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; + int_fast16_t aExp, bExp, zExp; uint64_t aSig, bSig, zSig0, zSig1; aSig = extractFloat64Frac( a ); @@ -3176,7 +3176,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; + int_fast16_t aExp, bExp, zExp; uint64_t aSig, bSig, zSig; uint64_t rem0, rem1; uint64_t term0, term1; @@ -3246,7 +3246,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; + int_fast16_t aExp, bExp, expDiff; uint64_t aSig, bSig; uint64_t q, alternateASig; int64_t sigMean; @@ -3330,7 +3330,7 @@ float64 float64_rem( float64 a, float64 b STATUS_PARAM ) float64 float64_sqrt( float64 a STATUS_PARAM ) { flag aSign; - int16 aExp, zExp; + int_fast16_t aExp, zExp; uint64_t aSig, zSig, doubleZSig; uint64_t rem0, rem1, term0, term1; @@ -3380,7 +3380,7 @@ float64 float64_sqrt( float64 a STATUS_PARAM ) float64 float64_log2( float64 a STATUS_PARAM ) { flag aSign, zSign; - int16 aExp; + int_fast16_t aExp; uint64_t aSig, aSig0, aSig1, zSig, i; aSig = extractFloat64Frac( a ); @@ -3802,7 +3802,7 @@ float64 floatx80_to_float64( floatx80 a STATUS_PARAM ) float128 floatx80_to_float128( floatx80 a STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint64_t aSig, zSig0, zSig1; aSig = extractFloatx80Frac( a ); @@ -5931,7 +5931,7 @@ int float128_compare_quiet( float128 a, float128 b STATUS_PARAM ) float32 float32_scalbn( float32 a, int n STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint32_t aSig; aSig = extractFloat32Frac( a ); @@ -5954,7 +5954,7 @@ float32 float32_scalbn( float32 a, int n STATUS_PARAM ) float64 float64_scalbn( float64 a, int n STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint64_t aSig; aSig = extractFloat64Frac( a ); @@ -5978,7 +5978,7 @@ float64 float64_scalbn( float64 a, int n STATUS_PARAM ) floatx80 floatx80_scalbn( floatx80 a, int n STATUS_PARAM ) { flag aSign; - int16 aExp; + int_fast16_t aExp; uint64_t aSig; aSig = extractFloatx80Frac( a ); diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 7bed60b..4d5aa39 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -56,10 +56,6 @@ these four paragraphs for those parts of this code that are retained. 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; @@ -242,7 +238,7 @@ float32 float16_to_float32( uint16_t, flag STATUS_PARAM ); /*---------------------------------------------------------------------------- | Software IEC/IEEE single-precision conversion routines. *----------------------------------------------------------------------------*/ -int16 float32_to_int16_round_to_zero( float32 STATUS_PARAM ); +int_fast16_t float32_to_int16_round_to_zero( float32 STATUS_PARAM ); unsigned int float32_to_uint16_round_to_zero( float32 STATUS_PARAM ); int32 float32_to_int32( float32 STATUS_PARAM ); int32 float32_to_int32_round_to_zero( float32 STATUS_PARAM ); @@ -320,7 +316,7 @@ INLINE int float32_is_any_nan(float32 a) /*---------------------------------------------------------------------------- | Software IEC/IEEE double-precision conversion routines. *----------------------------------------------------------------------------*/ -int16 float64_to_int16_round_to_zero( float64 STATUS_PARAM ); +int_fast16_t float64_to_int16_round_to_zero( float64 STATUS_PARAM ); unsigned int float64_to_uint16_round_to_zero( float64 STATUS_PARAM ); int32 float64_to_int32( float64 STATUS_PARAM ); int32 float64_to_int32_round_to_zero( float64 STATUS_PARAM );