From: | Walter Banks <walter@bytecraft.com> |
Newsgroups: | comp.compilers,comp.lang.asm.x86 |
Date: | 30 Jun 1997 00:07:25 -0400 |
Organization: | Byte Craft Limited |
References: | 97-06-071 97-06-074 |
Keywords: | assembler, optimize |
Charles Fiterman wrote:
>
> The human should always win and here is why.
>
> First the human writes the whole thing in a high level language.
>
> Second he profiles it to find the hot spots where it spends
> its time.
>
> Third he has the compiler produce assembly for those small
> sections of code.
>
> Fourth he hand tunes them looking for tiny improvements over
> the machine generated code.
>
> The human wins because he can use the machine.
That algorithm will always win. However, take an non
trival assembly program and create algorithmically similar C
and the compiled results will very similiar often smaller.
Many of the compilers have reached the point where given
a non-trival problem and implementing it in a assembler
and in C the compiled code is very often better in both
size and execution time.
Your point is well taken. I have seen cases in some of the
compilers we have written where the compiler would generate
better code than I could. Mostly because the compiler remembered
all the side-effects of the instruction set as implemented by
the hardware.
Walter Banks
http://www.bytecraft.com
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.