From patchwork Tue Jan 4 19:39:08 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: 77519 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 163D8B70FF for ; Wed, 5 Jan 2011 06:42:23 +1100 (EST) Received: from localhost ([127.0.0.1]:54448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaClx-0002Ti-4y for incoming@patchwork.ozlabs.org; Tue, 04 Jan 2011 14:42:21 -0500 Received: from [140.186.70.92] (port=59883 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaCiz-0001FN-70 for qemu-devel@nongnu.org; Tue, 04 Jan 2011 14:39:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaCix-0004nD-4v for qemu-devel@nongnu.org; Tue, 04 Jan 2011 14:39:17 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:42165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaCiw-0004mp-Lk for qemu-devel@nongnu.org; Tue, 04 Jan 2011 14:39:15 -0500 Received: from smtp01.web.de ( [172.20.0.243]) by fmmailgate03.web.de (Postfix) with ESMTP id 7F5891839E537; Tue, 4 Jan 2011 20:39:13 +0100 (CET) Received: from [84.148.25.93] (helo=af.local) by smtp01.web.de with asmtp (WEB.DE 4.110 #2) id 1PaCiv-0005go-00; Tue, 04 Jan 2011 20:39:13 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Tue, 4 Jan 2011 20:39:08 +0100 Message-Id: <1294169951-5153-2-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1294169951-5153-1-git-send-email-andreas.faerber@web.de> References: <1294169951-5153-1-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX1/ygIwdkgJ3wU2lpuXXFdpeR8WL8b1WtSt9CkaD kaw1NaXAkPV22rlE99FL5tIxmfkmPwS/AqUE+pv17sQdofw1N3 7xD7Y8MLg5DycbWcWg2Q== 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 v4 2/5] softfloat: Resolve type mismatches between declaration and implementation 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 The original SoftFloat 2.0b library avoided the use of custom integer types in its public headers. This requires the definitions of int{8,16,32,64} to match the assumptions in the declarations. This breaks on BeOS R5 and Haiku/x86, where int32 is defined in {be,os}/support/SupportDefs.h in terms of a long rather than an int. Spotted by Michael Lotz. Since QEMU already breaks this distinction by defining those types just above, do use them for consistency and to allow #ifndef'ing them out as done for [u]int16 on AIX. Note that the BeOS/Haiku types are exact-width types though. v3: * Split off as intermediate step. v2: * Rebased. Cc: Michael Lotz Cc: Peter Maydell Signed-off-by: Andreas Färber --- fpu/softfloat.h | 68 +++++++++++++++++++++++++++--------------------------- 1 files changed, 34 insertions(+), 34 deletions(-) diff --git a/fpu/softfloat.h b/fpu/softfloat.h index bf7a2f4..cefd4fa 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -227,25 +227,25 @@ void float_raise( int8 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 int32_to_float32( int32 STATUS_PARAM ); +float64 int32_to_float64( int32 STATUS_PARAM ); float32 uint32_to_float32( unsigned int STATUS_PARAM ); float64 uint32_to_float64( unsigned int STATUS_PARAM ); #ifdef FLOATX80 -floatx80 int32_to_floatx80( int STATUS_PARAM ); +floatx80 int32_to_floatx80( int32 STATUS_PARAM ); #endif #ifdef FLOAT128 -float128 int32_to_float128( int STATUS_PARAM ); +float128 int32_to_float128( int32 STATUS_PARAM ); #endif -float32 int64_to_float32( int64_t STATUS_PARAM ); -float32 uint64_to_float32( uint64_t STATUS_PARAM ); -float64 int64_to_float64( int64_t STATUS_PARAM ); -float64 uint64_to_float64( uint64_t STATUS_PARAM ); +float32 int64_to_float32( int64 STATUS_PARAM ); +float32 uint64_to_float32( uint64 STATUS_PARAM ); +float64 int64_to_float64( int64 STATUS_PARAM ); +float64 uint64_to_float64( uint64 STATUS_PARAM ); #ifdef FLOATX80 -floatx80 int64_to_floatx80( int64_t STATUS_PARAM ); +floatx80 int64_to_floatx80( int64 STATUS_PARAM ); #endif #ifdef FLOAT128 -float128 int64_to_float128( int64_t STATUS_PARAM ); +float128 int64_to_float128( int64 STATUS_PARAM ); #endif /*---------------------------------------------------------------------------- @@ -257,14 +257,14 @@ float32 float16_to_float32( bits16, flag STATUS_PARAM ); /*---------------------------------------------------------------------------- | Software IEC/IEEE single-precision conversion routines. *----------------------------------------------------------------------------*/ -int float32_to_int16_round_to_zero( float32 STATUS_PARAM ); +int16 float32_to_int16_round_to_zero( float32 STATUS_PARAM ); unsigned int float32_to_uint16_round_to_zero( float32 STATUS_PARAM ); -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 ); -int64_t float32_to_int64( float32 STATUS_PARAM ); -int64_t float32_to_int64_round_to_zero( float32 STATUS_PARAM ); +int32 float32_to_int32( float32 STATUS_PARAM ); +int32 float32_to_int32_round_to_zero( float32 STATUS_PARAM ); +uint32 float32_to_uint32( float32 STATUS_PARAM ); +uint32 float32_to_uint32_round_to_zero( float32 STATUS_PARAM ); +int64 float32_to_int64( float32 STATUS_PARAM ); +int64 float32_to_int64_round_to_zero( float32 STATUS_PARAM ); float64 float32_to_float64( float32 STATUS_PARAM ); #ifdef FLOATX80 floatx80 float32_to_floatx80( float32 STATUS_PARAM ); @@ -335,16 +335,16 @@ INLINE int float32_is_any_nan(float32 a) /*---------------------------------------------------------------------------- | Software IEC/IEEE double-precision conversion routines. *----------------------------------------------------------------------------*/ -int float64_to_int16_round_to_zero( float64 STATUS_PARAM ); +int16 float64_to_int16_round_to_zero( float64 STATUS_PARAM ); unsigned int float64_to_uint16_round_to_zero( float64 STATUS_PARAM ); -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 ); -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); -uint64_t float64_to_uint64_round_to_zero (float64 a STATUS_PARAM); +int32 float64_to_int32( float64 STATUS_PARAM ); +int32 float64_to_int32_round_to_zero( float64 STATUS_PARAM ); +uint32 float64_to_uint32( float64 STATUS_PARAM ); +uint32 float64_to_uint32_round_to_zero( float64 STATUS_PARAM ); +int64 float64_to_int64( float64 STATUS_PARAM ); +int64 float64_to_int64_round_to_zero( float64 STATUS_PARAM ); +uint64 float64_to_uint64 (float64 a STATUS_PARAM); +uint64 float64_to_uint64_round_to_zero (float64 a STATUS_PARAM); float32 float64_to_float32( float64 STATUS_PARAM ); #ifdef FLOATX80 floatx80 float64_to_floatx80( float64 STATUS_PARAM ); @@ -417,10 +417,10 @@ INLINE int float64_is_any_nan(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 ); -int64_t floatx80_to_int64( floatx80 STATUS_PARAM ); -int64_t floatx80_to_int64_round_to_zero( floatx80 STATUS_PARAM ); +int32 floatx80_to_int32( floatx80 STATUS_PARAM ); +int32 floatx80_to_int32_round_to_zero( floatx80 STATUS_PARAM ); +int64 floatx80_to_int64( floatx80 STATUS_PARAM ); +int64 floatx80_to_int64_round_to_zero( floatx80 STATUS_PARAM ); float32 floatx80_to_float32( floatx80 STATUS_PARAM ); float64 floatx80_to_float64( floatx80 STATUS_PARAM ); #ifdef FLOAT128 @@ -481,10 +481,10 @@ 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 ); -int64_t float128_to_int64( float128 STATUS_PARAM ); -int64_t float128_to_int64_round_to_zero( float128 STATUS_PARAM ); +int32 float128_to_int32( float128 STATUS_PARAM ); +int32 float128_to_int32_round_to_zero( float128 STATUS_PARAM ); +int64 float128_to_int64( float128 STATUS_PARAM ); +int64 float128_to_int64_round_to_zero( float128 STATUS_PARAM ); float32 float128_to_float32( float128 STATUS_PARAM ); float64 float128_to_float64( float128 STATUS_PARAM ); #ifdef FLOATX80