Subject: Re: amiga/stand/boot's txlt vs as -l
To: None <port-amiga@NetBSD.ORG>
From: Ignatios Souvatzis <is@beverly.rhein.de>
List: port-amiga
Date: 04/28/1997 23:51:12
Hi Ty,

> In article <2452e54d.u9t23e.e57e0-is@beverly.rhein.de> you write:
> > > NetBSD/m68k "as" supports a -l switch to shorten undefined references to
> > > 16 bits instead of 32.  Is this different that what the txlt program
> > 
> > txlt makes some more aggressive transforms, like, making all source
> > references pc-relative (we know we have unified code/data space). 
> 
> Thinking about it more, I guess "as -l" is kind of half-assed. Local
> and extern branches/jumps/calls and extern data refs will be short, but
> local code refs will be long, if I understand correctly what it does.

err...no...

that is:

- local branches are byte-wide if possible, word-wide if possible, anyway.

- global code segment references can be forced to be word-wide
pc-relative with "as -l".

What txlt does, is to transform absolute _data read_ references to
pc-relative ones, which as -l will make word-wide afterwards. This is only
possible because we _know_ we have a unified (and certainly smaller than
64k, or rater, 32k) code and data segment in the bootblock.

We save a small couple of bytes this way, which was crucial at some
point. Data _writes_ are still absolute, and will be transformed by the
special startup code. the M68K cpu doesnt allow pc-relative writes.

- I don't think that putting work into making gcc produce base-register
relative code will help with code size. I tried to tell it to do so, and
the overall size grew, because it had one register less to cache stuff
in... 

Regards,
	Ignatios Souvatzis