You are not logged in.

#51 2007-05-21 22:17:05

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: x86_64: poll for optional CFLAGS

AndyRTR wrote:

hm. i cannot trust in skottish's benchmarks. with additional SSE3 support it cannot be slower. i have to doubt that results.

this kind of stuff happens. since i'm going to own my own 64bit machine soon, i'll throw my 23c in here too.

when using -mtune no features not available on -march or if not set CHOST, will be used. on i686 for example i can set:

CFLAGS="-march=i686 -O2 -pipe -mtune=pentium3"

note a pentium2 or amd k6-3 is a i686 but does not come with SSE necessarily. these flags will still optimize for a pentium3 but without using extra instructions not available on plain i686. what happens here is something different. the pentium3 has a few architectural advances by design over the pentium2 for example. like better pipelining etc. to take advantage of this kind of thing, not new instructions are needed.

generally, -msse* seems to be not well supported by gcc. nobody really got the hang of how to use it really and if -like in mplayer - they do ASM instead of regular C code for that very reason. i personally wouldn't enable -msse* at all and not tune for anything that locks out some users. the speed gain is so little, it is simply not worth it.


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#52 2007-05-22 04:52:19

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: x86_64: poll for optional CFLAGS

We won't change our FLAGS to not loose non sse3 capabable cpus.

FYI: gcc4.2 that is now in testing will need a small additional switch -mtune=generic we will soon have in our pacman package for both architecture for all official packages. for your local FLAGS you can change them to -march=native -mtune=native -O2 -pipe. gcc should autodetect now all supported cpu features wink

Offline

#53 2007-06-07 18:30:27

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: x86_64: poll for optional CFLAGS

I'm trying to get a better understanding of how this works:

-mtune=generic

Will that produce all the functions of common hardware (to be utilised where applicable), or will it only produce code that's compatible with all common processors?
I'm wondering whether packages built with said flags will utilise functions such as sse3 if the end users hardware supports it?

And this confuses me a little:

-march=native -mtune=native -O2 -pipe

Is the mtune option required here? The man page says, "specifying -march=cpu-type implies -mtune=cpu-type".

Cheers wink

Last edited by ahaslam (2007-06-07 18:32:55)

Offline

#54 2007-06-07 21:10:49

thedonvaughn
Member
From: Dallas, TX
Registered: 2007-06-07
Posts: 14
Website

Re: x86_64: poll for optional CFLAGS

Athalon 64 3800+, no sse3 here.


Jayson Vaughn

#pacman -R GOP
(1/302) removing John Boehner            [#####################] 100%

Offline

#55 2007-06-08 05:10:12

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: x86_64: poll for optional CFLAGS

ahaslam wrote:

I'm trying to get a better understanding of how this works:

-mtune=generic

Will that produce all the functions of common hardware (to be utilised where applicable), or will it only produce code that's compatible with all common processors?
I'm wondering whether packages built with said flags will utilise functions such as sse3 if the end users hardware supports it?

-mtune will never touch the used cpu instructions. it will produce generic optimised code that will run on any common cpu not very much optimised.

And this confuses me a little:

-march=native -mtune=native -O2 -pipe

Is the mtune option required here? The man page says, "specifying -march=cpu-type implies -mtune=cpu-type".

Cheers wink

-mtune shouldn't be required. but it is safe to leave it there.


for more see section "Target-specific flags" http://www.redhat.com/magazine/011sep05 … gcc/#intro

Offline

#56 2007-06-08 05:35:09

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: x86_64: poll for optional CFLAGS

Thank you

Offline

Board footer

Powered by FluxBB