From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJRll-0005CZ-Cy for qemu-devel@nongnu.org; Thu, 05 Feb 2015 14:07:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJRlh-0006CB-Cf for qemu-devel@nongnu.org; Thu, 05 Feb 2015 14:07:17 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:32881 helo=cvs.linux-mips.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJRlh-00060I-4h for qemu-devel@nongnu.org; Thu, 05 Feb 2015 14:07:13 -0500 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S27012620AbbBETHGmq8Og (ORCPT ); Thu, 5 Feb 2015 20:07:06 +0100 Date: Thu, 5 Feb 2015 19:07:06 +0000 (GMT) Sender: "Maciej W. Rozycki" From: "Maciej W. Rozycki" In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH v2 6/7] softfloat: Add SoftFloat status `nan2008_mode' flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Leon Alrae , QEMU Developers , Aurelien Jarno , Thomas Schwinge On Thu, 5 Feb 2015, Peter Maydell wrote: > > Index: qemu-git-trunk/fpu/softfloat-specialize.h > > =================================================================== > > --- qemu-git-trunk.orig/fpu/softfloat-specialize.h 2014-12-11 22:42:41.128934304 +0000 > > +++ qemu-git-trunk/fpu/softfloat-specialize.h 2014-12-11 22:43:02.128938514 +0000 > > @@ -103,6 +109,10 @@ inline float16 float16_default_nan(STATU > > { > > #if defined(TARGET_ARM) > > return const_float16(0x7E00); > > +#elif SNAN_BIT_IS_VARIABLE > > + return STATUS(nan2008_mode) > > + ? const_float16(0x7E00) > > + : const_float16(0x7DFF); > > #elif SNAN_BIT_IS_ONE > > return const_float16(0x7DFF); > > #else > > Ah, I see now what the previous patch was in aid of. > > (I hadn't realised that the 2008 rev of IEEE754 nailed down > the SNaN/QNaN bit sense. That was always a dumb thing to have > left impdef, so good news I guess.) For MIPS the good side (or more likely intended) effect of the quiet bit being set for sNaNs was you could preinitialise hardware registers in any new FP context created to all-ones to have them trap uninitialised read accesses for both single and double (and for that matter paired-single) arithmetic. With the quiet bit being clear for sNaNs, there is no such a single encoding available, you have to choose if you want to trap for single (and paired-single) arithmetic only, double arithmetic only, or not at all. Maciej