From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCxGF-0007D8-4J for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCxG5-0002VY-Mt for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:15:23 -0500 Received: from mail-qa0-x22c.google.com ([2607:f8b0:400d:c00::22c]:35391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCxG5-0002VR-EQ for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:15:13 -0500 Received: by mail-qa0-f44.google.com with SMTP id w5so10223080qac.17 for ; Mon, 10 Feb 2014 12:15:12 -0800 (PST) Sender: Richard Henderson Message-ID: <52F93349.8040106@twiddle.net> Date: Mon, 10 Feb 2014 12:15:05 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1391809763-11251-1-git-send-email-peter.maydell@linaro.org> <1391809763-11251-8-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1391809763-11251-8-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/8] softfloat: Support halving the result of muladd operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Peter Crosthwaite , patches@linaro.org, Michael Matz , Alexander Graf , Claudio Fontana , Dirk Mueller , Will Newton , Laurent Desnogues , =?ISO-8859-1?Q?Alex_Benn=E9e?= , kvmarm@lists.cs.columbia.edu, Christoffer Dall On 02/07/2014 01:49 PM, Peter Maydell wrote: > /* Zero plus something non-zero : just return the something */ > + if (flags & float_muladd_halve_result) { > + if (cExp == 0) { > + shift32RightJamming(cSig, 1, &cSig); > + } else if (cExp == 1) { > + shift32RightJamming(cSig, 1, &cSig); > + cSig |= (1 << 22); > + cExp = 0; > + } else { > + cExp--; > + } Surely better to just use roundAndPackFloat for this case. Looks to me that you're missing inexact and underflow exceptions at least. > + } > return packFloat32(cSign ^ signflip, cExp, cSig); > } r~