[patch] adjust libgloss addresses for 64-bit

Paul Koning pkoning@equallogic.com
Fri Apr 15 17:35:00 GMT 2005

>>>>> "Thiemo" == Thiemo Seufer <ths@networkno.de> writes:

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

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

Agreed.  Addresses are signed values on MIPS.  Dxx opcodes are 64 bit
operations; xx opcodes (when Dxx also exists) are 32 bit operations. 

So DLI loads a 64 bit int and LI a 32 bit int.  DLA loads a 64 bit
address and LA a 32 bit address.  So the operand of LA should be a
construct that is a valid 32 bit address (and 0x80000000 is one such)
and it should be expanded into instructions that produce a valid
representation of that address in a register (i.e., with sign
extension if the registers are 64 bits).


More information about the Newlib mailing list