From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9f0V-0004wb-1S for qemu-devel@nongnu.org; Fri, 30 Sep 2011 11:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9f0T-0005hl-7f for qemu-devel@nongnu.org; Fri, 30 Sep 2011 11:28:10 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:53789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9f0T-0005hh-1j for qemu-devel@nongnu.org; Fri, 30 Sep 2011 11:28:09 -0400 Received: by wyh22 with SMTP id 22so1376703wyh.4 for ; Fri, 30 Sep 2011 08:28:08 -0700 (PDT) Sender: Richard Henderson Message-ID: <4E85E003.1030901@twiddle.net> Date: Fri, 30 Sep 2011 08:28:03 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1317230853-24970-1-git-send-email-peter.maydell@linaro.org> <1317230853-24970-5-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1317230853-24970-5-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/5] softfloat: Implement fused multiply-add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, patches@linaro.org On 09/28/2011 10:27 AM, Peter Maydell wrote: > /*---------------------------------------------------------------------------- > +| Select which NaN to propagate for a three-input operation. > +| For the moment we assume that no CPU needs the 'larger significand' > +| information. > +| Return values : 0 : a; 1 : b; 2 : c; 3 : default-NaN > +*----------------------------------------------------------------------------*/ > +#if defined(TARGET_ARM) > +static int pickNaNMulAdd(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, > + flag cIsQNaN, flag cIsSNaN, flag infzero STATUS_PARAM) ... > +#elif defined(TARGET_PPC) > +static int pickNaNMulAdd(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN, > + flag cIsQNaN, flag cIsSNaN, flag infzero STATUS_PARAM) > +{ The function declaration should be outside the #if, so that the interface is forcibly consistent across the platforms. > + cSig64 = (uint64_t)cSig << 39; This might be more readable as << (62 - 23), since you've just mentioned the explicit bit at bit 62 above. > + if (pSign == cSign) { > + /* Addition */ ... > + shift64RightJamming(zSig64, 32, &zSig64); > + return roundAndPackFloat32(zSign, zExp, zSig64 STATUS_VAR); > + } else { > + /* Subtraction */ ... > + shift64RightJamming(zSig64, 32, &zSig64); > + return roundAndPackFloat32(zSign, zExp, zSig64 STATUS_VAR); > + } > +} Push those two calls down after the IF? Similar comments wrt float64_muladd. But I don't see any actual logic errors wrt the handling of any of the edge cases. r~