Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Best CFLAGS for amd64 X2
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Mon Apr 17, 2006 6:23 pm    Post subject: Best CFLAGS for amd64 X2 Reply with quote

Hi. I wanted to know what you thought were the best CFLAGS / CXXFLAGS on a dual core athlon 64. For best I mean something whith good performance, maybe even a bit mad, don't really care about stability. 8)


Luca
Back to top
View user's profile Send private message
playfool
l33t
l33t


Joined: 01 Jun 2004
Posts: 688
Location: Århus, Denmark

PostPosted: Mon Apr 17, 2006 7:43 pm    Post subject: Reply with quote

-fomg-optimize
Back to top
View user's profile Send private message
vipernicus
Veteran
Veteran


Joined: 17 Jan 2005
Posts: 1462
Location: Your College IT Dept.

PostPosted: Mon Apr 17, 2006 9:10 pm    Post subject: Reply with quote

Here's mine:
Code:
CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS}  -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort"


And it runs smooth and fast as racecar silk.
_________________
Viper-Sources Maintainer || nesl247 Projects || vipernicus.org blog
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Mon Apr 17, 2006 9:20 pm    Post subject: Reply with quote

I lol.

Code:
-march=k8 -O2 -pipe
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Mon Apr 17, 2006 10:11 pm    Post subject: Reply with quote

Mine:
Quote:
CFLAGS="-O2 -march=k8 -fomit-frame-pointer -pipe -funroll-loops"
CXXFLAGS="-O2 -march=k8 -fomit-frame-pointer -pipe -funroll-loops"

_________________
Ep2.nl | Developers Community
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 7:25 am    Post subject: Reply with quote

vipernicus wrote:
Here's mine:
Code:
CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS}  -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort"


And it runs smooth and fast as racecar silk.


Will all those be OK with a 64 bit installation?
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Tue Apr 18, 2006 7:31 am    Post subject: Reply with quote

optiluca wrote:
vipernicus wrote:
Here's mine:
Code:
CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS}  -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort"


And it runs smooth and fast as racecar silk.


Will all those be OK with a 64 bit installation?


I doubt it. I highly suggest just going with -march=k8 -O2 -pipe.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 7:59 am    Post subject: Re: Best CFLAGS for amd64 X2 Reply with quote

Monkeh wrote:
optiluca wrote:
vipernicus wrote:
Here's mine:
Code:
CFLAGS="-march=athlon-xp"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -ftracer -fweb"
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CFLAGS="${CFLAGS} -ftree-vectorize"
CFLAGS="${CFLAGS} -falign-functions=64"
CFLAGS="${CFLAGS} -freorder-blocks-and-partition"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
CXXFLAGS="${CXXFLAGS} -fno-enforce-eh-specs"
#CXXFLAGS="${CXXFLAGS}  -fpermissive"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort"


And it runs smooth and fast as racecar silk.


Will all those be OK with a 64 bit installation?


I doubt it. I highly suggest just going with -march=k8 -O2 -pipe.

optiluca wrote:
For best I mean something whith good performance, maybe even a bit mad, don't really care about stability. 8) Luca


-O2 -pipe -march=k8 isn't very mad...
Back to top
View user's profile Send private message
GetCool
Guru
Guru


Joined: 23 Nov 2003
Posts: 324
Location: Madison, Wisconsin

PostPosted: Tue Apr 18, 2006 8:43 am    Post subject: Reply with quote

You can also safely add "-msse3" since all X2 processors support sse3.

So, a good, safe CFLAGS setting is:

Code:
CFLAGS="-march=k8 -O2 -pipe -msse3"


I suggest sticking with the above, as it is safe and stable. That is, if you can stand not having the "-omg-optimized" crap in there that everyone uses but makes absolutely no difference.

Also, remember to set your "MAKEOPTS" for your dual-core CPU:

Code:
MAKEOPTS="-j3"
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 8:47 am    Post subject: Reply with quote

What about -fomit-frame-pointer, -ftree-vectorize and -funroll-loops?? I've seen lots of people using them... Are they of any use?
Back to top
View user's profile Send private message
GetCool
Guru
Guru


Joined: 23 Nov 2003
Posts: 324
Location: Madison, Wisconsin

PostPosted: Tue Apr 18, 2006 9:33 am    Post subject: Reply with quote

optiluca wrote:
What about -fomit-frame-pointer, -ftree-vectorize and -funroll-loops?? I've seen lots of people using them... Are they of any use?


No. I used to play around with extra optimizations, and I never found them to make any difference whatsoever in any real-world application.

In the end I went back to the simple, safe configuration I mentioned above, which is plenty fast for everything (including gaming, compiling, and other hardware-intensive applications). I'm using an X2 3800+.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 9:46 am    Post subject: Reply with quote

Is there anything for faster app loading? I'm already using prelink, but all apps take more time to load than their windows counterparts...
Thanks for your help
Back to top
View user's profile Send private message
GetCool
Guru
Guru


Joined: 23 Nov 2003
Posts: 324
Location: Madison, Wisconsin

PostPosted: Tue Apr 18, 2006 11:41 am    Post subject: Reply with quote

optiluca wrote:
Is there anything for faster app loading? I'm already using prelink, but all apps take more time to load than their windows counterparts...
Thanks for your help


