Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] sh-tdep.c: Fix little endian problem with doubles
Date: Tue, 14 Oct 2003 14:36:00 -0000	[thread overview]
Message-ID: <16268.3213.203430.515589@localhost.redhat.com> (raw)
In-Reply-To: <20031014130623.GZ14344@cygbert.vinschen.de>

Corinna Vinschen writes:
 > 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.
 > > 

Corinna, whatever. I'll clean it up myself. I am tired of arguing. Please
check it in.

elena


 > > 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.


  reply	other threads:[~2003-10-14 14:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-07 16:43 Corinna Vinschen
2003-10-09  0:39 ` Michael Snyder
2003-10-10 21:36 ` Elena Zannoni
2003-10-11  8:54   ` Corinna Vinschen
2003-10-13 14:07     ` Elena Zannoni
2003-10-14 13:06       ` Corinna Vinschen
2003-10-14 14:36         ` Elena Zannoni [this message]
2003-10-14 15:36           ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16268.3213.203430.515589@localhost.redhat.com \
    --to=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox