Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!ucbvax!decwrl!labrea!sri-unix!garth!smryan
From: smryan@garth.UUCP (Steven Ryan)
Newsgroups: comp.arch
Subject: Re: The VAX Always Uses Fewer Instructions [really: optimizing asms]
Message-ID: <824@garth.UUCP>
Date: 27 Jun 88 23:27:54 GMT
References: <6921@cit-vax.Caltech.Edu> <28200161@urbsdc> <10595@sol.ARPA> <270@laic.UUCP> <20424@beta.lanl.gov> <810@garth.UUCP> <2468@winchester.mips.COM>
Reply-To: smryan@garth.UUCP (Steven Ryan)
Organization: INTERGRAPH (APD) -- Palo Alto, CA
Lines: 27

>This opinion runs contrary to a considerable body of experience that
>supports the use of assemblers that perform certain classes of optimizations.

Presumably, this body of experience is based on running code through a parser
and then using an assembler to do the dirty bits. Other compilers do the
entire translation from source program to binary object file.

>                                           the assembler needs the
>directive that turns sdi optimization off and on around this

>1) an assembler can know a fair amount without any help:
>	c) Pointer-relative variables that have different offsets
>	( 4(r2), 8(r2)) are different.
It is hard for an assembler to know if loads/stores off of different base
registers interfere without knowing what region the base register points to
(this is something the compiler knows).

>2) Some things are only known by the compilers, and they can well have
>directives to pass that information along.

I suppose inside an optimising assembler is a small assembler struggling to
get out. Once all these declarations (a directive by any other name) are added,
it is still an assembler or just a very low level machine dependent language?

There is a time and place for really stupid software. Somewhere somebody has
to lookup opcodes and find a binary equivalent, and to translate symbolic
addresses into real addresses. Why not call an optimiser an optimiser and
assembler an assembler?