qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Andreas Färber" <andreas.faerber@web.de>,
	"Michael Lotz" <mmlr@mlotz.ch>
Subject: [Qemu-devel] [PATCH v4 2/5] softfloat: Resolve type mismatches between declaration and implementation
Date: Tue,  4 Jan 2011 20:39:08 +0100	[thread overview]
Message-ID: <1294169951-5153-2-git-send-email-andreas.faerber@web.de> (raw)
In-Reply-To: <1294169951-5153-1-git-send-email-andreas.faerber@web.de>

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 <mmlr@mlotz.ch>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 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
-- 
1.7.3.4

  reply	other threads:[~2011-01-04 19:39 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17 17:31 [Qemu-devel] [PATCH] softfloat: Fix function signature mismatches by using POSIX integer types Andreas Färber
2010-12-17 22:39 ` [Qemu-devel] [PATCH v2] " Andreas Färber
2010-12-18 16:25   ` [Qemu-devel] [PATCH v3 1/7] apic: Don't use SoftFloat uint32 type Andreas Färber
2010-12-18 16:25     ` [Qemu-devel] [PATCH v3 2/7] wdt_ib700: Don't use SoftFloat int64 type Andreas Färber
2010-12-18 16:25       ` [Qemu-devel] [PATCH v3 3/7] target-i386: Don't use SoftFloat uint64 type Andreas Färber
2010-12-18 16:25         ` [Qemu-devel] [PATCH v3 4/7] softfloat: Resolve type mismatches between declaration and implementation Andreas Färber
2010-12-18 16:25           ` [Qemu-devel] [PATCH v3 5/7] softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t Andreas Färber
2010-12-18 16:25             ` [Qemu-devel] [PATCH v3 6/7] softfloat: Drop [u]int16 types in favor of [u]int_fast16_t Andreas Färber
2010-12-18 16:25               ` [Qemu-devel] [PATCH v3 7/7] softfloat: Make float{32, 64}_to_uint16_round_to_zero() use uint_fast16_t Andreas Färber
2011-01-01 13:47                 ` Andreas Färber
2011-01-04 19:39                   ` [Qemu-devel] [PATCH, RFC v4 1/5] softfloat: Prepend QEMU-style header with derivation notice Andreas Färber
2011-01-04 19:39                     ` Andreas Färber [this message]
2011-01-04 19:39                       ` [Qemu-devel] [PATCH v4 3/5] softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t Andreas Färber
2011-01-04 19:39                         ` [Qemu-devel] [PATCH v4 4/5] softfloat: Drop [u]int16 types in favor of [u]int_fast16_t Andreas Färber
2011-01-04 19:39                           ` [Qemu-devel] [FYI v4 5/5] softfloat: Make float{32, 64}_to_uint16_round_to_zero() use uint_fast16_t Andreas Färber
2011-03-07  0:34                             ` [Qemu-devel] [PATCH v5 01/10] [RESEND] softfloat: Prepend QEMU-style header with derivation notice Andreas Färber
2011-03-07  0:34                               ` [Qemu-devel] [PATCH v5 02/10] softfloat: Resolve type mismatches between declaration and implementation Andreas Färber
2011-03-07  0:34                                 ` [Qemu-devel] [PATCH v5 03/10] softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t Andreas Färber
2011-03-07  0:34                                   ` [Qemu-devel] [PATCH v5 04/10] softfloat: Drop [u]int16 types in favor of [u]int_fast16_t Andreas Färber
2011-03-07  0:34                                     ` [Qemu-devel] [PATCH v5 05/10] softfloat: Use [u]int_fast16_t consistently Andreas Färber
2011-03-07  0:34                                       ` [Qemu-devel] [PATCH v5 06/10] softfloat: Drop [u]int8 types in favor of int_fast8_t Andreas Färber
2011-03-07  0:34                                         ` [Qemu-devel] [PATCH v5 07/10] softfloat: Drop [u]int32 types in favor of [u]int_fast32_t Andreas Färber
2011-03-07  0:34                                           ` [Qemu-devel] [PATCH v5 08/10] softfloat: Use [u]int_fast32_t consistently Andreas Färber
2011-03-07  0:34                                             ` [Qemu-devel] [PATCH v5 09/10] softfloat: Drop [u]int64 types in favor of [u]int_fast64_t Andreas Färber
2011-03-07  0:34                                               ` [Qemu-devel] [PATCH v5 10/10] softfloat: Use [u]int_fast64_t consistently Andreas Färber
2011-03-07  9:56                                                 ` Aurelien Jarno
2011-03-07 23:10                                                   ` Andreas Färber
2011-03-08  6:04                                                     ` Aurelien Jarno
2011-03-07  9:56                                           ` [Qemu-devel] [PATCH v5 07/10] softfloat: Drop [u]int32 types in favor of [u]int_fast32_t Aurelien Jarno
2011-03-07 23:16                                             ` Andreas Färber
2011-03-07 23:33                                               ` Aurelien Jarno
2011-03-07  9:56                                     ` [Qemu-devel] [PATCH v5 04/10] softfloat: Drop [u]int16 types in favor of [u]int_fast16_t Aurelien Jarno
2011-03-07 23:02                                       ` Andreas Färber
2011-03-07 23:28                                         ` Aurelien Jarno
2011-03-07 23:14                                       ` Peter Maydell
2011-03-07 23:37                                         ` Aurelien Jarno
2011-03-08  8:29                                           ` Peter Maydell
2011-03-08  8:49                                             ` Aurelien Jarno
2011-03-08 18:54                                             ` Andreas Färber
2011-03-21 21:11                                               ` Aurelien Jarno
2011-03-07  9:56                                   ` [Qemu-devel] [PATCH v5 03/10] softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t Aurelien Jarno
2011-03-07  9:56                                 ` [Qemu-devel] [PATCH v5 02/10] softfloat: Resolve type mismatches between declaration and implementation Aurelien Jarno
2011-03-07  9:56                               ` [Qemu-devel] [PATCH v5 01/10] [RESEND] softfloat: Prepend QEMU-style header with derivation notice Aurelien Jarno
2010-12-19 11:28           ` [Qemu-devel] [PATCH v3 4/7] softfloat: Resolve type mismatches between declaration and implementation Blue Swirl
2010-12-19 12:06             ` Andreas Färber
2010-12-18 20:19         ` [Qemu-devel] Re: [PATCH v3 3/7] target-i386: Don't use SoftFloat uint64 type Juan Quintela
2010-12-20  0:52         ` Huang Ying
2010-12-18 16:47       ` [Qemu-devel] Re: [PATCH v3 2/7] wdt_ib700: Don't use SoftFloat int64 type Richard W.M. Jones
2010-12-19 12:51         ` Andreas Färber
2010-12-19 14:16           ` Richard W.M. Jones
2010-12-19 14:28             ` Andreas Färber
2010-12-19 14:38               ` Blue Swirl
2010-12-19 15:07                 ` Andreas Färber
2010-12-19 15:17                   ` Blue Swirl
2010-12-19 11:20     ` [Qemu-devel] [PATCH v3 1/7] apic: Don't use SoftFloat uint32 type Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294169951-5153-2-git-send-email-andreas.faerber@web.de \
    --to=andreas.faerber@web.de \
    --cc=mmlr@mlotz.ch \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).