Scot Hetzel swhetzel at gmail.com
Fri May 25 14:48:11 UTC 2007

On 5/24/07, Conrad J. Sabatier <conrads at cox.net> wrote:
> Actually, section 3.17.14 in the gcc 4.2.0 docs (Intel 386 and AMD
> x86-64 Options) states that there is now also available a new "native"
> CPU type, which will cause gcc to determine the CPU type of the build
> machine and generate code for the same.  No more guesswork needed on
> the part of the user!
> I've already tried it here, setting "CPUTYPE=native" in /etc/make.conf,
> and it works fine.  Pretty nifty, huh?  :-)
> I don't know if this is available for other architectures, haven't
> looked to see.
I had a look at the docs, and it doesn't list native as an option to -mtune for the sparc, alpha, ia-64 architectures.

The use of -mtune=native on my AMD Turion64 system:

CPU: AMD Turion(tm) 64 Mobile Technology ML-37 (1994.21-MHz K8-class CPU)
Origin = "AuthenticAMD"  Id = 0x20f42  Stepping =2
AMD Features=0xe2500800<SYSCALL,NX,MMX+,FFXSR,LM,3DNow!+,3DNow!>
AMD Features2=0x1<LAHF>

resulted in  gcc setting -mtune to optimize the build for a k8 CPU.

$ gcc -v -x c -E -mtune=native /dev/null -o /dev/null
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.0 20070514 [FreeBSD]
 /usr/libexec/cc1 -E -quiet -v -D_LONGLONG /dev/null -o /dev/null -mtune=k8
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.

No electrons were mamed while sending this message. Only slightly bruised.

More information about the freebsd-amd64 mailing list