From df84f0d5135323683646d8892199f613b8c056f3 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Mon, 19 Feb 2018 00:16:45 -0500 Subject: [PATCH] fpu: Replace uint64 typedef with uint64_t Replace the uint64 softfloat-specific typedef with uint64_t. This change was made with find include fpu target-* -name '*.[ch]' | xargs sed -i -e 's/\buint64\b/uint64_t/g' together with manual removal of the typedef definition, and manual undoing of some mis-hits where macro arguments were being used for token pasting rather than as a type. Note that the target-mips/kvm.c and target-s390x/kvm.c changes are fixing code that should not have been using the uint64 type in the first place. Backports commit 182f42fdc219e6481654fcfb73b17e4b4e63b6ff from qemu --- qemu/fpu/softfloat.c | 10 +++++----- qemu/include/fpu/softfloat.h | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/qemu/fpu/softfloat.c b/qemu/fpu/softfloat.c index f5becfc8..24422b6a 100644 --- a/qemu/fpu/softfloat.c +++ b/qemu/fpu/softfloat.c @@ -1335,7 +1335,7 @@ float128 int32_to_float128(int32_t a, float_status *status) float32 int64_to_float32(int64_t a, float_status *status) { flag zSign; - uint64 absA; + uint64_t absA; int8 shiftCount; if ( a == 0 ) return float32_zero; @@ -1387,7 +1387,7 @@ float64 int64_to_float64(int64_t a, float_status *status) floatx80 int64_to_floatx80(int64_t a, float_status *status) { flag zSign; - uint64 absA; + uint64_t absA; int8 shiftCount; if ( a == 0 ) return packFloatx80( 0, 0, 0 ); @@ -1407,7 +1407,7 @@ floatx80 int64_to_floatx80(int64_t a, float_status *status) float128 int64_to_float128(int64_t a, float_status *status) { flag zSign; - uint64 absA; + uint64_t absA; int8 shiftCount; int32 zExp; uint64_t zSig0, zSig1; @@ -1677,7 +1677,7 @@ int64_t float32_to_int64( float32 a, float_status *status) | raise the inexact exception flag. *----------------------------------------------------------------------------*/ -uint64 float32_to_uint64(float32 a, float_status *status) +uint64_t float32_to_uint64(float32 a, float_status *status) { flag aSign; int_fast16_t aExp, shiftCount; @@ -1722,7 +1722,7 @@ uint64 float32_to_uint64(float32 a, float_status *status) | not round to zero will raise the inexact flag. *----------------------------------------------------------------------------*/ -uint64 float32_to_uint64_round_to_zero(float32 a, float_status *status) +uint64_t float32_to_uint64_round_to_zero(float32 a, float_status *status) { int64_t v; signed char current_rounding_mode = status->float_rounding_mode; diff --git a/qemu/include/fpu/softfloat.h b/qemu/include/fpu/softfloat.h index 93fb026e..1de5a33b 100644 --- a/qemu/include/fpu/softfloat.h +++ b/qemu/include/fpu/softfloat.h @@ -103,7 +103,6 @@ typedef uint8_t uint8; typedef int8_t int8; typedef unsigned int uint32; typedef signed int int32; -typedef uint64_t uint64; #define LIT64( a ) a##LL @@ -384,8 +383,8 @@ int32 float32_to_int32_round_to_zero( float32, float_status *status ); uint32 float32_to_uint32( float32, float_status *status ); uint32 float32_to_uint32_round_to_zero( float32, float_status *status ); int64_t float32_to_int64( float32, float_status *status ); -uint64 float32_to_uint64(float32, float_status *status); -uint64 float32_to_uint64_round_to_zero(float32, float_status *status); +uint64_t float32_to_uint64(float32, float_status *status); +uint64_t float32_to_uint64_round_to_zero(float32, float_status *status); int64_t float32_to_int64_round_to_zero( float32, float_status *status ); float64 float32_to_float64( float32, float_status *status ); floatx80 float32_to_floatx80( float32, float_status *status ); @@ -497,8 +496,8 @@ uint32 float64_to_uint32( float64, float_status *status ); uint32 float64_to_uint32_round_to_zero( float64, float_status *status ); int64_t float64_to_int64( float64, float_status *status ); int64_t float64_to_int64_round_to_zero( float64, float_status *status ); -uint64 float64_to_uint64 (float64 a, float_status *status); -uint64 float64_to_uint64_round_to_zero (float64 a, float_status *status); +uint64_t float64_to_uint64 (float64 a, float_status *status); +uint64_t float64_to_uint64_round_to_zero (float64 a, float_status *status); float32 float64_to_float32( float64, float_status *status ); floatx80 float64_to_floatx80( float64, float_status *status ); float128 float64_to_float128( float64, float_status *status );