public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Eric Christopher <echristo@redhat.com>
To: Paul Koning <pkoning@equallogic.com>
Cc: cgd@broadcom.com, newlib@sources.redhat.com, binutils@sources.redhat.com
Subject: Re: [patch] modify crt0.S for 64-bit address targets
Date: Wed, 06 Apr 2005 21:35:00 -0000	[thread overview]
Message-ID: <1112823346.5534.2.camel@localhost.localdomain> (raw)
In-Reply-To: <16980.14602.380063.574194@gargle.gargle.HOWL>


> Anyway, ori is fine.  The sequence for LA is LUI then ORI, and LUI
> loads a sign-extended 32 bit value with zeroes in the low order.  So
> ORI is the easy way to fill in the low order.  The LUI is what ensures
> that the value is formatted correctly in 64 bit registers.
> 

I think "the sequence" is probably a bit much. Right now we're not doing
LUI, and merely going with load register because the code sequence looks
like this:

la t1,K0BASE

which has K0BASE defined to 0x80000000, so all we're really doing is
putting a value into a register and then doing work off of that.

Really, I suppose we should just be putting the immediate in the
register, instead of treating it as an address, e.g.

li t1,K0BASE

which does cause the unpredictability problems to go away.

The code that's loading the value is load_register and it's the last set
of code in the function if you want to look.

> ADDI or ADDIU both sign-extend the 16-bit argument, so doing an LA
> with one of those, while possible, is more trouble because the LUI
> argument has to be adjusted up by 1 if the low half of the value to
> load is > 7fff.  With ORI, the argument is zero-extended so it the low
> bits aren't a consideration when picking the LUI argument

Fair enough, it was just a thought. I hate macros and so figuring out
what we really mean when "blah" is annoying.

-eric

  parent reply	other threads:[~2005-04-06 21:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1112768205.5493.2.camel@localhost.localdomain>
     [not found] ` <mailpost.1112768909.17118@news-sj1-1>
2005-04-06  6:49   ` cgd
2005-04-06 11:05     ` Maciej W. Rozycki
2005-04-06 11:22       ` Thiemo Seufer
2005-04-06 14:40         ` Maciej W. Rozycki
2005-04-06 18:37     ` Eric Christopher
2005-04-06 19:31       ` Paul Koning
2005-04-06 19:35         ` Ian Lance Taylor
2005-04-06 21:35         ` Eric Christopher [this message]
2005-04-06 18:51 cgd
2005-04-06 19:01 ` Eric Christopher

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=1112823346.5534.2.camel@localhost.localdomain \
    --to=echristo@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=cgd@broadcom.com \
    --cc=newlib@sources.redhat.com \
    --cc=pkoning@equallogic.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).