You are not logged in.
Pages: 1
I've had "-mtune=generic" in my makepkg.conf file since I upgraded GCC a few weeks ago. Why? Because I read it is a good idea. I really don't understand the scope of it. Now today with my newest Pacman upgrade, it mentions adding "-mtune=native". So here's my question:
What do these things do and should they be run together?
------------------------------------------------------------------------------------------
Hmmm. I guess my question answered itself. Generic is for if you plan to share your builds, and native is for your own local builds. Correct?
Last edited by skottish (2007-06-05 01:21:53)
Offline
http://gcc.gnu.org/gcc-4.2/changes.html
New Targets and Target Specific Improvements
IA-32/x86-64
* -mtune=generic can now be used to generate code running well on common x86 chips. This includes AMD Athlon, AMD Opteron, Intel Pentium-M, Intel Pentium 4 and Intel Core 2.
* -mtune=native and -march=native will produce code optimized for the host architecture as detected using the cpuid instruction.
Offline
Is it possible to recompile the installed packages with -mtune=native?
Offline
man makeworld
Offline
Does this have any effect to "-march=x86_64"?
Offline
mtune will not affect the used cpu instructions, only further optimisations (e.g. pipeline reordering). but -march=native of course would touch the cpu instructions and replace the -march=x86_64.
Offline
Would you recommend this for my homegrown packages?
-----------------------------
I went ahead and tried it, and I must say that it's pretty cool. GCC passed -march=k8 and -mtune=k8 automagically. This is good stuff.
Last edited by skottish (2007-06-06 00:43:10)
Offline
Bump for more info...
As I posted before, when using -march and -mtune=native I end up with 'k8' as the compiler option. On this site:
http://gentoo-wiki.com/Safe_Cflags
it suggest that for my processor (AMD X2 5200+) to use 'athlon64'. Is there any fundamental difference between the two?
One more compiler question: Does SSE3 contain SSE2, or is it a independent extention?
Last edited by skottish (2007-06-10 00:51:12)
Offline
According to this page, athlon64 and k8 are the same. So I suppose using -mtune=native will result in exactly the same as -march=athlon64.
As for the SSE question, I think they are independent, but I'm not sure about this...
Offline
If your CPU supports SSE3, that means it supports older SSE versions too... It seems the higher the number, the more gets added.
If you compile 'natively' for the K8, SSE2 is already included.
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
FWIW:
-mtune=native was causing problems for me on an Intel Core Duo.
-march=prescott -mtune=generic seem to the proper CFLAGS for the processor.
CFLAGS="-march=prescott -mtune=generic -O2 -pipe -fomit-frame-pointer"
http://article.gmane.org/gmane.comp.gcc.devel/83870
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00052.html
http://gentoo-wiki.com/Safe_Cflags)
Last edited by somedrew (2007-06-13 08:06:12)
Offline
One more bump...
I'm a little unclear on what all is implied by using 'native'. My processor (AMD 5200+) is SSE3 capable. Would that be implied, or do I still need the '-msse3' flag? I guess what I'm asking is, is there anything deemed "safe" that isn't implied?
Offline
Why don't you read GCC docs?
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Why don't you read GCC docs?
I just want some confirmation from someone with practical understanding. I mean, as far as I can tell, the two lines AndyRTR posted above are the GCC docs on this subject. And while it seems to point to "yes" as the answer to my question, it hasn't brought the clarification that I'd like.
Offline
Yeah, the GCC docs are a bit unclear about this part in my opinion. I've been doing some research about this too, and I've found some reactions from people who are certain this is added automatically as well as people telling you still have to add it your own. So I can't really help you on this. The only thing I can say is I add the -msse and -m3dnow (I have an athlon XP) flag because I'm not sure the -mtune=native flag is adding it by default and either way it's not bad to add it yourself.
But if someone could give a clear explanation it would be nice, I do understand skottish's questions about it being somewhat unclear
Offline
Pages: 1