Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: assembler vs. C

Author: leonid

Date: 17:48:17 11/08/99

Go up one level in this thread


On November 08, 1999 at 14:55:47, Ratko V Tomic wrote:

>> I agree that a good compiler (like MSVC) produces code on par with a good
>> assembly coder.
>
>Not even close. Namely, what you were comparing was:
>
>> I too have studied the code listings and tried to improve
>> it. Generally, there are only one or two instructions that can be tweeked,
>> and the speed up have never been large enough to be really measureable.
>
>That is not assembly coding (much less a good assembly coding) but trying to
>hand-simulate a C compiler (and as you noted, that's mostly a waste of time).
>
>The native assembly program (not a tweaked C compiler output) is for any
>resonably complex data manipulation (i.e. for other than just copying arguments
>to struct fields or pushing arguments and calling a function or other simple
>stuff) at least couple times faster than a compiler's output. In my consulting
>work I had over years optimized many times existent C/C++ code (for graphics,
>compression, encryption, search) by switching to the native assembly language
>algorithms in the critical portions of the task, ending up with 3-5 times faster
>critical sections.
>
>When you tailor the algorithm to the CPU architecture, you can use it much
>better, knowing well its strenghts and its limitations, than if you tailor it to
>a virtual C architecture and the compiler mechanically translates it to the
>actual CPU model.

Your remark  is completely justified. I speak about writing the code through the
stand alone Assembler and not using the "on-line" assembler that is very often
incomplete and weak. I remember using the Assembler in Pascal 7 and it had no
capacity to use the 32 bits registers. It was produced around 1992. 32 bits
chips existed well before this date. Assembler in that Pascal was good only up
to 286 chip.

Leonid.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

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