Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Which CFLAGS to you use to install gentoo-x86 on Athlon64 ?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
SiggiS
n00b
n00b


Joined: 18 May 2004
Posts: 36
Location: Germany

PostPosted: Tue May 25, 2004 4:51 pm    Post subject: Which CFLAGS to you use to install gentoo-x86 on Athlon64 ? Reply with quote

Hi,

Just thinkin about to install 32bit-gentoo on another partition. What are the best CFLAGS to you use to kick the last bit of performance out of the Athlon.

I wanted to give this one a try:

CFLAGS="-O3 -march=athlon-xp -pipe -fweb -frename-registers"

What do you say? I read here in the forum that several people already give it up install 64bit cause of several problems. What CFLAGS do you use to install 32bit?

Greetings Marc
Back to top
View user's profile Send private message
MrPixel
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2004
Posts: 117
Location: Here & Now

PostPosted: Thu May 27, 2004 1:05 am    Post subject: Reply with quote

Check out the CFLAGS Central thread: https://forums.gentoo.org/viewtopic.php?t=5717&highlight=cflags+central
Back to top
View user's profile Send private message
SiggiS
n00b
n00b


Joined: 18 May 2004
Posts: 36
Location: Germany

PostPosted: Thu May 27, 2004 6:34 am    Post subject: Reply with quote

I checked it out before, but I dont recognized a person who wants to install a gentoo-x86 on an Athlon64. So I made this thread, I thought there are more guys who are interrested in this.

Greetings Marc
Back to top
View user's profile Send private message
crazycat
l33t
l33t


Joined: 26 Aug 2003
Posts: 838
Location: Hamburg, Germany

PostPosted: Thu May 27, 2004 11:01 am    Post subject: Reply with quote

Well if u buy one and give pretty much money for it u would want also to use its advantages.
The generic athlon flags would be fine and i am pretty much sure that the athlonxp optimizations would also apply to athlon64 in 32bit mode. When i baught my athlon64 i was able to boot into my tweakd athlonxp installation. I dont think its worth of much talking about unless u've got problems.
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Sat Jun 12, 2004 12:10 pm    Post subject: Reply with quote

I'm with you Siggi...
I tried posting a thread and it got slammed into the dupe-folder w/ a link to this one (which has been real useful so far.. :roll: ).
Read the thread linked above too... lotsa talk about Athlon's but no 64 users that I could find?

- Mac
Back to top
View user's profile Send private message
jimbojetset
n00b
n00b


Joined: 01 Feb 2004
Posts: 67
Location: UK

PostPosted: Sat Jun 12, 2004 4:56 pm    Post subject: Reply with quote

I use gcc 3.4.0-r6 currently on x86 with my amd64

Code:
CFLAGS="-march=k8 -mtune=k8 -O2 -pipe -fomit-frame-pointer"


seems to be pretty solid with these although you could use -O3 -ftracer for most packages without causing problems I feel.
Back to top
View user's profile Send private message
Kugelfang
Retired Dev
Retired Dev


Joined: 28 Nov 2003
Posts: 25
Location: Witten, Germany

PostPosted: Sat Jun 12, 2004 5:14 pm    Post subject: Reply with quote

The recommended flags for 32bit installation on any (of the current) amd64 CPUs is
Code:
CFLAGS="-march=athlon-xp -msse2 -O2 -pipe -ftracer"

This enables all the gimmicks that a 32bit mode amd64 has.

I'd also recommend you to not use "-march=k8" on a 32bit installation because
(a) only gcc-3.4 recognizes that, and -3.4 is not yet really ready for x86. But we already got a new dev who will care about that soon ;-)
(b) -march=k8 implies -m64. This makes no sense on a pure 64bit install and could result in odd bugs that noone can cope with.
_________________
Danny van Dyk
Gentoo Developer
Gentoo/AMD64 Project, Gentoo Scientifc Project
kugelfang@gentoo.org
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Sat Jun 12, 2004 9:02 pm    Post subject: Reply with quote

Thanks folks, but I'm really slow today, and still a bit confused.

I'd _like_ a 64-bit install, but if I'm reading KugelFang right, I can enable both?

- Mac
Back to top
View user's profile Send private message
RAPUL
l33t
l33t


Joined: 29 Dec 2002
Posts: 664
Location: Valencia (SPAIN)

PostPosted: Sun Jun 13, 2004 11:11 am    Post subject: Re: Which CFLAGS to you use to install gentoo-x86 on Athlon6 Reply with quote

SiggiS wrote:
Hi,

I wanted to give this one a try:

