Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on AMD64
  • Search

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

Have an x86-64 problem? Post here.
Locked
Advanced search
62 posts
  • 1
  • 2
  • 3
  • Next
Author
Message
SiggiS
n00b
n00b
Posts: 36
Joined: Tue May 18, 2004 7:16 am
Location: Germany

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

  • Quote

Post by SiggiS » Tue May 25, 2004 4:51 pm

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
Top
MrPixel
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 117
Joined: Wed Apr 21, 2004 11:45 pm
Location: Here & Now

  • Quote

Post by MrPixel » Thu May 27, 2004 1:05 am

Check out the CFLAGS Central thread: http://forums.gentoo.org/viewtopic.php? ... gs+central
Top
SiggiS
n00b
n00b
Posts: 36
Joined: Tue May 18, 2004 7:16 am
Location: Germany

  • Quote

Post by SiggiS » Thu May 27, 2004 6:34 am

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
Top
crazycat
l33t
l33t
User avatar
Posts: 838
Joined: Tue Aug 26, 2003 6:04 pm
Location: Hamburg, Germany

  • Quote

Post by crazycat » Thu May 27, 2004 11:01 am

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.
Top
ReeferMac
Guru
Guru
Posts: 389
Joined: Sun May 30, 2004 3:56 pm

  • Quote

Post by ReeferMac » Sat Jun 12, 2004 12:10 pm

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
Top
jimbojetset
n00b
n00b
User avatar
Posts: 67
Joined: Sun Feb 01, 2004 2:28 pm
Location: UK

  • Quote

Post by jimbojetset » Sat Jun 12, 2004 4:56 pm

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

Code: Select all

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.
Top
Kugelfang
Retired Dev
Retired Dev
Posts: 25
Joined: Fri Nov 28, 2003 11:15 pm
Location: Witten, Germany

  • Quote

Post by Kugelfang » Sat Jun 12, 2004 5:14 pm

The recommended flags for 32bit installation on any (of the current) amd64 CPUs is

Code: Select all

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
Top
ReeferMac
Guru
Guru
Posts: 389
Joined: Sun May 30, 2004 3:56 pm

  • Quote

Post by ReeferMac » Sat Jun 12, 2004 9:02 pm

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
Top
RAPUL
l33t
l33t
User avatar
Posts: 664
Joined: Sun Dec 29, 2002 6:33 pm
Location: Valencia (SPAIN)

Re: Which CFLAGS to you use to install gentoo-x86 on Athlon6

  • Quote

Post by RAPUL » Sun Jun 13, 2004 11:11 am

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: Select all

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: Select all

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.
Top
ReeferMac
Guru
Guru
Posts: 389
Joined: Sun May 30, 2004 3:56 pm

  • Quote

Post by ReeferMac » Sun Jun 13, 2004 12:58 pm

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
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
Top
RAPUL
l33t
l33t
User avatar
Posts: 664
Joined: Sun Dec 29, 2002 6:33 pm
Location: Valencia (SPAIN)

???

  • Quote

Post by RAPUL » Sun Jun 13, 2004 1:17 pm

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
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: Select all

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.
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.
Top
ReeferMac
Guru
Guru
Posts: 389
Joined: Sun May 30, 2004 3:56 pm

  • Quote

Post by ReeferMac » Sun Jun 13, 2004 10:43 pm

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
Top
RAPUL
l33t
l33t
User avatar
Posts: 664
Joined: Sun Dec 29, 2002 6:33 pm
Location: Valencia (SPAIN)

Hmm...

  • Quote

Post by RAPUL » Mon Jun 14, 2004 1:08 am

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.
Top
ReeferMac
Guru
Guru
Posts: 389
Joined: Sun May 30, 2004 3:56 pm

  • Quote

Post by ReeferMac » Mon Jun 14, 2004 10:34 am

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
Top
RAPUL
l33t
l33t
User avatar
Posts: 664
Joined: Sun Dec 29, 2002 6:33 pm
Location: Valencia (SPAIN)

Hmm...

  • Quote

Post by RAPUL » Mon Jun 14, 2004 1:43 pm

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: Select all

-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: Select all

-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: Select all

gcc -v -Q $CFLAGS blah.c
Well you can play around with other CFLAGS but do it at your own risk.

Code: Select all

-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.
Top
ReeferMac
Guru
Guru
Posts: 389
Joined: Sun May 30, 2004 3:56 pm

  • Quote

Post by ReeferMac » Mon Jun 14, 2004 11:46 pm

Thank you very much.

- Mac
Top
gnudude
n00b
n00b
Posts: 1
Joined: Tue Dec 07, 2004 4:03 pm

  • Quote

Post by gnudude » Tue Dec 07, 2004 4:27 pm

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.
Top
RAPUL
l33t
l33t
User avatar
Posts: 664
Joined: Sun Dec 29, 2002 6:33 pm
Location: Valencia (SPAIN)

  • Quote

Post by RAPUL » Tue Dec 07, 2004 5:14 pm

Yap!

Install any >=gentoo-development-sources-2.6.5-r1.
Entropy rulz world.
Redundancy sux.
World is full of redundancy.
World sux.
Top
Benotti
n00b
n00b
Posts: 9
Joined: Sun Jan 16, 2005 1:07 am
Location: Rotterdam, Netherlands

  • Quote

Post by Benotti » Sun Jan 16, 2005 10:25 pm

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?
Top
alexwade
n00b
n00b
Posts: 47
Joined: Thu Aug 22, 2002 9:56 pm
Location: Orlando, FL

  • Quote

Post by alexwade » Mon Jan 17, 2005 8:30 pm

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.
Top
markusw
n00b
n00b
Posts: 17
Joined: Fri Dec 31, 2004 4:05 am

  • Quote

Post by markusw » Wed Feb 02, 2005 2:47 am

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?
Top
kamisama
n00b
n00b
Posts: 41
Joined: Tue Apr 27, 2004 6:59 am

this thread stinks

  • Quote

Post by kamisama » Fri Mar 11, 2005 6:29 pm

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: Select all

http://forums.gentoo.org/viewtopic-p-2171229-highlight-.html?sid=c1602bb94706f59f64b9423c406ad87c#2171229
Top
Birtz
Apprentice
Apprentice
User avatar
Posts: 272
Joined: Wed Feb 09, 2005 11:16 pm
Location: Osijek / Croatia

Re: this thread stinks

  • Quote

Post by Birtz » Fri Mar 11, 2005 6:59 pm

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: Select all

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: Select all

[url]....[/url]
http://forums.gentoo.org/viewtopic-p-21 ... 7c#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
Top
kamisama
n00b
n00b
Posts: 41
Joined: Tue Apr 27, 2004 6:59 am

  • Quote

Post by kamisama » Fri Mar 11, 2005 8:43 pm

Ahh, my neophyte posting skills are revealed. Yeah I don't know why I used code. LOL
Top
kamisama
n00b
n00b
Posts: 41
Joined: Tue Apr 27, 2004 6:59 am

  • Quote

Post by kamisama » Fri Mar 11, 2005 8:47 pm

Hey Birtz, do you agree with Kugelfang that

Code: Select all

CFLAGS="-march=athlon-xp -msse2 -O2 -pipe"
is the same thing as

Code: Select all

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
Top
Locked

62 posts
  • 1
  • 2
  • 3
  • Next

Return to “Gentoo on AMD64”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic