Re: Folk Theorem: Assemblers are superior to Compilers

cliffc@rice.edu (Cliff Click)
Wed, 27 Oct 1993 16:47:31 GMT

          From comp.compilers

Related articles
Folk Theorem: Assemblers are superior to Compilers elliottm@csulb.edu (1993-10-24)
Re: Folk Theorem: Assemblers are superior to Compilers dmartin@andy.bgsu.edu (1993-10-26)
Re: Folk Theorem: Assemblers are superior to Compilers napi@cs.indiana.edu (Mohd Hanafiah Abdullah) (1993-10-26)
Folk Theorem: Assemblers are superior to Compilers ssimmons@convex.com (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers vick@wotangate.sc.ti.com (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers leichter@thorium.rutgers.edu (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers cliffc@rice.edu (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers macrakis@osf.org (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers amn@ubik.demon.co.uk (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers synaptx!thymus!daveg@uunet.UU.NET (Dave Gillespie) (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers winikoff@munta.cs.mu.OZ.AU (1993-10-28)
Re: Folk Theorem: Assemblers are superior to Compilers prener@watson.ibm.com (1993-10-28)
Folk Theorem: Assemblers are superior to Compilers Mark_Prince@gec-epl.co.uk (1993-10-28)
[21 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: cliffc@rice.edu (Cliff Click)
Keywords: performance, assembler
Organization: Center for Research on Parallel Computations
References: 93-10-104
Date: Wed, 27 Oct 1993 16:47:31 GMT

elliottm@csulb.edu (Mike Elliott) writes:
> Folk Theorems
>[assembler code is 1) faster and 2) smaller than compiler code]


I should know better than to jump into such a flame-inducing question as
this, but here goes:


1) Sometimes compilers are better than humans (Assembly):
      Compilers do all their optimizations all the time.
      Compilers don't make mistakes (although compiler writers do :-).
      Compilers can take the time and effort to look over the entire program,
          or at least really big chunks of it.


      Common examples: Compiling Fortran, C/C++,etc to a modern RISC (Mips,
                                        Alpha, RS/6000, etc).


2) Sometimes humans (Assembly) are better than compilers:
      Compilers only know what compiler writers teach 'em;
          other humans may know that for this problem instance an otherwise
          illegal transformation is legal.
      Various compiler optimizations are geared toward regular register and
          instruction sets; compiler writers have not learned how to handle well
          the irregular register sets of some machines.
      Compilers solve a particular problem: translating a HLL to machine code.
          Sometimes humans want to solve a different problem (i.e., knowing the
          EXACT number of cycles a particular stretch of code takes so we can
          count on it being done before the next interrupt).


      Common examples: squeezing the last drop of performance out of a Cray,
                                        making an i860 do anything with it's pipeline, writing
                                        hard-real-time code.


Cliff
--
cliffc@cs.rice.edu -- Massively Scalar Compiler Group, Rice University
--


Post a followup to this message

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