Subject: Re: sparc64 xserver vs relocs
To: None <port-sparc64@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: port-sparc64
Date: 05/13/2005 03:34:31
On Thu, May 12, 2005 at 22:26:24 +0100, David Laight wrote:

> On Thu, May 12, 2005 at 04:05:52AM +0400, Valeriy E. Ushakov wrote:
> ....
> > and "bad" crosscompiled code looks like this:
> > 
> >     sethi   %hi(endtab), %i3
> >     ld      [%i3+%lo(endtab)+4], %l2
> 
> To correct something I said last night....
> 
> For sparc (I don't have a sparc64 book!) sethi sets the top 22 bits
> and the other instructions have a signed 13bit constant.
> 
> This means that the above code would be badly wrong if endtab were xxxffc.

But note that %lo extracts only 10 bottom bits, so as long as the
extra addend is small enough it's ok, as we have few free bits in
simm13 to overflow into.

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen