Eduardo Schoedler wrote:
<SNIP>
Hi Beso.
http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
"native
This selects the CPU to tune for at compilation time by determining
the processor type of the compiling machine. Using -mtune=native will
produce code optimized for the local machine under the constraints of
the selected instruction set. Using -march=native will enable all
instruction subsets supported by the local machine (hence the result
might not run on different machines). "
Best Regards,
Eduardo.
I have Phenom 9950 and use gcc-4.3.2 with CFLAGS="-march=barcelona
-combine -O2 -pipe"
I tried to compile some small test code with -v -march=native and -v
-march=barcelona, just to see if there is any difference.
Compiled code seems to be the same, but that means nothing, since the
example used was trivia
But there is one difference in gcc's coments.
With -march=native it says:
..
COLLECT_GCC_OPTIONS='-v' '-O3' '-pipe' '-o' 'tt2'
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.3.2/cc1 -quiet -v test.c
-march=amdfam10 -mcx16 -msahf --param l1-cache-size=64 --param
l1-cache-line-size=64 -mtune=amdfam10 -quiet -dumpbase test.c -auxbase
test -O3 -version -o - |
...
...and with -march=barcelona:
...
COLLECT_GCC_OPTIONS='-v' '-march=barcelona' '-O3' '-pipe' '-o' 'tt1'
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.3.2/cc1 -quiet -v test.c -quiet
-dumpbase test.c -march=barcelona -auxbase test -O3 -version -o - |
..
whereas with -march=amdfam10:
...
COLLECT_GCC_OPTIONS='-v' '-march=amdfam10' '-O3' '-pipe' '-o' 'tt1'
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.3.2/cc1 -quiet -v test.c -quiet
-dumpbase test.c -march=amdfam10 -auxbase test -O3 -version -o - |
...
It seems that "barcelona","amdfam10" and "native" are not exactly
synonymous on my machine. "amdfam10" seems to offer broadest description
to which "barcelona" adds some extra details, but "native" seems to be
most detailed,a s it adds details about cache size and cache line size,
CMPXCHNG16B and LAHF/SAHF instructions.
I also tried to compile "unrar" with those variations, but was unable to
make difference in final binary- which admittedly doesn't prove anything...