CFLAGS="-O3 -march=athlon-xp -pipe -fweb -frename-registers"


gcc3.3 has not -fweb
gcc3.4 -O3 implies:
-fweb, -finline-functions and -frename-registers options.

So there is no need of typing -fweb and -frename-registers. And also it is not advisable. portage works different with these two lines. Gcc works the same, portage no.

Code:

CFLAGS="-O3 -march=athlon-xp -pipe -fweb -frename-registers"
CFLAGS="-O3 -march=athlon-xp -pipe"


Athlon64 in 32 bits mode is as an Athlon-XP with SSE2, more registers, better scheduling and twice cache.

So mines are:

Code:

CFLAGS="-O2 -march=athlon-xp -maccumulate-outgoing-args -ftracer -pipe -msse2 -fPIC"
CFLAGS="-O3 -march=athlon-xp -maccumulate-outgoing-args -ftracer -pipe -msse2 -fPIC"

_________________
Entropy rulz world.
Redundancy sux.
World is full of redundancy.
World sux.
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Sun Jun 13, 2004 12:58 pm    Post subject: Reply with quote

OK, maybe I'm just being thick... I want 64 bit optimization, NOT 32-bit.
I have a feeling I'm missing something to the conversation here. I understand the cpu will 'pretend' it runs in 32-bit mode when it has to, but I want to set things to optimize as much as possible, for the fact that it's a 64-bit chip under the hood... I'll willing pay a performance hit when I have 32-bit only code.
Does that make my question clearer?
It sounds like what you're telling me is that the compile options do what I want, when it knows it's an AMD64-CPU (which is what the "x86_64-pc-linux-gnu" setting does), but this second option of

Quote:
CFLAGS="-march=athlon-xp -msse2 -O2 -pipe -ftracer"


Makes it work 'better' when forced to use 32-bit mode?
Sorry, it's Sunday, my brain just isn't working this morning.

- Mac
Back to top
View user's profile Send private message
RAPUL
l33t
l33t


Joined: 29 Dec 2002
Posts: 664
Location: Valencia (SPAIN)

PostPosted: Sun Jun 13, 2004 1:17 pm    Post subject: ??? Reply with quote

ReeferMac wrote:
OK, maybe I'm just being thick... I want 64 bit optimization, NOT 32-bit.
I have a feeling I'm missing something to the conversation here. I understand the cpu will 'pretend' it runs in 32-bit mode when it has to, but I want to set things to optimize as much as possible, for the fact that it's a 64-bit chip under the hood... I'll willing pay a performance hit when I have 32-bit only code.
Does that make my question clearer?
It sounds like what you're telling me is that the compile options do what I want, when it knows it's an AMD64-CPU (which is what the "x86_64-pc-linux-gnu" setting does), but this second option of

Quote:
CFLAGS="-march=athlon-xp -msse2 -O2 -pipe -ftracer"


Makes it work 'better' when forced to use 32-bit mode?
Sorry, it's Sunday, my brain just isn't working this morning.

- Mac


The tittle thread is quite clear:

Code:

Which CFLAGS to you use to install gentoo-x86 on Athlon64 ?


gentoo-x86 is 32 bits only one.
gentoo-athlon64 is a 64 bits one which can have if you want a chrooted 32 bits environment.

Tittle says "CFLAGS to you use to install gentoo-x86 on Athlon64".

So tittle asks for which cflags use on an athlon64 for 32bits only environment.

Quote:
Hi,

Just thinkin about to install 32bit-gentoo on another partition. What are the best CFLAGS to you use to kick the last bit of performance out of the Athlon.


Also he talks about installing a 32 bits gentoo (gentoo-x86) on another partition. So it is clear he wants what tittle says...
_________________
Entropy rulz world.
Redundancy sux.
World is full of redundancy.
World sux.
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Sun Jun 13, 2004 10:43 pm    Post subject: Reply with quote

Thanks for clearing that up Rapul (told you I was slow on Sundays).
So then why did the Admin close my thread and point it to here, when I asked what flags to use in an AMD64 situation? I'd like to optomize my system for 64-bits, not 32?
Thanks again.

- Mac
Back to top
View user's profile Send private message
RAPUL
l33t
l33t


Joined: 29 Dec 2002
Posts: 664
Location: Valencia (SPAIN)

PostPosted: Mon Jun 14, 2004 1:08 am    Post subject: Hmm... Reply with quote

I think he closed your thread because there are so many CFLAGS thread...

It is better to search and read before post. (I am not saying you didn't... but many don't do)

CFLAGs is an eternal theme... :P on gentoo-forums.

Also, there is a CFLAGs central thread for all CFLAGs doubts.
_________________
Entropy rulz world.
Redundancy sux.
World is full of redundancy.
World sux.
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Mon Jun 14, 2004 10:34 am    Post subject: Reply with quote

Thanks Rapul I had dug through a couple threads on the matter (yes, search yielded many hits) but couldn't find anyone else interested in 64-bit optimization. The ONLY examples I could find were to optimize for when the chip runs in 32-bit mode (which is expressly what I DON'T want!)
Thanks again.

- Mac
Back to top
View user's profile Send private message
RAPUL
l33t
l33t


Joined: 29 Dec 2002
Posts: 664
Location: Valencia (SPAIN)

PostPosted: Mon Jun 14, 2004 1:43 pm    Post subject: Hmm... Reply with quote

Then the only difference is

64 bits optimization needs a gcc which knows amd64 such as gcc3.3.3 or much better gcc3.4

Check man gcc for details on these recommended CFLAGS

Code:

-march=k8
-mtune=k8
-ftracer
           Perform tail duplication to enlarge superblock size. This transformation simplifies the control flow of the function
           allowing other optimizations to do better job.
gcc3.4: -O3 = -O2 -finline-functions -frename-registers -fweb
gcc3.3: -O3 = -O2 -finline-functions -frename-registers
or just -O2
-fomit-frame-pointer
-maccumulate-outgoing-args
           If enabled, the maximum amount of space required for outgoing arguments will be computed in the function prologue.
           This is faster on most modern CPUs because of reduced dependencies, improved scheduling and reduced stack usage when
           preferred stack boundary is not equal to 2.  The drawback is a notable increase in code size.  This switch implies
           -mno-push-args.
-pipe
           Use pipes rather than temporary files for communication between the various stages of compilation.  This fails to
           work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble.


Do not put:

Code:

-mmmx
-m3dnow
-msse
-msse2
-mfpmath=sse   This is the default choice for the x86-64 compiler.
-mpreferred-stack-boundary=num, (4 bytes for x86, and 8 bytes for x86-64)


because x86_64 CHOST or k8 arch implies them...
Check it with a simple:

Code:

gcc -v -Q $CFLAGS blah.c


Well you can play around with other CFLAGS but do it at your own risk.

Code:

-fprefetch-loop-arrays
           If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that
           access large arrays.
-funroll-loops
           Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop.  -funroll-loops
           implies both -fstrength-reduce and -frerun-cse-after-loop.  This option makes code larger, and may or may not make it
           run faster.
-funroll-all-loops
           Unroll all loops, even if their number of iterations is uncertain when the loop is entered.  This usually makes pro-
           grams run more slowly.
-mfpmath=sse,387
-ffast-math

_________________
Entropy rulz world.
Redundancy sux.
World is full of redundancy.
World sux.
Back to top
View user's profile Send private message
ReeferMac
Guru
Guru


Joined: 30 May 2004
Posts: 389

PostPosted: Mon Jun 14, 2004 11:46 pm    Post subject: Reply with quote

Thank you very much.

- Mac
Back to top
View user's profile Send private message
gnudude
n00b
n00b


Joined: 07 Dec 2004
Posts: 1

PostPosted: Tue Dec 07, 2004 4:27 pm    Post subject: Reply with quote

I have an AthlonXP box running the 2004.3 base system and a 2.4.22 kernel. It was built with:
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"

I would like to upgrade to an Athlon64 cpu and run the whole system at 32-bit. Just want a hardware upgrade, faster cpu, fsb, etc. No 64-bit stuff at this time.

From what I have read on these forums, all I need to do Gentoo-wise is to update to a newer kernel. Is that true? Sounds dern easy if that's the case.
Back to top
View user's profile Send private message
RAPUL
l33t
l33t


Joined: 29 Dec 2002
Posts: 664
Location: Valencia (SPAIN)

PostPosted: Tue Dec 07, 2004 5:14 pm    Post subject: Reply with quote

Yap!

Install any >=gentoo-development-sources-2.6.5-r1.
_________________
Entropy rulz world.
Redundancy sux.
World is full of redundancy.
World sux.
Back to top
View user's profile Send private message
Benotti
n00b
n00b


Joined: 16 Jan 2005
Posts: 9
Location: Rotterdam, Netherlands

PostPosted: Sun Jan 16, 2005 10:25 pm    Post subject: Reply with quote

I am also considering installing the x86 gentoo on my amd64 and the chost setting should be set to i686-*, but what about the cflags? Do I need -march=athlon-xp, because I want 32bit, or can I use -march=athlon64 so it will optimize for my cpu, yet will compile in 32bit because of the chost?

If someone could clear this up, please :)

edit: one quick offtopic question: I often see people with -fomit-frame-pointer and -O2 or -O3, but according to the gcc manual, -fomit-frame-pointer is enabled automatically when using -O, -O2, -O3, -Os. Is there any use to specifically add it nevertheless then?
Back to top
View user's profile Send private message
alexwade
n00b
n00b


Joined: 22 Aug 2002
Posts: 47
Location: Orlando, FL

PostPosted: Mon Jan 17, 2005 8:30 pm    Post subject: Reply with quote

gnudude:

i just went from a althlon tbird to althlon xp 64 bit and all i had to do was recompile the kernel and everythign works great, so you don't have to worry about that for the upgrade. now i'm just trying to figure out the best optimizations i should change to for getting the best performance after the upgrade without breaking my current system.
Back to top
View user's profile Send private message
markusw
n00b
n00b


Joined: 31 Dec 2004
Posts: 17

PostPosted: Wed Feb 02, 2005 2:47 am    Post subject: Reply with quote

I know this thread is about CFLAGS, but can I ask a question about CHOST?

I am also planning a 32-bit x86 Gentoo install on an AMD64. I know that irritates some people but I have my reasons :)

If I do a stage 1 install, I get to set CHOST. If I want 32-bit x86, then I say CHOST="i686-pc-linux-gnu" Correct?

I was planning on the following CFLAGS
CFLAGS="-O2 -march=athlon-xp -maccumulate-outgoing-args -ftracer -pipe -msse2 -fPIC"
But if I specify my CHOST as i686, then can I specify -march=athlon64 or will that confuse the compiler. Assuming gcc 3.4.3.
Any comments?
Back to top
View user's profile Send private message
kamisama
n00b
n00b


Joined: 27 Apr 2004
Posts: 41

PostPosted: Fri Mar 11, 2005 6:29 pm    Post subject: this thread stinks Reply with quote

As far as I can tell all but one of the guys in here is looking for the best cflags for a 32bit mode - amd64.

The thread I made had some very useful information. It got closed and I got redirected here. Since this thread sucks. Read mine.

Code:

http://forums.gentoo.org/viewtopic-p-2171229-highlight-.html?sid=c1602bb94706f59f64b9423c406ad87c#2171229
Back to top
View user's profile Send private message
Birtz
Apprentice
Apprentice


Joined: 09 Feb 2005
Posts: 272
Location: Osijek / Croatia

PostPosted: Fri Mar 11, 2005 6:59 pm    Post subject: Re: this thread stinks Reply with quote

kamisama wrote:
As far as I can tell all but one of the guys in here is looking for the best cflags for a 32bit mode - amd64.

The thread I made had some very useful information. It got closed and I got redirected here. Since this thread sucks. Read mine.

Code:

http://forums.gentoo.org/viewtopic-p-2171229-highlight-.html?sid=c1602bb94706f59f64b9423c406ad87c#2171229


Just a friendly advice, you should have closed the URL in the BBCode for URL like this;
Code:
[url]....[/url]
https://forums.gentoo.org/viewtopic-p-2171229-highlight-.html?sid=c1602bb94706f59f64b9423c406ad87c#2171229.
Saves the time of copy&paste at least 8)

Cheers
_________________
It is not enough to have a good mind. The main thing is to use it well.
-- Rene Descartes

Don't have a childhood hero? How about Rob Hubbard http://www.freenetpages.co.uk/hp/tcworh/profile.htm
Back to top
View user's profile Send private message
kamisama
n00b
n00b


Joined: 27 Apr 2004
Posts: 41

PostPosted: Fri Mar 11, 2005 8:43 pm    Post subject: Reply with quote

Ahh, my neophyte posting skills are revealed. Yeah I don't know why I used code. LOL
Back to top
View user's profile Send private message
kamisama
n00b
n00b


Joined: 27 Apr 2004
Posts: 41

PostPosted: Fri Mar 11, 2005 8:47 pm    Post subject: Reply with quote

Hey Birtz, do you agree with Kugelfang that

Code:
CFLAGS="-march=athlon-xp -msse2 -O2 -pipe"


is the same thing as

Code:
CFLAGS="-pipe -O2 -march=athlon64"


Basicly hes saying the only good optimization code that is implied by march=athlon64 and isnt implied by march=athlon-xp is -msse2
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 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