Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GCC-3.1 optimal arch flags automagically
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Klavs
Guru
Guru


Joined: 22 May 2002
Posts: 536
Location: Denmark

PostPosted: Thu May 30, 2002 7:56 am    Post subject: GCC-3.1 optimal arch flags automagically Reply with quote

Hi guys,

I was thinking that if we collected the optimal arch-flags for gcc-3.1 for all archs, this could be included in gentoo-iso, so emerge could automagically select the optimal flags for you - this way gentoo will automagically stay on top, as a super-optimized dist. What do you think?

Also, it would be great to know if profiling will improve speed on the given CPU-type - or is that more program dependant? from the benchmarks I've seen on gcc-3.1 with profiling it should definetely give approx. 5-10% extra - which is a lot in my mind. see http://forums.gentoo.org/viewtopic.php?t=2912 .

flags for:

Pentium


Pentium Pro (has MMX - any without?)


PII (has MMX - also other stuff?)


PIII (has MMX? - also other?)


K6-2


K6-3


Athlon

Athlon-XP
CHOST = i686-pc-linux-gnu
CXXFLAGS = -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -O3 -pipe
CFLAGS = -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -O3 -pipe

PPC

others..?
_________________
Best regards,

Klavs Klavsen
Denmark

Working with Unix is like wrestling a worthy opponent.
Working with windows is like attacking a small whining child
who is carrying a .38.
Back to top
View user's profile Send private message
Niek
Apprentice
Apprentice


Joined: 14 May 2002
Posts: 236
Location: Houten, The Netherlands

PostPosted: Thu May 30, 2002 10:34 am    Post subject: Reply with quote

You canfind a list of possible compile flags here: http://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/i386-and-x86-64-Options.html#i386%20and%20x86-64%20Options
Back to top
View user's profile Send private message
kode54
n00b
n00b


Joined: 16 May 2002
Posts: 42

PostPosted: Thu May 30, 2002 12:36 pm    Post subject: Reply with quote

According to that document, the -mmmx, -msse, -msse2, -m3dnow, only enable (or disable in the case of the -mno_* variants) macro/functions that execute assembly instructions from the respective sets. They have nothing to do with automatic optimization of existing code.
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Thu May 30, 2002 12:38 pm    Post subject: Reply with quote

defining march=athlon-xp probably is enough and -m3dnow -msse -mmx is already used don't know about mfpmath buth i think so (march compiles the program for that particular architecture, 3dnow etc are part of that architecture). Besides a part of Xfree will not compile with march=athlon / march=athlon-tbird, i had to add -mno-mmx -mno-3dnow so it's probably included in march=athlon. Think that march=<architecture> -O3 gives the most optimal result and maybe -O2 should be used to avoid stability issues, if there are options that won't break the code, why aren't they included by the gcc coders????. Well that's one thing to find out then, :lol: , let's get this thing straightend out once and for all, but how do you want to test the performance gain / stability issues????

See ya, lX
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
Klavs
Guru
Guru


Joined: 22 May 2002
Posts: 536
Location: Denmark

PostPosted: Thu May 30, 2002 2:11 pm    Post subject: Reply with quote

In regards to performance tests, I figured the way these guys has done it - isn't a bad one - see http://forums.gentoo.org/viewtopic.php?t=2912

In regards to stability - as with all code, only time and enough users will tell.. can there be any other way?
_________________
Best regards,

Klavs Klavsen
Denmark

Working with Unix is like wrestling a worthy opponent.
Working with windows is like attacking a small whining child
who is carrying a .38.
Back to top
View user's profile Send private message
Lovechild
Advocate
Advocate


Joined: 17 May 2002
Posts: 2858
Location: Århus, Denmark

PostPosted: Thu May 30, 2002 2:53 pm    Post subject: Reply with quote

Klavs wrote:

In regards to stability - as with all code, only time and enough users will tell.. can there be any other way?


Better coders ? :lol:
Back to top
View user's profile Send private message
Pigeon
Guru
Guru


Joined: 21 Jun 2002
Posts: 307

PostPosted: Fri Jun 21, 2002 9:25 am    Post subject: Reply with quote

Pentium Pro's don't support MMX.

Pentium II's support MMX.