There isn't too much you can do beyond what you're already doing with prelink.

You might want to check the fragmentation level of your / filesystem, because if it is fragmented enough it can slow things down. If this is the case, you can make a stage4 backup, reformat and restore.

You could also try to limit swap usage, but my guess is that you aren't using it at all right now anyway, since you probably have enough RAM.

There are other crazy things you can do like mount certain directories to a ramdisk (there's a HOWTO somewhere around here), but I would advise against this, since it could end up causing you major problems.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 11:57 am    Post subject: Reply with quote

Ok... But why do apps take more time to load than in windows? In windows there is no noticeable difference between the 1st time the app is used and the others, in linux it's HUGE, expecially with firefox and openoffice. I'm preloading OO in Ram now, but I haven't found an equivalent solution with firefox... One last question: why are all WMs less responsive than windows? (the ultra-minimalist ones don't count)

PS I'm starting to sound like a Microsoft Employee :)
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Tue Apr 18, 2006 1:13 pm    Post subject: Reply with quote

I use -funroll-loops and I can see the advantages of it. Compilation is faster, applications using loops run faster, ...

About the WM question. I'm using XFCE and it's running fast as hell. I haven't installed Windows on this computer, so I can't really compair. But my Linux desktop is still running the same then when I just installed it. Windows runs a lot slower after 3 or 4 months.
_________________
Ep2.nl | Developers Community
Back to top
View user's profile Send private message
vipernicus
Veteran
Veteran


Joined: 17 Jan 2005
Posts: 1462
Location: Your College IT Dept.

PostPosted: Tue Apr 18, 2006 1:21 pm    Post subject: Reply with quote

The LDFLAGS are what makes the difference in startup times.
_________________
Viper-Sources Maintainer || nesl247 Projects || vipernicus.org blog
Back to top
View user's profile Send private message
playfool
l33t
l33t


Joined: 01 Jun 2004
Posts: 688
Location: Århus, Denmark

PostPosted: Tue Apr 18, 2006 2:07 pm    Post subject: Reply with quote

optiluca wrote:
What about -fomit-frame-pointer, -ftree-vectorize and -funroll-loops?? I've seen lots of people using them... Are they of any use?


-fomit-frame-pointer is implied on amd64

Quote:

You can also safely add "-msse3" since all X2 processors support sse3.


False, my AMD64 X2 4400+ reports:

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy

no sse3 support.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 2:53 pm    Post subject: Reply with quote

http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/33425.pdf
sse3 is supported...
Back to top
View user's profile Send private message
playfool
l33t
l33t


Joined: 01 Jun 2004
Posts: 688
Location: Århus, Denmark

PostPosted: Tue Apr 18, 2006 2:55 pm    Post subject: Reply with quote

optiluca wrote:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/33425.pdf
sse3 is supported...


The question then becomes why the kernel does not know this... that's honest to no god the raw output of my /proc/cpuinfo.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 4:00 pm    Post subject: Reply with quote

Mine's the same. But sse3 works...
Back to top
View user's profile Send private message
meax
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2004
Posts: 88
Location: Babylon

PostPosted: Tue Apr 18, 2006 4:00 pm    Post subject: Reply with quote

playfool wrote:
False, my AMD64 X2 4400+ reports:

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy

no sse3 support.

pni == sse3. See http://en.wikipedia.org/wiki/SSE3
_________________
Bullshit makes the flowers grow and that's beautiful.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Tue Apr 18, 2006 4:15 pm    Post subject: Reply with quote

vipernicus wrote:
The LDFLAGS are what makes the difference in startup times.


How?
Back to top
View user's profile Send private message
playfool
l33t
l33t


Joined: 01 Jun 2004
Posts: 688
Location: Århus, Denmark

PostPosted: Tue Apr 18, 2006 4:54 pm    Post subject: Reply with quote

meax wrote:
playfool wrote:
False, my AMD64 X2 4400+ reports:

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm cmp_legacy

no sse3 support.

pni == sse3. See http://en.wikipedia.org/wiki/SSE3


That clears it up, thank you.. I wonder why they strayed from the naming scheme.. marketing I guess.
Back to top
View user's profile Send private message
Monkeh
Veteran
Veteran


Joined: 06 Aug 2005
Posts: 1656
Location: England

PostPosted: Tue Apr 18, 2006 7:31 pm    Post subject: Reply with quote

optiluca wrote:
Is there anything for faster app loading? I'm already using prelink, but all apps take more time to load than their windows counterparts...
Thanks for your help


I'm using a 3700+ with the above CFLAGS and prelink. Firefox starts in about 0.2 of a second at FULL CPU load, compared to several seconds in Windows when idle.
Back to top
View user's profile Send private message
vipernicus
Veteran
Veteran


Joined: 17 Jan 2005
Posts: 1462
Location: Your College IT Dept.

PostPosted: Tue Apr 18, 2006 8:29 pm    Post subject: Reply with quote

optiluca wrote:
vipernicus wrote:
The LDFLAGS are what makes the difference in startup times.


How?


Big differences, nearly doubling startup time for me.
http://www.gentoo.org/proj/en/qa/asneeded.xml
_________________
Viper-Sources Maintainer || nesl247 Projects || vipernicus.org blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum