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

Zuxy Meng zuxy.meng at gmail.com
Sun Jun 3 09:39:31 CEST 2007


Hi,

2007/6/3, Loren Merritt <lorenm at u.washington.edu>:
> 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.

Then we're left with no choice but k8...
-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the MPlayer-dev-eng mailing list