Received: from [140.186.70.92] (port=50992 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pa9UP-0004bX-Gz for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:12:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pa9U2-0005Y0-RB for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:12:01 -0500 Received: from hall.aurel32.net ([88.191.126.93]:33537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pa9U2-0005XX-MY for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:11:38 -0500 Date: Tue, 4 Jan 2011 17:11:34 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH v2 2/8] softfloat: use bits32 instead of uint32 Message-ID: <20110104161134.GA15256@volta.aurel32.net> References: <1294154150-7528-1-git-send-email-aurelien@aurel32.net> <1294154150-7528-3-git-send-email-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 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 Tue, Jan 04, 2011 at 03:51:37PM +0000, Peter Maydell wrote: > On 4 January 2011 15:15, Aurelien Jarno wrote: > > Use bits32 instead of uint32 when manipulating floating point values > > directly for consistency reasons. > > I'm not convinced this patch is particularly worthwhile, especially since > Andreas is working on a patchset which will convert all the bits32 > uses back into uint32_t anyway, which is the direction to go if we > want to make the fpu/ code consistent about its type usage. I don't know in which direction we should go (bits32 or uint32_t), but we should go for more consistency. When everything is consistent, it's just a regex to go switch the type. > If you do want to do this, the commit message should be "uint32_t" > not "uint32" (which is a different type!) Correct. > >  int float32_is_quiet_nan( float32 a1 ) > >  { > >     float32u u; > > -    uint64_t a; > > +    bits32 a; > >     u.f = a1; > >     a = u.i; > >     return ( 0xFF800000 < ( a<<1 ) ); > > This change is actually changing the type: shouldn't it be bits64 ? Yes, I should have mentioned it in the changelog. For me this looks like a typo, as we are manipulating 32 bits values. Look at float32_is_signaling_nan(). > It seems a bit inconsistent to change softfloat-native.c:float32_is_quiet_nan() > but not softfloat-native.c:float64_is_quiet_nan() (which uses uint64_t). I guess you meant softfloat-native.c:float32_is_quiet_nan(). It looks like I missed this one, and that it should be changed too. > Personally I'd just drop this patch. I'll drop it for now and wait to see what Andreas offers. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net