Re: variable length instructions, was Chicken or the Egg?

michael@moria.de
12 Oct 2000 22:30:45 -0400

          From comp.compilers

Related articles
Re: variable length instructions, was Chicken or the Egg? debray@CS.Arizona.EDU (2000-10-12)
Re: variable length instructions, was Chicken or the Egg? michael@moria.de (2000-10-12)
Re: variable length instructions, was Chicken or the Egg? vbdis@aol.com (2000-10-15)
Re: variable length instructions, was Chicken or the Egg? cfc@world.std.com (Chris F Clark) (2000-10-18)
Re: variable length instructions, was Chicken or the Egg? dietrich@216.26.55.26 (Dietrich Epp) (2000-10-19)
Re: variable length instructions, was Chicken or the Egg? michael@moria.de (2000-10-19)
Re: variable length instructions, was Chicken or the Egg? david.thompson1@worldnet.att.net (David Thompson) (2000-10-19)
Re: variable length instructions, was Chicken or the Egg? michael@moria.de (2000-10-23)
| List of all articles for this month |

From: michael@moria.de
Newsgroups: comp.compilers
Date: 12 Oct 2000 22:30:45 -0400
Organization: Compilers Central
Keywords: linker, comment

In article 00-10-073 you write:
> [Generating instructions with variable length addresses is a well understood
> problem. The PDP-11 Unix assembler did it in about 1973, and there was
> a paper by Tom Szymanski in the CACM about that time. I always preferred
> the other approach, start with everything long, then shorten until there's
> nothing left to shorten, which has the advantage of being fail-safe, all
> of the intermediate stages being valid code. -John]


The reason for starting with short instructions is that you usually get a
smaller executable, e.g. if you have relative jumps that need to jump
over their own instruction size. If you start with a long instruction,
it increases the distance and may just cross the border of needing a long
instruction. On the other side, a short instruction decreases the jump
distance, which in turn lets a short instruction suffice to encode it.


If you encode arbitrary constants with variable length instructions, you
can construct worst cases for each algorithm, but AFAIR most constants
are relative addresses, where starting with short instructions is better.


Michael
[I know that it's theoretically possible for a program to have more than one
fixed point, but I've never seen it happen in real code. Have you? -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.