This is the mail archive of the mailing list for the GCC 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: Unrevied patches^3

> Date: Mon, 20 Oct 2003 00:31:13 -0700
> From: Richard Henderson <>

> On Sun, Oct 19, 2003 at 07:16:58PM -0700, Geoff Keating wrote:
> > I don't understand what you mean by "the high part is a load from the
> > GOT".  If you can load the high part from the GOT, why don't you just
> > load the whole address from there?
> It's a somewhat clever scheme to reduce the number of got entries
> for local data.  Instead of having one entry per referenced local,
> you have one entry per 64k "page".  Addresses are formed with
> 	lw  r2, %got_page(x)(gp)
> 	la  r3, %got_ofst(x)(r2)
> and of course the second insn can also be folded into memory 
> operations, so it's often effectively free.
> Of course, this *could* be represented just as (HIGH X).

OK, that makes sense.  In that case, the right thing to do is to
represent the first instruction as something like:

(set (reg r2) (mem ...)) (REG_EQUIV (high (symbol_ref "x")))

or, as in rth's suggestion, just do:

(set (reg r2) (high (symbol_ref "x")))

- Geoffrey Keating <>

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