delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/03/30/09:27:42

Date: Wed, 30 Mar 1994 8:53:53 -0500 (EST)
From: "Chris Mr. Tangerine Man Tate" <FIXER AT FAXCSL DOT DCRT DOT NIH DOT GOV>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: GCC optimization & target options?

I wrote:
 
>>> Also, there doesn't seem to be *any* difference in code size between
>>> using the -m486 and -mno-486 options to gcc.  Is this an artifact of
>>> the COFF file format, or is there really no difference?  Or is it just

Someone else wrote:
 
>> -m486 changes the ORDER of instructions.... there are very few instructions
>> that the 486 has that the 386 doesnt (2 or 3 I think) and those are really
>> only important when writing operating systems (or DOS extenders I spose).

Yet a third person wrote:

> It also substitutes some single instructions with 2 instructions that together 
> run faster on the 486.

I suppose I expected to see *some* difference in code size, although in
retrospect it's obviously not going to be like the difference between
'286 and '386 code, or '86 and '286 code.

(I'm used to Motorola processors; I just can't handle the vast differences
between the various Intel chips!  :-)

>>> On a similar note, is there a gcc out that does Pentium optmization
>>> yet?  I notice that the Info lists a bunch of PowerPC target-specific
>>> options, but no P5 options.
>> 
>> Intel is a ass.  (Apologies to Dickens).  Again, the Pentium doesn't have
>> that many new instructions; the difference is in the timing that changes
>> depending upon how you order the instructions.  With the Pentium, you can
>> schedule two instructions so that they are executed simultaneously (this
>> somewhat super scalar approach is what gives the pent some of it's speed
>> up).  Only certain instructions can be  executed simultaneously, however,
>> and Intel makes those who want to know that info sign non-disclosure forms.
>> Since GCC is available in source, it's kind of disclosed... therefore....

The true architecture description for the Pentium is non-disclosure?
You're right; Intel is an ass.  And foolish, to boot.  You can buy the
PowerPC architecture spec from Motorola for $10, and learn a lot more
than you ever wanted to know about pipeline stalls and instruction
dependancies.  That there is nothing similar available from Intel
smells suspiciously like FUD to me.  :-/

> In an article in DDJ last year, in an interview with a guy from Watcom, it was
> stated that optimising for the 486 in Watcom C/C++ 9.5 sped up code from 5-15%.
> DJGPP goes about 5% faster on average (code is also 5% bigger) but it really
> does depend on what your program is doing. Watcom optimising for the Pentium
> was stated to run 15-40% faster mainly due to keeping the pipeline full. This
> optimised code also ran slghtly faster than unoptimised code on the 486. On the
> 386 it didn't make any difference.
>
> I haven't tried Watcom against DJGPP but I'm told it does run faster but the
> comparison can't be made on a 486/Pentium opimisation basis alone.

I definitely recall seeing a Watcom compiler engineer talking about the
new Pentium optimizations that the implemented.  Apparently, the '486
*does* have some pipeline characteristics, and in fact the speedup of
Pentium-optimized code on the '486 was rather more than 'slight;' I
seem to remember a number like 10% faster than their previous '486
optimizations (which sounds like an 'oops' to me; it means they neglected
instruction rescheduling the first time around).  Answer:  optimize for
the Pentium all the time, if you can.

(If any of you have worked on MC68040's, there's a similar situation:
floating-point code optimized for the 68881 (the 68030's (and down)
math coprocessor) can be relatively slow on a 68040, since the '040's
on-chip coprocessor does certain things "the long way around."  The
solution is to optimize for the use of the '040's math unit; you get
slightly worse performance on the earlier chips, but much better
performance on the '040.  It's usually worth it.)

-- Chris Tate
   fixer AT faxcsl DOT dcrt DOT nih DOT gov

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019