Re: Linux-asm (was A patch for linux 2.1.127)

Marc Lehmann (pcg@goof.com)
Sun, 22 Nov 1998 23:32:36 +0100


On Sat, Nov 21, 1998 at 02:56:41AM -0500, Albert D. Cahalan wrote:
> >> C will never run faster than assembly, since C gets converted to
> >
> > Wrong logic. Actually, its quite easy in many cases to write
> > faster C than assembly.
>
> No, it works like this:

Yes, what you said (quoted above) is still wrong ("never" should
give you a clue) ;)

> When the compiler improves, you can go back to step 1 if needed.

You didn't say its always possible to write assembly as fast as C (Which is
trivially true), you said "C will never run faster than assembly", and thats
plaing wrong, no?

And since its misleading to think so, I wrote a reply.

> > run faster then assembly, which, to the contrary, is often the case.
> If the C runs faster, the assembly was badly done or is very obsolete.

Also wrong. The (very nonobsolete and very good) assembly in the linux
kernel often is very slow on pentium chips and very fast on ppro (there are
often versions for both), or vice versa, neither chips are obsolete, btw.

> > Wrong. The performance improvement of implementing software in assembly
> > in the 386 days has completely vanished, and has even turned into a
> > loss of performance since compilers produce better code for pentium
> > (etc.) then i386 assembly programmers.
> >
> > (if you are concerned about the timespan, take 486 programmers and
> > pentium compilers)
>
> pgcc took how long to be written?

Has this anything to do with this argument??? Btw, pgcc has been available
since 2.7.2 was released, hacked versions of gcc to support pentii are
available since gcc-2.4.

> I think the Pentium Pro was out before gcc was hacked to optimize

Ah, you only thought so ;) This entirely depends on how you define "hacked".

> for the Pentium. There was plenty of time to write Pentium-optimized
> assembly while gcc was doing i386 and i486 optimizations only.

gcc was (and still is) in a very bad state. The time after 2.7.2 was
released is generally known as the biggest fiasco in the history of gcc.
Guess why we have egcs now, and an already obsoleted gcc-2.8.

Also, gcc is especially bad on register starved machines, like the x86, its
not particularly bad on other (more sane) architectures.

-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/