On 1 Dec 2010 at 14:45, Ian King wrote:
I don't necessarily agree that assembler is
required "to get full
optimization of performance" today because of the work that's been
done over the past three decades or so in compiler design. Modern
compilers are written to take advantage of every trick available on
the target platform such as load hoisting, redundant load/store
elimination, loop unrolling, conditional execution and the like, over
varying code scopes that aren't apparent across a project of a
non-trivial size. Perhaps a really really good assembly language
programmer could produce code a tiny bit faster than a reasonably
well-written compiler could, but at what cost in development time?
I've seen where a good optimizing FORTRAN compiler can do
substantially better than the run of the mill assembly programmer
simply because the compiler can cast a wider net (e.g. global
optimizations, register allocation, etc.), knows more tricks and
usually does a better job of instruction scheduling than the average
programmer.
Of course, badly-written code in any language can thwart even the
best compiler's efforts to generate good code.
--Chuck