This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] modify crt0.S for 64-bit address targets
- From: Eric Christopher <echristo at redhat dot com>
- To: cgd at broadcom dot com
- Cc: newlib at sources dot redhat dot com, binutils at sources dot redhat dot com
- Date: Wed, 06 Apr 2005 11:36:49 -0700
- Subject: Re: [patch] modify crt0.S for 64-bit address targets
- References: <1112768205.5493.2.camel@localhost.localdomain> <mailpost.1112768909.17118@news-sj1-1> <yov53bu4767a.fsf@xl-sj1-02.sj.broadcom.com>
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.
-eric