From patchwork Fri Jan 22 15:17:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 8091001 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30230BEEE5 for ; Fri, 22 Jan 2016 15:18:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F1EE20457 for ; Fri, 22 Jan 2016 15:18:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C25B220384 for ; Fri, 22 Jan 2016 15:18:06 +0000 (UTC) Received: from localhost ([::1]:54315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdTS-0002VX-1b for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jan 2016 10:18:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdT7-0002S2-EF for qemu-devel@nongnu.org; Fri, 22 Jan 2016 10:17:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMdT5-0008MJ-Qx for qemu-devel@nongnu.org; Fri, 22 Jan 2016 10:17:45 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:59498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdT5-0008Kk-F5 for qemu-devel@nongnu.org; Fri, 22 Jan 2016 10:17:43 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1aMdSy-0003pL-LS for qemu-devel@nongnu.org; Fri, 22 Jan 2016 15:17:36 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 22 Jan 2016 15:17:30 +0000 Message-Id: <1453475856-14682-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1453475856-14682-1-git-send-email-peter.maydell@linaro.org> References: <1453475856-14682-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 1/7] fpu: Replace int64 typedef with int64_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the int64 softfloat-specific typedef with int64_t. This change was made with find include fpu target-* -name '*.[ch]' | xargs sed -i -e 's/\bint64\b/int64_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. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Aurelien Jarno Acked-by: Leon Alrae Message-id: 1452603315-27030-2-git-send-email-peter.maydell@linaro.org --- fpu/softfloat.c | 30 +++++++++++++++--------------- include/fpu/softfloat.h | 17 ++++++++--------- target-mips/msa_helper.c | 12 ++++++------ 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index f1170fe..967da1c 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -198,7 +198,7 @@ static int32 roundAndPackInt32(flag zSign, uint64_t absZ, float_status *status) | returned. *----------------------------------------------------------------------------*/ -static int64 roundAndPackInt64(flag zSign, uint64_t absZ0, uint64_t absZ1, +static int64_t roundAndPackInt64(flag zSign, uint64_t absZ0, uint64_t absZ1, float_status *status) { int8 roundingMode; @@ -255,7 +255,7 @@ static int64 roundAndPackInt64(flag zSign, uint64_t absZ0, uint64_t absZ1, | exception is raised and the largest unsigned integer is returned. *----------------------------------------------------------------------------*/ -static int64 roundAndPackUint64(flag zSign, uint64_t absZ0, +static int64_t roundAndPackUint64(flag zSign, uint64_t absZ0, uint64_t absZ1, float_status *status) { int8 roundingMode; @@ -784,7 +784,7 @@ static floatx80 roundAndPackFloatx80(int8 roundingPrecision, flag zSign, { int8 roundingMode; flag roundNearestEven, increment, isTiny; - int64 roundIncrement, roundMask, roundBits; + int64_t roundIncrement, roundMask, roundBits; roundingMode = status->float_rounding_mode; roundNearestEven = ( roundingMode == float_round_nearest_even ); @@ -1666,7 +1666,7 @@ int_fast16_t float32_to_int16_round_to_zero(float32 a, float_status *status) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 float32_to_int64(float32 a, float_status *status) +int64_t float32_to_int64(float32 a, float_status *status) { flag aSign; int_fast16_t aExp, shiftCount; @@ -1769,13 +1769,13 @@ uint64 float32_to_uint64_round_to_zero(float32 a, float_status *status) | returned. *----------------------------------------------------------------------------*/ -int64 float32_to_int64_round_to_zero(float32 a, float_status *status) +int64_t float32_to_int64_round_to_zero(float32 a, float_status *status) { flag aSign; int_fast16_t aExp, shiftCount; uint32_t aSig; uint64_t aSig64; - int64 z; + int64_t z; a = float32_squash_input_denormal(a, status); aSig = extractFloat32Frac( a ); @@ -3201,7 +3201,7 @@ int_fast16_t float64_to_int16_round_to_zero(float64 a, float_status *status) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 float64_to_int64(float64 a, float_status *status) +int64_t float64_to_int64(float64 a, float_status *status) { flag aSign; int_fast16_t aExp, shiftCount; @@ -3244,12 +3244,12 @@ int64 float64_to_int64(float64 a, float_status *status) | returned. *----------------------------------------------------------------------------*/ -int64 float64_to_int64_round_to_zero(float64 a, float_status *status) +int64_t float64_to_int64_round_to_zero(float64 a, float_status *status) { flag aSign; int_fast16_t aExp, shiftCount; uint64_t aSig; - int64 z; + int64_t z; a = float64_squash_input_denormal(a, status); aSig = extractFloat64Frac( a ); @@ -4864,7 +4864,7 @@ int32 floatx80_to_int32_round_to_zero(floatx80 a, float_status *status) | overflows, the largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 floatx80_to_int64(floatx80 a, float_status *status) +int64_t floatx80_to_int64(floatx80 a, float_status *status) { flag aSign; int32 aExp, shiftCount; @@ -4904,12 +4904,12 @@ int64 floatx80_to_int64(floatx80 a, float_status *status) | sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 floatx80_to_int64_round_to_zero(floatx80 a, float_status *status) +int64_t floatx80_to_int64_round_to_zero(floatx80 a, float_status *status) { flag aSign; int32 aExp, shiftCount; uint64_t aSig; - int64 z; + int64_t z; aSig = extractFloatx80Frac( a ); aExp = extractFloatx80Exp( a ); @@ -5933,7 +5933,7 @@ int32 float128_to_int32_round_to_zero(float128 a, float_status *status) | largest integer with the same sign as `a' is returned. *----------------------------------------------------------------------------*/ -int64 float128_to_int64(float128 a, float_status *status) +int64_t float128_to_int64(float128 a, float_status *status) { flag aSign; int32 aExp, shiftCount; @@ -5976,12 +5976,12 @@ int64 float128_to_int64(float128 a, float_status *status) | returned. *----------------------------------------------------------------------------*/ -int64 float128_to_int64_round_to_zero(float128 a, float_status *status) +int64_t float128_to_int64_round_to_zero(float128 a, float_status *status) { flag aSign; int32 aExp, shiftCount; uint64_t aSig0, aSig1; - int64 z; + int64_t z; aSig1 = extractFloat128Frac1( a ); aSig0 = extractFloat128Frac0( a ); diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index ded34eb..b49d5fb 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -104,7 +104,6 @@ typedef int8_t int8; typedef unsigned int uint32; typedef signed int int32; typedef uint64_t uint64; -typedef int64_t int64; #define LIT64( a ) a##LL @@ -380,10 +379,10 @@ int32 float32_to_int32(float32, float_status *status); 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 float32_to_int64(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); -int64 float32_to_int64_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); float128 float32_to_float128(float32, float_status *status); @@ -492,8 +491,8 @@ int32 float64_to_int32(float64, float_status *status); int32 float64_to_int32_round_to_zero(float64, float_status *status); uint32 float64_to_uint32(float64, float_status *status); uint32 float64_to_uint32_round_to_zero(float64, float_status *status); -int64 float64_to_int64(float64, float_status *status); -int64 float64_to_int64_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); float32 float64_to_float32(float64, float_status *status); @@ -598,8 +597,8 @@ extern const float64 float64_default_nan; *----------------------------------------------------------------------------*/ int32 floatx80_to_int32(floatx80, float_status *status); int32 floatx80_to_int32_round_to_zero(floatx80, float_status *status); -int64 floatx80_to_int64(floatx80, float_status *status); -int64 floatx80_to_int64_round_to_zero(floatx80, float_status *status); +int64_t floatx80_to_int64(floatx80, float_status *status); +int64_t floatx80_to_int64_round_to_zero(floatx80, float_status *status); float32 floatx80_to_float32(floatx80, float_status *status); float64 floatx80_to_float64(floatx80, float_status *status); float128 floatx80_to_float128(floatx80, float_status *status); @@ -683,8 +682,8 @@ extern const floatx80 floatx80_default_nan; *----------------------------------------------------------------------------*/ int32 float128_to_int32(float128, float_status *status); int32 float128_to_int32_round_to_zero(float128, float_status *status); -int64 float128_to_int64(float128, float_status *status); -int64 float128_to_int64_round_to_zero(float128, float_status *status); +int64_t float128_to_int64(float128, float_status *status); +int64_t float128_to_int64_round_to_zero(float128, float_status *status); float32 float128_to_float32(float128, float_status *status); float64 float128_to_float64(float128, float_status *status); floatx80 float128_to_floatx80(float128, float_status *status); diff --git a/target-mips/msa_helper.c b/target-mips/msa_helper.c index 5dd3da6..b42b23f 100644 --- a/target-mips/msa_helper.c +++ b/target-mips/msa_helper.c @@ -1615,7 +1615,7 @@ static inline float16 float16_from_float32(int32 a, flag ieee, return a < 0 ? (f_val | (1 << 15)) : f_val; } -static inline float32 float32_from_float64(int64 a, float_status *status) +static inline float32 float32_from_float64(int64_t a, float_status *status) { float32 f_val; @@ -1722,9 +1722,9 @@ static inline int16_t float32_to_q16(float32 a, float_status *status) static inline int32 float64_to_q32(float64 a, float_status *status) { - int64 q_val; - int64 q_min = 0xffffffff80000000LL; - int64 q_max = 0x000000007fffffffLL; + int64_t q_val; + int64_t q_min = 0xffffffff80000000LL; + int64_t q_max = 0x000000007fffffffLL; int ieee_ex; @@ -1742,7 +1742,7 @@ static inline int32 float64_to_q32(float64 a, float_status *status) if (ieee_ex & float_flag_overflow) { float_raise(float_flag_inexact, status); - return (int64)a < 0 ? q_min : q_max; + return (int64_t)a < 0 ? q_min : q_max; } /* conversion to integer */ @@ -1756,7 +1756,7 @@ static inline int32 float64_to_q32(float64 a, float_status *status) set_float_exception_flags(ieee_ex & (~float_flag_invalid) , status); float_raise(float_flag_overflow | float_flag_inexact, status); - return (int64)a < 0 ? q_min : q_max; + return (int64_t)a < 0 ? q_min : q_max; } if (q_val < q_min) {