This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] adjust libgloss addresses for 64-bit


Maciej W. Rozycki wrote:
> On Fri, 15 Apr 2005, Eric Christopher wrote:
> 
> > > > > leaving us with a zero-extended value in a register which is
> > > > > unpredictable as far as the standard (and at least one chip out there)
> > > 
> > >  Hmm, 0x80000000 should be a valid XKUSEG address...
> > > 
> > 
> > Nothing wrong with the address, but it's loaded as:
> > 
> > ori $2,0x8000
> > dsll $2,$2,0x10
> > 
> > so it's zero extended and not sign extended as it should be.
> 
>  Of course it is zero-extended.  Otherwise it would be a different one; 
> actually in the CKSEG0 space rather than XKUSEG.  If you want the former, 
> what's wrong with 0xffffffff80000000? -- please keep in mind we are 
> talking about 64-bit addressing.

But people used to use "la $2, 0x80000000" in order to get a sign-extended
address. Loading two different addresses with the same code is at least
surprising. I see la in 64bit mode as backward compatibility legacy, and
this suggests not to change its behaviour.


Thiemo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]