From nobody Thu May 2 13:21:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486148510463966.3529691731949; Fri, 3 Feb 2017 11:01:50 -0800 (PST) Received: from localhost ([::1]:36417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZj7D-0008Cb-TL for importer@patchew.org; Fri, 03 Feb 2017 14:01:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZj56-0006w5-Ay for qemu-devel@nongnu.org; Fri, 03 Feb 2017 13:59:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZj55-0007Sv-Ch for qemu-devel@nongnu.org; Fri, 03 Feb 2017 13:59:36 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:48403) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZj55-0007Sg-61; Fri, 03 Feb 2017 13:59:35 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1cZj52-0002jc-6F; Fri, 03 Feb 2017 18:59:32 +0000 From: Peter Maydell To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Date: Fri, 3 Feb 2017 18:59:31 +0000 Message-Id: <1486148371-11692-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH] softfloat: Use correct type in float64_to_uint64_round_to_zero() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In float64_to_uint64_round_to_zero() a typo meant that we were taking the uint64_t return value from float64_to_uint64() and putting it into an int64_t variable before returning it as uint64_t again. Use uint64_t instead of pointlessly casting it back and forth to int64_t. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- Spotted while reading the code... fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index c295f31..218b375 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -7386,7 +7386,7 @@ uint64_t float64_to_uint64_round_to_zero(float64 a, f= loat_status *status) { signed char current_rounding_mode =3D status->float_rounding_mode; set_float_rounding_mode(float_round_to_zero, status); - int64_t v =3D float64_to_uint64(a, status); + uint64_t v =3D float64_to_uint64(a, status); set_float_rounding_mode(current_rounding_mode, status); return v; } --=20 2.7.4