From patchwork Mon Sep 24 16:28:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 186485 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9781C2C0083 for ; Tue, 25 Sep 2012 02:29:00 +1000 (EST) Received: from localhost ([::1]:51980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBWk-0007Ap-Or for incoming@patchwork.ozlabs.org; Mon, 24 Sep 2012 12:28:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBWb-00078u-60 for qemu-devel@nongnu.org; Mon, 24 Sep 2012 12:28:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGBWV-0003Wq-8H for qemu-devel@nongnu.org; Mon, 24 Sep 2012 12:28:49 -0400 Received: from 38.0.169.217.in-addr.arpa ([217.169.0.38]:54976 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGBWV-0003Vb-1b; Mon, 24 Sep 2012 12:28:43 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1TGBWN-0003RO-1c; Mon, 24 Sep 2012 17:28:35 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 24 Sep 2012 17:28:35 +0100 Message-Id: <1348504115-13203-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 217.169.0.38 Cc: qemu-trivial@nongnu.org, patches@linaro.org Subject: [Qemu-devel] [PATCH] fpu/softfloat.c: Remove pointless shift of always-zero value 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In float16_to_float32, when returning an infinity, just pass zero as the mantissa argument to packFloat32(), rather than shifting a value which we know must be zero. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Aurelien Jarno --- Spotted by the clang static analyzer. This brings this code into line with the other float-to-float conversion functions and was probably a harmless cut-n-paste error from the normal-return codepath. fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index b29256a..01a28ca 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -3007,7 +3007,7 @@ float32 float16_to_float32(float16 a, flag ieee STATUS_PARAM) if (aSig) { return commonNaNToFloat32(float16ToCommonNaN(a STATUS_VAR) STATUS_VAR); } - return packFloat32(aSign, 0xff, aSig << 13); + return packFloat32(aSign, 0xff, 0); } if (aExp == 0) { int8 shiftCount;