From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40975 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PN73U-0006eV-1A for qemu-devel@nongnu.org; Mon, 29 Nov 2010 11:58:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PN73S-0007t2-9w for qemu-devel@nongnu.org; Mon, 29 Nov 2010 11:58:19 -0500 Received: from mail.codesourcery.com ([38.113.113.100]:49636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PN73R-0007si-U4 for qemu-devel@nongnu.org; Mon, 29 Nov 2010 11:58:18 -0500 Date: Mon, 29 Nov 2010 08:58:16 -0800 From: Nathan Froyd Subject: Re: [Qemu-devel] [PATCH 07/12] ARM: Return correct result for float-to-integer conversion of NaN Message-ID: <20101129165816.GB8544@codesourcery.com> References: <1290538431-13170-1-git-send-email-peter.maydell@linaro.org> <1290538431-13170-8-git-send-email-peter.maydell@linaro.org> <20101129163842.GA8544@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On Mon, Nov 29, 2010 at 04:49:24PM +0000, Peter Maydell wrote: > On 29 November 2010 16:38, Nathan Froyd wrote: > > Why not just use: > > > > static int float32_is_any_nan(float32 x) > > { > >  return float32_is_nan(x) || float32_is_signaling_nan(x); > > } > > > > and likewise for the 64-bit case? > > That was what my first-pass patches did, but I > rewrote them this way because it seemed more > straightforward to just test for "is this a NaN" rather > than calling two other functions which each test for > "is this some subset of NaN space". > > I suppose you could argue that softfloat ought to > have _is_nan() [with the semantics you'd expect > from the function name, not the ones it currently has!], > _is_signalling_nan() and _is_quiet_nan() functions > built in, but it doesn't... I agree that the functions are poorly named. I think it'd be better to leave the bit-twiddling to the softfloat bits, though. There's precedent for the more verbose approach in other backends, too. -Nathan