From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3316 invoked by alias); 4 Dec 2004 17:25:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3277 invoked from network); 4 Dec 2004 17:25:29 -0000 Received: from unknown (HELO cmailg1.svr.pol.co.uk) (195.92.195.171) by sourceware.org with SMTP; 4 Dec 2004 17:25:29 -0000 Received: from modem-177.utah.dialup.pol.co.uk ([62.137.95.177] helo=merlin.buzzard.freeserve.co.uk) by cmailg1.svr.pol.co.uk with esmtp (Exim 4.14) id 1Cadex-00052D-VQ for gdb-patches@sources.redhat.com; Sat, 04 Dec 2004 17:25:28 +0000 Received: from merlin (localhost [127.0.0.1]) by merlin.buzzard.freeserve.co.uk (8.12.11/8.12.11) with ESMTP id iB4HPLUo003928; Sat, 4 Dec 2004 17:25:21 GMT Message-Id: <200412041725.iB4HPLUo003928@merlin.buzzard.freeserve.co.uk> To: Richard Earnshaw , gdb-patches@sources.redhat.com From: Richard Earnshaw Subject: Re: RFA fix conversion of little-byte big-word floats to doublest In-reply-to: <200412041656.iB4Gui7G015398@merlin.buzzard.freeserve.co.uk> References: <200412041656.iB4Gui7G015398@merlin.buzzard.freeserve.co.uk> <20041204160054.GA3130@nevyn.them.org> <20041204154429.GA2764@nevyn.them.org> <200412041438.iB4Ec0cq017568@merlin.buzzard.freeserve.co.uk> <200412041546.iB4FkOnI002858@merlin.buzzard.freeserve.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 04 Dec 2004 17:33:00 -0000 X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on merlin.buzzard.freeserve.co.uk X-SW-Source: 2004-12/txt/msg00117.txt.bz2 On Sat, 04 Dec 2004 16:56:44 GMT, Richard Earnshaw wrote: > On Sat, 04 Dec 2004 11:00:54 EST, Daniel Jacobowitz > wrote: > > On Sat, Dec 04, 2004 at 03:46:24PM +0000, Richard Earnshaw wrote: > > > On Sat, 04 Dec 2004 10:44:30 EST, Daniel Jacobowitz > > > wrote: > > > > Could you summarize for me how this is supposed to work? This means > > > > that get_field treats littlebyte_bigword exactly the same as little. > > > > There's another copy of get_field in libiberty (I don't know why there > > > > are two) which treats it exactly the same as big, instead. I don't > > > > know how that works either, but it seems the two ought to agree. > > > > > > The caller has pre-converted the word order into a pure little-endian > > > format. See convert_format_to_doublest. > > > > > > Similar tricks are played on the reverse conversion. > > > > Huh; it looks like the copy in libiberty is just broken for this case. > > > > Is the code which does the swapping correct for the 96-bit format? > > It converts ABCD EFGH IJKL to EFGH ABCD IJKL; I would have guessed that > > pure little-endian representation would have been IJKL EFGH ABCD. > > I suspect it's completely broken. > > > The swap-back code only swaps the first two words also. > > > > It wouldn't surprise me in the least. > > > Meanwhile, patch is OK; I'd appreciate it if you could add a comment in > > get_field/put_field somewhere explaining what's going on. > > Will do. I've just been thinking. The current code (for both conversions to and from doublest) tries to work by normalizing the word order to match the byte order. This clearly makes things quite difficult when the number of words involved is variable. I think it would be a more tractable problem to change all this around so that the byte order is normalized to match the word order. This can be done by simply repeating a word-normalization step for each word in the value. Thoughts? R.