Pentium III's support MMX and SSE.

Pentium 4's support MMX, SSE, and SSE2, I think. (I know they have SSE2- don't know if they're backward compatable, though I'd assume they are)

All AMD's that are K6-3+ (I think... possibly K6-2) have 3dnow.

Which (if any) AMD processors have MMX and SSE support? I can't remember my history lessons =( (I wouldn't be suprised if none of them did... for some reason I thought SSE and MMX are proprietary)
Back to top
View user's profile Send private message
mglauche
Retired Dev
Retired Dev


Joined: 25 Apr 2002
Posts: 564
Location: Germany

PostPosted: Fri Jun 21, 2002 10:48 am    Post subject: Reply with quote

hmm, my duron 1,3 k has:
3dnow, 3dnow+,mmx, mmx+ and sse (not sse2)

the lower durons don't have see flags
Back to top
View user's profile Send private message
karmakillernz
n00b
n00b


Joined: 01 May 2002
Posts: 55

PostPosted: Fri Jun 21, 2002 7:56 pm    Post subject: Reply with quote

Pigeon wrote:

All AMD's that are K6-3+ (I think... possibly K6-2) have 3dnow.

Which (if any) AMD processors have MMX and SSE support? I can't remember my history lessons =( (I wouldn't be suprised if none of them did... for some reason I thought SSE and MMX are proprietary)


Yea K6/2's have 3dnow (I used to have one :D) and all (at least from the K6/2) have mmx, and all Athlons have SSE (But not sse2).
Back to top
View user's profile Send private message
petecool
n00b
n00b


Joined: 17 Apr 2002
Posts: 11
Location: Laval, Québec, Canada

PostPosted: Sun Jun 23, 2002 7:23 pm    Post subject: Reply with quote

Quote:
...and all Athlons have SSE (But not sse2).


That is not true, only Athlon XP and second generation Durons (they start at 1 or 1.1 Ghz, I'm not sure - they have an Xp-like core) have sse.
Back to top
View user's profile Send private message
Tuxisuau
Apprentice
Apprentice


Joined: 04 May 2002
Posts: 213
Location: Catalunya (Europe)

PostPosted: Mon Jun 24, 2002 4:19 am    Post subject: sse Reply with quote

Quote:

only Athlon XP and second generation Durons (they start at 1 or 1.1 Ghz, I'm not sure - they have an Xp-like core) have sse.

I'm not sure, but i think all socket A athlons (since athlon-tbird, the first one AFAIK) do have sse.[/quote]
_________________
IM me at tuxisuau@jabber.7a69ezine.org
Back to top
View user's profile Send private message
Safrax
Guru
Guru


Joined: 23 Apr 2002
Posts: 422

PostPosted: Mon Jun 24, 2002 3:02 pm    Post subject: Reply with quote

The slot Athlons and the TBird Athlons *DO NOT* have sse support. Only the newer Athlon-XP's (aka palomino) have SSE support.
Back to top
View user's profile Send private message
slik
n00b
n00b


Joined: 18 Apr 2002
Posts: 48
Location: Alberta, Canada

PostPosted: Tue Jun 25, 2002 8:31 pm    Post subject: Reply with quote

lx wrote:
defining march=athlon-xp probably is enough and -m3dnow -msse -mmx is already used don't know about mfpmath buth i think so (march compiles the program for that particular architecture, 3dnow etc are part of that architecture). Besides a part of Xfree will not compile with march=athlon / march=athlon-tbird, i had to add -mno-mmx -mno-3dnow so it's probably included in march=athlon. Think that march=<architecture> -O3 gives the most optimal result and maybe -O2 should be used to avoid stability issues, if there are options that won't break the code, why aren't they included by the gcc coders????. Well that's one thing to find out then, :lol: , let's get this thing straightend out once and for all, but how do you want to test the performance gain / stability issues????

See ya, lX


see here to find which flags are automatically set for your given -O? option
Back to top
View user's profile Send private message
Forge
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jun 2002
Posts: 125
Location: KOP, PA, USA

PostPosted: Wed Jul 03, 2002 6:02 pm    Post subject: Reply with quote

Please see my comments in this thread to determine what features your K7 does/does not have.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
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