From patchwork Fri Feb 19 16:36:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 8362761 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEEE49F2F0 for ; Fri, 19 Feb 2016 16:39:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0296D20527 for ; Fri, 19 Feb 2016 16:39:45 +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 0D74C20524 for ; Fri, 19 Feb 2016 16:39:44 +0000 (UTC) Received: from localhost ([::1]:53631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWo5n-0002rA-Gb for patchwork-qemu-devel@patchwork.kernel.org; Fri, 19 Feb 2016 11:39:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWo3A-0006Z5-3y for qemu-devel@nongnu.org; Fri, 19 Feb 2016 11:37:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWo38-0003d2-MC for qemu-devel@nongnu.org; Fri, 19 Feb 2016 11:37:00 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:38479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWo38-0003bu-FH for qemu-devel@nongnu.org; Fri, 19 Feb 2016 11:36:58 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.84) (envelope-from ) id 1aWo36-000338-F5 for qemu-devel@nongnu.org; Fri, 19 Feb 2016 16:36:56 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 19 Feb 2016 16:36:51 +0000 Message-Id: <1455899815-5648-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455899815-5648-1-git-send-email-peter.maydell@linaro.org> References: <1455899815-5648-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 2/6] fpu: Remove use of int_fast16_t in conversions to int16 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 Make the functions which convert floating point to 16 bit integer return int16_t rather than int_fast16_t, and correspondingly use int_fast16_t in their internal implementations where appropriate. (These functions are used only by the ARM target.) Signed-off-by: Peter Maydell Reviewed-by: Aurelien Jarno Message-id: 1453807806-32698-2-git-send-email-peter.maydell@linaro.org --- fpu/softfloat.c | 28 ++++++++++++++-------------- include/fpu/softfloat.h | 16 ++++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index cfa9787..f1fce53 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1616,7 +1616,7 @@ int32_t float32_to_int32_round_to_zero(float32 a, float_status *status) | returned. *----------------------------------------------------------------------------*/ -int_fast16_t float32_to_int16_round_to_zero(float32 a, float_status *status) +int16_t float32_to_int16_round_to_zero(float32 a, float_status *status) { flag aSign; int_fast16_t aExp, shiftCount; @@ -3149,7 +3149,7 @@ int32_t float64_to_int32_round_to_zero(float64 a, float_status *status) | returned. *----------------------------------------------------------------------------*/ -int_fast16_t float64_to_int16_round_to_zero(float64 a, float_status *status) +int16_t float64_to_int16_round_to_zero(float64 a, float_status *status) { flag aSign; int_fast16_t aExp, shiftCount; @@ -7117,10 +7117,10 @@ uint32_t float32_to_uint32_round_to_zero(float32 a, float_status *status) return res; } -int_fast16_t float32_to_int16(float32 a, float_status *status) +int16_t float32_to_int16(float32 a, float_status *status) { int32_t v; - int_fast16_t res; + int16_t res; int old_exc_flags = get_float_exception_flags(status); v = float32_to_int32(a, status); @@ -7137,10 +7137,10 @@ int_fast16_t float32_to_int16(float32 a, float_status *status) return res; } -uint_fast16_t float32_to_uint16(float32 a, float_status *status) +uint16_t float32_to_uint16(float32 a, float_status *status) { int32_t v; - uint_fast16_t res; + uint16_t res; int old_exc_flags = get_float_exception_flags(status); v = float32_to_int32(a, status); @@ -7157,10 +7157,10 @@ uint_fast16_t float32_to_uint16(float32 a, float_status *status) return res; } -uint_fast16_t float32_to_uint16_round_to_zero(float32 a, float_status *status) +uint16_t float32_to_uint16_round_to_zero(float32 a, float_status *status) { int64_t v; - uint_fast16_t res; + uint16_t res; int old_exc_flags = get_float_exception_flags(status); v = float32_to_int64_round_to_zero(a, status); @@ -7210,10 +7210,10 @@ uint32_t float64_to_uint32_round_to_zero(float64 a, float_status *status) return res; } -int_fast16_t float64_to_int16(float64 a, float_status *status) +int16_t float64_to_int16(float64 a, float_status *status) { int64_t v; - int_fast16_t res; + int16_t res; int old_exc_flags = get_float_exception_flags(status); v = float64_to_int32(a, status); @@ -7230,10 +7230,10 @@ int_fast16_t float64_to_int16(float64 a, float_status *status) return res; } -uint_fast16_t float64_to_uint16(float64 a, float_status *status) +uint16_t float64_to_uint16(float64 a, float_status *status) { int64_t v; - uint_fast16_t res; + uint16_t res; int old_exc_flags = get_float_exception_flags(status); v = float64_to_int32(a, status); @@ -7250,10 +7250,10 @@ uint_fast16_t float64_to_uint16(float64 a, float_status *status) return res; } -uint_fast16_t float64_to_uint16_round_to_zero(float64 a, float_status *status) +uint16_t float64_to_uint16_round_to_zero(float64 a, float_status *status) { int64_t v; - uint_fast16_t res; + uint16_t res; int old_exc_flags = get_float_exception_flags(status); v = float64_to_int64_round_to_zero(a, status); diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 575a739..624ed61 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -362,10 +362,10 @@ extern const float16 float16_default_nan; /*---------------------------------------------------------------------------- | Software IEC/IEEE single-precision conversion routines. *----------------------------------------------------------------------------*/ -int_fast16_t float32_to_int16(float32, float_status *status); -uint_fast16_t float32_to_uint16(float32, float_status *status); -int_fast16_t float32_to_int16_round_to_zero(float32, float_status *status); -uint_fast16_t float32_to_uint16_round_to_zero(float32, float_status *status); +int16_t float32_to_int16(float32, float_status *status); +uint16_t float32_to_uint16(float32, float_status *status); +int16_t float32_to_int16_round_to_zero(float32, float_status *status); +uint16_t float32_to_uint16_round_to_zero(float32, float_status *status); int32_t float32_to_int32(float32, float_status *status); int32_t float32_to_int32_round_to_zero(float32, float_status *status); uint32_t float32_to_uint32(float32, float_status *status); @@ -474,10 +474,10 @@ extern const float32 float32_default_nan; /*---------------------------------------------------------------------------- | Software IEC/IEEE double-precision conversion routines. *----------------------------------------------------------------------------*/ -int_fast16_t float64_to_int16(float64, float_status *status); -uint_fast16_t float64_to_uint16(float64, float_status *status); -int_fast16_t float64_to_int16_round_to_zero(float64, float_status *status); -uint_fast16_t float64_to_uint16_round_to_zero(float64, float_status *status); +int16_t float64_to_int16(float64, float_status *status); +uint16_t float64_to_uint16(float64, float_status *status); +int16_t float64_to_int16_round_to_zero(float64, float_status *status); +uint16_t float64_to_uint16_round_to_zero(float64, float_status *status); int32_t float64_to_int32(float64, float_status *status); int32_t float64_to_int32_round_to_zero(float64, float_status *status); uint32_t float64_to_uint32(float64, float_status *status);