🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #9017

Re: Another question on the 80286- er, 68000 memory models

#9017
From: Peter da Silva
Date: Sat, 04 Jun 1988 12:43
44 lines
2482 bytes
In article ... mwm@eris.berkeley.edu (Mike Meyer) writes:
> In article <2069@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes:
> < [16 or 32-bit data addressing]

> <This sounds more like a job for Mr. Optimiser than something the programmer
> <should have to deal with.

> You see, the problems tend to be with globally allocated data,
> whose address isn't known until link time. So what's an optimiser
> supposed to do?

If you're using the variable frequently in a routine (say, in a loop) it should
store the address of the variable, or the base address of the array, in a
register. If not, then who cares how you get to it?

That's why I was talking about having registers allocated on the fly, instead
of dedicating A4 to ALL global data.

> < [16 or 32-bit code addressing]

> <And again, this is an optimisation that should be applied to all code...
> <[story about UNIX assembler optimising branches]

> Note: the PDP-11 "as" handled _branches_, not subroutine jumps.

True. But I'd hope that a compiler would be smarter than an assembler. I'm
not happy that it's just as smart and no smarter.

> On the other hand, subroutine jumps could be to routines that you
> don't have an address for yet (they may not even have been written yet
> :-). So once again, the optimiser is missing some important data.

Not at all. You apply this optimisation to the routines you know are local:
that will be in the same load module. You're going to want to make long jumps
outside that load module anyway, since it could be scatter-loaded anywhere.
You *do* want to scatter load: it can make the difference between having your
code run or not when memory is tight.

It's interesting to note that the Sun software for their RISC box does
code modifications like these in the linker.
-- 
-- Peter da Silva      `-_-'      ...!hoptoad!academ!uhnix1!sugar!peter
-- "Have you hugged your U wolf today?" ...!bellcore!tness1!sugar!peter
-- Disclaimer: These may be the official opinions of Hackercorp.
Technical Details
Message-ID: <2085@sugar.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!tness7!tness1!nuchat!sugar!peter
References: <8805182223.AA20918@cory.Berkeley.EDU> <2653@louie.udel.EDU> <10507@agate.BERKELEY.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!tness7!tness1!nuchat!sugar!peter
From: peter@sugar.UUCP (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Another question on the 80286- er, 68000 memory models
Message-ID: <2085@sugar.UUCP>
Date: 4 Jun 88 12:43:14 GMT
References: <8805182223.AA20918@cory.Berkeley.EDU> <2653@louie.udel.EDU> <10507@agate.BERKELEY.EDU>
Organization: Sugar Land UNIX - Houston, TX
Lines: 44