Am 21.07.2011 15:10, schrieb William Kenworthy:
> On Thu, 2011-07-21 at 11:21 +0200, Florian Philipp wrote:
>> Am 21.07.2011 10:57, schrieb Pandu Poluan:
>>> -original message-
>>> Subject: Re: [gentoo-user] New computer and Gentoo
>>> From: Bill Kenworthy <bi...@iinet.net.au>
>>> Date: 2011-07-21 12:54
>>>
>>>> On Thu, 2011-07-21 at 06:26 +0100, Mick wrote:
>> [...]
>>>> Ive just stumbled on something weird with march=native:
>>>>
> 
>>
>> I'd like to see a reference for this claim. -march=native doesn't do
>> more than set -march=core2 and some other optimizations for cache size
>> etc. This should be no more troublesome than mixing code compiled with
> 
> unfortunately this is now my main machine so I cant fiddle too much with
> it!  It would mean going back to the E4600 and comparing march=prescott,
> march=native then fitting the E6600 and checking march=native and
> march=core2.  What I cant find is a reference to how it works out what
> native is? - lookup-table, checking the flags in /proc/cpuinfo or what?
> 
[...]

Use the source, Luke. Take a look at the gcc sources in your distfiles
directory. It is in the gcc package, file
"./gcc/config/i386/driver-i386.c" (found via grep for "\<native" and
then grep for "host_detect_local_cpu"). It is surprisingly understandable.

Most of the detection is done by introspecting CPUID. Most importantly,
the CPU family is deducted from the found capabilities, not vice versa.
Therefore there is no chance that a CPU that claims to be, let's say, a
Core2, but lacks some capabilities, ends up being classified as a Core2
(unless, of course, if the GCC guys get their switch-case logic wrong).

Regards,
Florian Philipp

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to