From patchwork Fri Jan 22 15:17:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 8091041 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 A4253BEEE5 for ; Fri, 22 Jan 2016 15:20:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEB8320457 for ; Fri, 22 Jan 2016 15:20:06 +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 C7681203AA for ; Fri, 22 Jan 2016 15:20:05 +0000 (UTC) Received: from localhost ([::1]:54334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdVN-0006QX-2o for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jan 2016 10:20:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdTA-0002VW-0p for qemu-devel@nongnu.org; Fri, 22 Jan 2016 10:17:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMdT8-0008NI-97 for qemu-devel@nongnu.org; Fri, 22 Jan 2016 10:17:47 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:59498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMdT8-0008Kk-1k for qemu-devel@nongnu.org; Fri, 22 Jan 2016 10:17:46 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1aMdSy-0003pP-N6 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:31 +0000 Message-Id: <1453475856-14682-3-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 2/7] fpu: Replace uint64 typedef with uint64_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 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. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Aurelien Jarno Acked-by: Leon Alrae Acked-by: James Hogan Message-id: 1452603315-27030-3-git-send-email-peter.maydell@linaro.org --- fpu/softfloat.c | 10 +++++----- include/fpu/softfloat.h | 9 ++++----- target-alpha/fpu_helper.c | 2 +- target-mips/kvm.c | 4 ++-- target-s390x/kvm.c | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 967da1c..c72eb5b 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1363,7 +1363,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; @@ -1414,7 +1414,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 ); @@ -1434,7 +1434,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; @@ -1705,7 +1705,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; @@ -1750,7 +1750,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) { signed char current_rounding_mode = status->float_rounding_mode; set_float_rounding_mode(float_round_to_zero, status); diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index b49d5fb..438804e 100644 --- a/include/fpu/softfloat.h +++ b/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 @@ -380,8 +379,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); @@ -493,8 +492,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); diff --git a/target-alpha/fpu_helper.c b/target-alpha/fpu_helper.c index b091aa8..0c65e1f 100644 --- a/target-alpha/fpu_helper.c +++ b/target-alpha/fpu_helper.c @@ -437,7 +437,7 @@ uint64_t helper_cvtqs(CPUAlphaState *env, uint64_t a) return float32_to_s(fr); } -/* Implement float64 to uint64 conversion without saturation -- we must +/* Implement float64 to uint64_t conversion without saturation -- we must supply the truncated result. This behaviour is used by the compiler to get unsigned conversion for free with the same instruction. */ diff --git a/target-mips/kvm.c b/target-mips/kvm.c index 12d7db3..ffc120d 100644 --- a/target-mips/kvm.c +++ b/target-mips/kvm.c @@ -277,7 +277,7 @@ static inline int kvm_mips_get_one_reg(CPUState *cs, uint64_t reg_id, return kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &cp0reg); } -static inline int kvm_mips_get_one_ulreg(CPUState *cs, uint64 reg_id, +static inline int kvm_mips_get_one_ulreg(CPUState *cs, uint64_t reg_id, target_ulong *addr) { int ret; @@ -294,7 +294,7 @@ static inline int kvm_mips_get_one_ulreg(CPUState *cs, uint64 reg_id, return ret; } -static inline int kvm_mips_get_one_reg64(CPUState *cs, uint64 reg_id, +static inline int kvm_mips_get_one_reg64(CPUState *cs, uint64_t reg_id, uint64_t *addr) { struct kvm_one_reg cp0reg = { diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 75a0e5d..b8222cc 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -1433,7 +1433,7 @@ static int kvm_s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch) cpu_physical_memory_write(offsetof(LowCore, ar_access_id), &ar_id, 1); } for (i = 0; i < 16; ++i) { - *((uint64 *)mem + i) = get_freg(&cpu->env, i)->ll; + *((uint64_t *)mem + i) = get_freg(&cpu->env, i)->ll; } memcpy(mem + 128, &cpu->env.regs, 128); memcpy(mem + 256, &cpu->env.psw, 16);