Re: A86: [OT] C Compilers


[Prev][Next][Index][Thread]

Re: A86: [OT] C Compilers




This can be true, with _modern_ compilers on _modern_ processors.  The
Watcom C/C++ compiler, for example, will produce the best code of any
compiler available for the PC (at least up through Pentium I's...I've heard
that the latest versions of DJGPP are much better than before, and the
latest versions of VC++ will produce code on par with Watcom).

If an assembly programmer is new to asm, or new to the processor, it is
quite possible for a good compiler to produce better code than a human.
This holds more true the more advanced processors get, due to them having
many, many registers (the new 64-bit Alpha designed for running NT have
something like 200 full 64 big registers!) and multiple instruction
execution pipelines.  If you are writing 386 equivalent code for a Pentium
class processor, a compiler that uses both the U and V pipes will most
likely produce better code.

This is far from true on a simple processor such as the Z80, that has a
large instruction set (versus a small instruction set on a RISC class
processor) and limited registers.  A compiler will under no circumstances be
able to beat an asm programmer (unless the programmer has no clue what
they're doing and are very stupid :)

That's not the point, anyway.  The TI-86 is for programming in assembly, not
in C.  A C compiler will produce bloated, slow programs for it.  This is not
desirable at all.  On the PC, however, use of a compiler is just plain
smart.  It'd take years to write anything huge entirely in asm, due to the
complexity of it.  Of course, this is why every new processor and computer
improvement results in slower, buggier programs.  But such is life.  On the
TI-86, I have the chance to "do the right thing", so I'm not going to change
that.  ;-)

> Well, folks.  I'm looking at my C++ book right now and reading about
> modern C++ compiled code vs. modern Assembler code.  Basically it
> says that nowadays, C++ compilers have become so damned efficient
> that quite often they write better assembler code equivalents than
> people do.  So.  What say ye to that, hm?  =)




References: