[MPlayer-dev-eng] [PATCH] cpu detection for core2

Loren Merritt lorenm at u.washington.edu
Sun Jun 3 09:33:25 CEST 2007


On Sun, 3 Jun 2007, Zuxy Meng wrote:
> 2007/6/3, Loren Merritt <lorenm at u.washington.edu>:
>
>> The configure code to detect core2 in 64bit mode was different from 32bit
>> mode, and didn't work on my core2. This changes it to be the same as
>> 32-bit mode, which works.
>
> A simpler way to fix core2 detection is:
> @@ -1845,7 +1845,7 @@
>       AuthenticAMD)
>         proc=k8;;
>       GenuineIntel)
> -        case "$pmodel" in
> +        case "$pfamily" in
>         6) proc=core2;;
>         *)
>           # 64-bit prescotts exist, but as far as GCC is concerned they

ok

>> Also, -march=k8 is faster than -march=nocona when run on a core2. Or
>> should it be -mtune=k8 with no -march, to avoid amd-specific instructions?
>> -march=k8 works for me, but that doesn't mean it's theoretically correct.
>> (Of course -march=core2 is the most appropriate, but that's only in gcc
>> >=4.2)
>
> -march=k8 should work because without -fprefetch-loop-arrays, gcc
> isn't able to generate any AMD specific instructions. But I can't
> guarantee this :-) But as for Core2, isn't '-march=nocona
> -mtune=pentium-m' faster?

pentium-m isn't x86_64, so it would be meaningless to tune x86_64 code for 
it, so gcc refuses to compile with -mtune=pentium-m.

--Loren Merritt



More information about the MPlayer-dev-eng mailing list