View previous topic :: View next topic |
Author |
Message |
Coin Coin n00b
Joined: 28 Oct 2008 Posts: 42
|
Posted: Tue Oct 28, 2008 11:10 am Post subject: [SOLVED] Cflags & e8400 & gcc-4.3 |
|
|
Hi,
I have an E8400 (which support sse 4.1) and I have emerge GCC 4.3.2 before emerging all I need for my desktop.
I'm just wondering which cflags I have to set
On the wiki, it mentions:
Code: | CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" |
and for GCC-4.3, it says to set core2, so now, my cflags are:
Code: | CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer" |
But, do these cflags activate sse4.1? Or do I have to set mssse3 and msse4.1 like this?
Code: | CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer -mssse3 -msse4.1" |
PS: Do I need to reemerge all after setting this? (emerge -e world)
PS2: I forgot to mention that I'm installing gentoo with 32bits support and not 64bits (I don't know if it will improve performances for basic uses (C/C++ & openoffice, ...))
(Sorry for my poor english)
Thanks
Last edited by Coin Coin on Tue Oct 28, 2008 1:18 pm; edited 1 time in total |
|
Back to top |
|
|
button n00b
Joined: 24 Dec 2007 Posts: 65 Location: Croatia
|
Posted: Tue Oct 28, 2008 12:15 pm Post subject: |
|
|
You don't need -mssse3; -march=core2 implies it. You do need to set -mssse4.1 since it is not enabled by default.
So, the settings for your CPU would be
Code: | CFLAGS="-march=core2 -O2 -pipe -mssse4.1" |
-fomit-frame-pointer is automatically enabled by -O2, so you don't need to specify it explicitly
EDIT: and yes, you need to reemerge all your packages for these settings to take effect |
|
Back to top |
|
|
Coin Coin n00b
Joined: 28 Oct 2008 Posts: 42
|
Posted: Tue Oct 28, 2008 12:27 pm Post subject: |
|
|
Ok, thanks
Last question: If I'm setting gentoo for core 2 duo with just 32 bits support, will sse4.1 be still used? Or do I have to switch to 64 bits? |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Tue Oct 28, 2008 1:09 pm Post subject: |
|
|
-msse4.1 will still be used on 32bits (x86 profile) if you set that option. But you should also add -fomit-frame-pointer then, it is only included in -O2 on architectures where it does not interfere with debugging (amd64 for example). As it does interfere on x86, you need to specify it. And make sure you use -O2 (letter O), not -02 (number zero)! _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
Coin Coin n00b
Joined: 28 Oct 2008 Posts: 42
|
Posted: Tue Oct 28, 2008 1:17 pm Post subject: |
|
|
Ok, thanks! (It's a letter and not a digit, but thanks anyway ^^) |
|
Back to top |
|
|
zyko l33t
Joined: 01 Jun 2008 Posts: 620 Location: Munich, Germany
|
Posted: Tue Oct 28, 2008 11:36 pm Post subject: |
|
|
>=gcc-4.2 has -march=native. This will detect the correct settings for you.
Quote: | PS: Do I need to reemerge all after setting this? (emerge -e world) |
Your new settings only affect packages you actually compiled with them. But you don't have to recompile anything, it will work either way. You shouldn't waste time on gcc and glibc. These two filter your CFLAGs internally, so recompiling them for this reason is pointless. Use quickpkg to generate binaries of gcc and glibc and then just run emerge -ek world -- this will recompile everything except for packages that are available as binaries. |
|
Back to top |
|
|
neonl Tux's lil' helper
Joined: 15 Jul 2007 Posts: 100 Location: Portugal
|
Posted: Wed Oct 29, 2008 10:37 pm Post subject: |
|
|
button wrote: | -fomit-frame-pointer is automatically enabled by -O2, so you don't need to specify it explicitly |
I don't want to doubt on you (i might be wrong) but i think -fomit-frame-pointer isn't part of O2 on those CPUs. It has to be enable 'separately'. In the GCC 4.3 manual it says:
Quote: | -O2 turns on all optimization flags specified by -O. It also turns on the following optimization flags:
-fthread-jumps
-falign-functions -falign-jumps
-falign-loops -falign-labels
-fcaller-saves
-fcrossjumping
-fcse-follow-jumps -fcse-skip-blocks
-fdelete-null-pointer-checks
-fexpensive-optimizations
-fgcse -fgcse-lm
-foptimize-sibling-calls
-fpeephole2
-fregmove
-freorder-blocks -freorder-functions
-frerun-cse-after-loop
-fsched-interblock -fsched-spec
-fschedule-insns -fschedule-insns2
-fstrict-aliasing -fstrict-overflow
-ftree-pre
-ftree-vrp
|
And in the -O part, it was specified that -fomit-frame-pointer was only enabled by default in machines where it doesn't interfere with debugging. Correct me if I'm wrong. |
|
Back to top |
|
|
button n00b
Joined: 24 Dec 2007 Posts: 65 Location: Croatia
|
Posted: Thu Oct 30, 2008 10:03 pm Post subject: |
|
|
neonl wrote: | And in the -O part, it was specified that -fomit-frame-pointer was only enabled by default in machines where it doesn't interfere with debugging. Correct me if I'm wrong. |
You're right. I wasn't aware of that. However, manpage is a little unclear here, because it doesn't state which architectures are affected. Does somebody have an info about that? |
|
Back to top |
|
|
|