Mail Archives: djgpp/2000/01/19/17:43:13
Eli Zaretskii wrote:
> On 18 Jan 2000, Dieter Buerssner wrote:
>
> > My CPU is AMD K6-2 266.
>
> I don't know anything about K6. AFAIK, GCC's code is optimized
> towards Intel's recommendations; I don't know how well these fit K6.
>
> > gcc 2.9.2: flags -fomit-frame-pointer -ffast-math + indicated flags
>
> You mean 2.95.2, right?
>
> > -On -mcpu=k6 -On -march=k6
> > -O 86383 92070 92070
> > -O2 85852 86966 87009
> > -O3 81476 89791 89814
> > -O6 81421 89833 89818
> >
> > In all three cases -O produces the fastest code.
>
> The differences are small enough to be explained by alignment.
I agree with Eli. A very important point here is your CPU. AMD K6 CPUs have a
very huge problem with code aligned to 0x*C addresses. If the entry point of a
loop is there you are lost. As newer verions of gcc usually have better aligment
chances you hit a 0x*C (4 bytes aligned addres) increases.
Take a look to my http://www.geocities.com/SiliconValley/Vista/6552/compila.html
page, it have some interesting information about gcc optimizations.
Honza was doing a very good job adding optimizations for K6, but they are only
in the experimental branch of gcc.
I have a copy of gcc 2.96, it changes some interesting things in the
optimization, lamentably I didn't have the time to merge Honza patches to it and
see the performance increase but according to his reports K6 gets a very good
boost making gcc 2.96 the best compiler for K6 ;-)
You can play with the new switches found in gcc 2.95 to fine tune the aligment
(you can individually control loops, jumps, etc.).
SET
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
- Raw text -