[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KDE compilation optimization
From:       James Richard Tyrer <tyrerj () acm ! org>
Date:       2003-05-02 3:43:18
[Download RAW message or body]

Mosfet wrote:
> Usually I use "-march=athlon-tbird -O3 -mmmx -m3dnow." I don't think you need 
> to specify -mcpu if you specify -march.
> 
> There is a lot of debate about what makes better executables, -Os or -O3. I'd 
> be interested in how that works w/ KDE. Has anyone figured out the ideal 
> compiler flags?

It can get really messy.  The major issue is whether unrolling loops 
will make it faster or slower.

I would guess that on most machines with a L3 cache that unrolling the 
loops will NOT make it faster and might make it significantly slower.

When you unroll a loop you eliminate the jump (which may require more 
than one jump in the assembly code).  Jumps are bad because it means 
that you have to flush the pipeline in the processor.  However, 
processors are now designed to avoid this problem by predicting jumps. 
  So, if the processor predicts that the jump will be taken then the 
pipeline flush will only occur once (at the end of the loop).

When you execute a loop on a machine with L3 cache, after you go 
through it once, all of the code for the loop should be in L3 cache, 
but if it is unrolled you have cache misses on each iteration.

This is just off the top of my head -- I have no data.  If somebody 
wants to test it, I would try removing the -O3 from a library that 
uses it by default.

--
JRT



 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic