qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 13/14] softfloat: Replace int64 type with int_fast64


From: Andreas Färber
Subject: [Qemu-devel] [PATCH 13/14] softfloat: Replace int64 type with int_fast64_t
Date: Mon, 16 Jan 2012 01:47:02 +0100

Based on the following Coccinelle patch:

@@
typedef int64, int_fast64_t;
@@
-int64
+int_fast64_t

Add a typedef for pre-10 Solaris.

Signed-off-by: Andreas Färber <address@hidden>
Cc: Ben Taylor <address@hidden>
---
 fpu/softfloat.c |   38 +++++++++++++++++++-------------------
 fpu/softfloat.h |   25 ++++++++++++-------------
 osdep.h         |    1 +
 3 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index ace2ca2..e71a3c2 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -162,11 +162,11 @@ static int_fast32_t roundAndPackInt32(flag zSign, 
uint64_t absZ STATUS_PARAM)
 | returned.
 *----------------------------------------------------------------------------*/
 
-static int64 roundAndPackInt64( flag zSign, uint64_t absZ0, uint64_t absZ1 
STATUS_PARAM)
+static int_fast64_t roundAndPackInt64(flag zSign, uint64_t absZ0, uint64_t 
absZ1 STATUS_PARAM)
 {
     int_fast8_t roundingMode;
     flag roundNearestEven, increment;
-    int64 z;
+    int_fast64_t z;
 
     roundingMode = STATUS(float_rounding_mode);
     roundNearestEven = ( roundingMode == float_round_nearest_even );
@@ -667,7 +667,7 @@ static floatx80
 {
     int_fast8_t roundingMode;
     flag roundNearestEven, increment, isTiny;
-    int64 roundIncrement, roundMask, roundBits;
+    int_fast64_t roundIncrement, roundMask, roundBits;
 
     roundingMode = STATUS(float_rounding_mode);
     roundNearestEven = ( roundingMode == float_round_nearest_even );
@@ -1205,7 +1205,7 @@ float128 int32_to_float128(int_fast32_t 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(int_fast64_t a STATUS_PARAM)
 {
     flag zSign;
     uint_fast64_t absA;
@@ -1258,7 +1258,7 @@ float32 uint64_to_float32(uint_fast64_t 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(int_fast64_t a STATUS_PARAM)
 {
     flag zSign;
 
@@ -1285,7 +1285,7 @@ float64 uint64_to_float64(uint_fast64_t a STATUS_PARAM)
 | Arithmetic.
 *----------------------------------------------------------------------------*/
 
-floatx80 int64_to_floatx80( int64 a STATUS_PARAM )
+floatx80 int64_to_floatx80(int_fast64_t a STATUS_PARAM)
 {
     flag zSign;
     uint_fast64_t absA;
@@ -1305,7 +1305,7 @@ 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(int_fast64_t a STATUS_PARAM)
 {
     flag zSign;
     uint_fast64_t absA;
@@ -1465,7 +1465,7 @@ int_fast16_t float32_to_int16_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 )
+int_fast64_t float32_to_int64(float32 a STATUS_PARAM)
 {
     flag aSign;
     int_fast16_t aExp, shiftCount;
@@ -1502,13 +1502,13 @@ int64 float32_to_int64( float32 a STATUS_PARAM )
 | returned.
 *----------------------------------------------------------------------------*/
 
-int64 float32_to_int64_round_to_zero( float32 a STATUS_PARAM )
+int_fast64_t float32_to_int64_round_to_zero(float32 a STATUS_PARAM)
 {
     flag aSign;
     int_fast16_t aExp, shiftCount;
     uint32_t aSig;
     uint64_t aSig64;
-    int64 z;
+    int_fast64_t z;
     a = float32_squash_input_denormal(a STATUS_VAR);
 
     aSig = extractFloat32Frac( a );
@@ -2855,7 +2855,7 @@ int_fast16_t float64_to_int16_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 )
+int_fast64_t float64_to_int64(float64 a STATUS_PARAM)
 {
     flag aSign;
     int_fast16_t aExp, shiftCount;
@@ -2898,12 +2898,12 @@ int64 float64_to_int64( float64 a STATUS_PARAM )
 | returned.
 *----------------------------------------------------------------------------*/
 
-int64 float64_to_int64_round_to_zero( float64 a STATUS_PARAM )
+int_fast64_t float64_to_int64_round_to_zero(float64 a STATUS_PARAM)
 {
     flag aSign;
     int_fast16_t aExp, shiftCount;
     uint64_t aSig;
-    int64 z;
+    int_fast64_t z;
     a = float64_squash_input_denormal(a STATUS_VAR);
 
     aSig = extractFloat64Frac( a );
@@ -4288,7 +4288,7 @@ int_fast32_t 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 )
+int_fast64_t floatx80_to_int64(floatx80 a STATUS_PARAM)
 {
     flag aSign;
     int_fast32_t aExp, shiftCount;
@@ -4328,12 +4328,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 )
+int_fast64_t floatx80_to_int64_round_to_zero(floatx80 a STATUS_PARAM)
 {
     flag aSign;
     int_fast32_t aExp, shiftCount;
     uint64_t aSig;
-    int64 z;
+    int_fast64_t z;
 
     aSig = extractFloatx80Frac( a );
     aExp = extractFloatx80Exp( a );
@@ -5320,7 +5320,7 @@ int_fast32_t 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 )
+int_fast64_t float128_to_int64(float128 a STATUS_PARAM)
 {
     flag aSign;
     int_fast32_t aExp, shiftCount;
@@ -5363,12 +5363,12 @@ int64 float128_to_int64( float128 a STATUS_PARAM )
 | returned.
 *----------------------------------------------------------------------------*/
 
-int64 float128_to_int64_round_to_zero( float128 a STATUS_PARAM )
+int_fast64_t float128_to_int64_round_to_zero(float128 a STATUS_PARAM)
 {
     flag aSign;
     int_fast32_t aExp, shiftCount;
     uint64_t aSig0, aSig1;
-    int64 z;
+    int_fast64_t z;
 
     aSig1 = extractFloat128Frac1( a );
     aSig0 = extractFloat128Frac0( a );
diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index ce28906..0c43436 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -55,7 +55,6 @@ these four paragraphs for those parts of this code that are 
retained.
 | to the same as `int'.
 *----------------------------------------------------------------------------*/
 typedef uint8_t flag;
-typedef int64_t int64;
 
 #define LIT64( a ) a##LL
 #define INLINE static inline
@@ -224,12 +223,12 @@ float32 uint32_to_float32(uint_fast32_t STATUS_PARAM);
 float64 uint32_to_float64(uint_fast32_t STATUS_PARAM);
 floatx80 int32_to_floatx80(int_fast32_t STATUS_PARAM);
 float128 int32_to_float128(int_fast32_t STATUS_PARAM);
-float32 int64_to_float32( int64 STATUS_PARAM );
+float32 int64_to_float32(int_fast64_t STATUS_PARAM);
 float32 uint64_to_float32(uint_fast64_t STATUS_PARAM);
-float64 int64_to_float64( int64 STATUS_PARAM );
+float64 int64_to_float64(int_fast64_t STATUS_PARAM);
 float64 uint64_to_float64(uint_fast64_t STATUS_PARAM);
-floatx80 int64_to_floatx80( int64 STATUS_PARAM );
-float128 int64_to_float128( int64 STATUS_PARAM );
+floatx80 int64_to_floatx80(int_fast64_t STATUS_PARAM);
+float128 int64_to_float128(int_fast64_t STATUS_PARAM);
 
 /*----------------------------------------------------------------------------
 | Software half-precision conversion routines.
@@ -258,8 +257,8 @@ int_fast32_t float32_to_int32(float32 STATUS_PARAM);
 int_fast32_t float32_to_int32_round_to_zero(float32 STATUS_PARAM);
 uint_fast32_t float32_to_uint32(float32 STATUS_PARAM);
 uint_fast32_t 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 );
+int_fast64_t float32_to_int64(float32 STATUS_PARAM);
+int_fast64_t float32_to_int64_round_to_zero(float32 STATUS_PARAM);
 float64 float32_to_float64( float32 STATUS_PARAM );
 floatx80 float32_to_floatx80( float32 STATUS_PARAM );
 float128 float32_to_float128( float32 STATUS_PARAM );
@@ -362,8 +361,8 @@ int_fast32_t float64_to_int32(float64 STATUS_PARAM);
 int_fast32_t float64_to_int32_round_to_zero(float64 STATUS_PARAM);
 uint_fast32_t float64_to_uint32(float64 STATUS_PARAM);
 uint_fast32_t 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 );
+int_fast64_t float64_to_int64(float64 STATUS_PARAM);
+int_fast64_t float64_to_int64_round_to_zero(float64 STATUS_PARAM);
 uint_fast64_t float64_to_uint64(float64 a STATUS_PARAM);
 uint_fast64_t float64_to_uint64_round_to_zero(float64 a STATUS_PARAM);
 float32 float64_to_float32( float64 STATUS_PARAM );
@@ -464,8 +463,8 @@ extern const float64 float64_default_nan;
 *----------------------------------------------------------------------------*/
 int_fast32_t floatx80_to_int32(floatx80 STATUS_PARAM);
 int_fast32_t 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 );
+int_fast64_t floatx80_to_int64(floatx80 STATUS_PARAM);
+int_fast64_t floatx80_to_int64_round_to_zero(floatx80 STATUS_PARAM);
 float32 floatx80_to_float32( floatx80 STATUS_PARAM );
 float64 floatx80_to_float64( floatx80 STATUS_PARAM );
 float128 floatx80_to_float128( floatx80 STATUS_PARAM );
@@ -549,8 +548,8 @@ extern const floatx80 floatx80_default_nan;
 *----------------------------------------------------------------------------*/
 int_fast32_t float128_to_int32(float128 STATUS_PARAM);
 int_fast32_t 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 );
+int_fast64_t float128_to_int64(float128 STATUS_PARAM);
+int_fast64_t float128_to_int64_round_to_zero(float128 STATUS_PARAM);
 float32 float128_to_float32( float128 STATUS_PARAM );
 float64 float128_to_float64( float128 STATUS_PARAM );
 floatx80 float128_to_floatx80( float128 STATUS_PARAM );
diff --git a/osdep.h b/osdep.h
index a30bd6a..6ee9f8b 100644
--- a/osdep.h
+++ b/osdep.h
@@ -19,6 +19,7 @@ typedef uint64_t                uint_fast64_t;
 typedef signed char             int_fast8_t;
 typedef signed int              int_fast16_t;
 typedef signed int              int_fast32_t;
+typedef int64_t                 int_fast64_t;
 #endif
 
 #ifndef glue
-- 
1.7.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]