On Wed, 2007-02-14 at 10:38 +0200, Peter wrote: 
> On Wed, 14 Feb 2007, Geoffrey S. Mendelson wrote:
> 
> > On Wed, Feb 14, 2007 at 08:18:16AM +0200, Shachar Shemesh wrote:
> >
> >> Just for the record, it is not at all clear that, on modern CPUs, code
> >> you write in machine code (or even Assembly) will, in fact, run faster.
> >> The compiler can be quite good at opimizing your code for machine
> >> language expression, often much better than you would be.
> >
> > However, a good assembly langunage programer can write code the is "leaner
> > and meaner" than a compiler generates. In practical terms, a good C
> > programmer can often write code that is close, and parallel processing
> > CPUs where the order of instructions is critical a good compiler
> > can outdo an assembly language programmer.
> 
> HOW do you write 'lean and mean' assembly for a quad core board with AMD 
> or Pentium stepping (to be chosen at runtime) ?
> 
> Peter

Small example.
About two years ago I go bored, and decided to implement binary trees in
(x86) Assembly.
The end result was between 2-10 times faster then GCC (-O2/-O3)
generated code. (Depending the size of the tree)
The main reason being the lack of a 3 way comparison in C.
(above/below/equal)

Granted, the size of the asm code was ~10 times the comparable C code,
but in certain cases it is well worth. it.

BTW, certain operations (atomic operations/counters/etc) -require- asm
code.

- Gilboa


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to