re: Folk Theorem: Assemblers are superior to Compilers

jm@tao.univ-paris8.fr (Jean Mehat)
Wed, 27 Oct 1993 01:54:54 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 jm@tao.univ-paris8.fr (1993-10-27)
Re: Folk Theorem: Assemblers are superior to Compilers winikoff@munta.cs.mu.OZ.AU (1993-10-28)
Re: re: Folk Theorem: Assemblers are superior to Compilers prechelt@ira.uka.de (1993-10-27)
Re: Folk Theorem: Assemblers are superior mchapman@eis.k8.rt.bosch.de (1993-11-02)
| List of all articles for this month |

Newsgroups: comp.compilers
From: jm@tao.univ-paris8.fr (Jean Mehat)
Keywords: performance, assembler, comment
Organization: Compilers Central
References: 93-10-104
Date: Wed, 27 Oct 1993 01:54:54 GMT

Mike Elliott <elliottm@csulb.edu> wrote:
> Folk Theorems:
>[assember code is 1) faster and 2) smaller than compiler code]
>...
>So . . . compiler weenies of the world . . . can you help me out with
>citations which refute (or for that matter, support) these folk theorems?


I think these folk theorems may as well be true. I thought at first that
it may be false when the processor is designed for the compiler (like the
RISC delayed branch), but I think it's just that no one, except a
compiler's writer, cares to use delayed branch ; with reasonable training,
anyone should be able to use it like a compiler.


At least for C, what makes the compiler (relatively) inefficient is that
the functions are compiled independently. It forbids register allocation
across function calls. It constrains the compiler to make pessimistic
assumptions on the register usage by the called functions. Didn't Ritchie
accounted for a 10% loss when the Unix kernel was rewritten in C?


The real point is that it takes much longer to write an assembler program,
it's easier to make bugs, it's more difficult to understand and to
maintain. These are the good reasons to use a decent high level language.
--
Jean Mehat, universite de Paris 8 Vincennes a Saint Denis,
jm@tao.univ-paris8.fr, (1) 49 40 64 03, (1) 49 40 67 83 (fax)
[There are compilers that do interprocedure register allocation, but you
don't see a whole lot of them on PCs. Again, the irregular register set
complicates an already difficult task. -John]
--


Post a followup to this message

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