From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40709 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pmtq0-0003vp-T9 for qemu-devel@nongnu.org; Tue, 08 Feb 2011 15:07:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pmtpz-00041V-Lk for qemu-devel@nongnu.org; Tue, 08 Feb 2011 15:07:01 -0500 Received: from mail-ew0-f45.google.com ([209.85.215.45]:41083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pmtpz-00041I-FH for qemu-devel@nongnu.org; Tue, 08 Feb 2011 15:06:59 -0500 Received: by ewy10 with SMTP id 10so3315549ewy.4 for ; Tue, 08 Feb 2011 12:06:58 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <4D50252A.2000100@st.com> <4D5182BF.9050002@st.com> Date: Tue, 8 Feb 2011 20:06:57 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH v3] Softfloat: Add support to softfloat to return floatxx_default_nan when, the corresponding target status flag is set. From: Peter Maydell Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christophe Lyon Cc: "qemu-devel@nongnu.org" , Aurelien Jarno On 8 February 2011 18:53, Peter Maydell wrote: > On 8 February 2011 17:51, Christophe Lyon wrote: >> - this means implementing float16ToCommonNaN, thus float16_is_signaling_nan() > > ...like that, yes. I have a slightly-tested implementation of these functions on my hard disk now; I'll try to finish testing them tomorrow (my testing is still falling over on some inputs to VCVTT/VCVTB). (cc: Aurelien for the softfloat style questions:) I think we should go ahead and define a float16 type. Also, at the moment the commonNaNToFloatX(floatYToCommonNaN()) idiom doesn't do anything to avoid signaling NaNs showing up in the output. On ARM this got fixed by having the helper.c wrappers call float*_maybe_silence_nan() but maybe we should do it in the generic softfloat code? ie instead of: if ( mantissa ) return make_float32( ( ( (bits32) a.sign )<<31 ) | 0x7F800000 | ( a.high>>41 ) ); else return float32_default_nan; do: float32 r = make_float32( ( ( (bits32) a.sign )<<31 ) | 0x7F800000 | ( a.high>>41 ) ); if (!mantissa) { /* target specific, !SNAN_BIT_IS_ONE targets probably * just set the QNAN bit (true for ARM, SPARC) * others likely return the default NaN ? */ } else { return float32_maybe_silence_nan(r); } I'm pretty sure the existing code is wrong for SPARC, for instance, which is supposed to return a float32 qNaN with just the QNAN bit set if it is presented with a float64 signalling NaN all of whose non-zero mantissa bits are at the bottom end and don't make it into the float32. (ARM dodges a bullet here because as it happens our float32 default_nan has only the QNAN bit set, but SPARC's has all the mantissa bits set.) Opinions? -- PMM