Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Why is assembly more effecient than C?

Author: Jon Dart

Date: 07:06:42 09/28/98

Go up one level in this thread



On September 28, 1998 at 09:17:09, Robert Hyatt wrote:

>On September 28, 1998 at 03:01:19, Danniel Corbit wrote:
>
>>On September 27, 1998 at 18:18:25, Robert Hyatt wrote:
>>[snip]
>>>not exactly.  IE I can't imagine that a C compiler + optimizer can beat
>>>hand-tuned asm code, even if I write both the C and the asm code.  The
>>>guys that write the optimizers are good, but they aren't as good as
>>>someone that has been programming asm code for 30 years...
>>>
>>>The main reason everyone doesn't use ASM code is portability, *not*
>>>speed.
>>Risc C compilers can almost always outdo hand written code except for very small
>>snippets.  For CISC I agree with you, especially Intel x86, since there are so
>>many good Intel assembly programmers.  For thousands or millions of lines of C,
>>an equivalent ASM is very hard to produce for Risc machines.
>

The Intel processors now do many of the tricks that RISC processors have
traditionally done. It used to be that you could just get the processor manual,
add up the instruction times, and figure out how fast your code would run.
Now that's not true anymore. So writing optimal assembly language is
non-trivial, even for the Intel machines. (However, I would add that few
compilers do a really great job of register allocation - which is quite a bit
harder on Intel than other architectures - so that is one area where a human can
improve on the compiler).

--Jon



This page took 0.02 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.