From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28497 invoked by alias); 14 Oct 2003 13:06:33 -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 28490 invoked from network); 14 Oct 2003 13:06:32 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 14 Oct 2003 13:06:32 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9ED6VM06475 for ; Tue, 14 Oct 2003 09:06:31 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9ED6UL16073 for ; Tue, 14 Oct 2003 09:06:30 -0400 Received: from cygbert.vinschen.de (vpn50-21.rdu.redhat.com [172.16.50.21]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h9ED6SJ12375 for ; Tue, 14 Oct 2003 06:06:29 -0700 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 21C5358048; Tue, 14 Oct 2003 15:06:23 +0200 (CEST) Date: Tue, 14 Oct 2003 13:06:00 -0000 From: Corinna Vinschen To: gdb-patches@sources.redhat.com Subject: Re: [RFA] sh-tdep.c: Fix little endian problem with doubles Message-ID: <20031014130623.GZ14344@cygbert.vinschen.de> Reply-To: gdb-patches@sources.redhat.com Mail-Followup-To: gdb-patches@sources.redhat.com References: <20031007164256.GO29063@cygbert.vinschen.de> <16263.10472.942634.557769@localhost.redhat.com> <20031011085429.GA1981@cygbert.vinschen.de> <16266.46150.968896.729579@localhost.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16266.46150.968896.729579@localhost.redhat.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2003-10/txt/msg00445.txt.bz2 On Mon, Oct 13, 2003 at 10:18:46AM -0400, Elena Zannoni wrote: > Corinna Vinschen writes: > > Erm... sorry, I don't quite understand. An `else if' in conjuction > > with what `if'? Actually, the double case is handled normally in > > BE mode, it's only slightly different in LE mode in that the registers > > are swapped. The above code just makes the swap so I really don't see > > what the problem is. > > I mean: the function is structured so that there is pretty much a > clause for each possible type. Just add another one. I don't care if > there is a bit of code duplication. Something like that, or similar. > > else if (TYPE_CODE (type) == TYPE_CODE_FLT > && flt_argreg <= FLOAT_ARGLAST_REGNUM > && TYPE_LENGTH(type) == reg_size) > { do old stuff} > > else if (TYPE_CODE (type) == TYPE_CODE_FLT > && TYPE_LENGTH(type) == 2 * reg_size > && flt_argreg <= FLOAT_ARGLAST_REGNUM) > { > if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE) > {do something} > else > {do something else} > } > > else if (blah) Hmm, but you see that this messes up the code more than it cleans it up, don't you? The reg_size variable depends already on the decision, that we know if the argument goes in a general or a floating point register. So the outer if/else if's do have to be kept as they are, to be able to evaluate the register size correctly, and only then the code can react on the information that it's a regsize or 2*regsize argument. Except we drop the reg_size variable again, since we know that registers are always 4 byte anyway. > Actually, the test that (flt_argreg <= FLOAT_ARGLAST_REGNUM) may not > be sufficient anymore, because you are going to be using 2 registers, > and you could end up beyond FLOAT_ARGLAST_REGNUM. Or is it fine to > have the argument using the last float register, and the stack? Hmm, No. See the code right before the loop. > is sh_next_flt_argreg taking care that doesn't happen? Seems so. Yes. Consider that doubles are always passed in even register pairs. Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc.