[patch] modify crt0.S for 64-bit address targets

Eric Christopher echristo@redhat.com
Wed Apr 6 18:37:00 GMT 2005

On Tue, 2005-04-05 at 23:46 -0700, cgd@broadcom.com wrote:
> (added cc: to binutils list.)
> Eric,
> My take on this is that the problem is **not** that addu/subu are
> incorrect, but rather that the address being loaded is not what's
> intended!
> The intended address (K0BASE) is 0xffffffff80000000, and based on your
> comments (and the detection of the UNPREDICTABLE condition), I believe
> that 0x0000000080000000 is being loaded instead.

Assuredly this is the case. I think the problem might be from using the
ori instead of addi for the address. ori zero extends the constant, addi
sign extends. IIRC all addresses should be sign extended and as such we
should be using addi here yes? I seem to recall that we changed this a
while back because the ori was some small amount faster.

Maciej? Thiemo? This ringing any bells?

> The address is a sign-extended 32-bit value, the addu/subu should be
> OK.

You are correct.


More information about the Newlib mailing list