[MPlayer-dev-eng] Re: [SURVEY] change default CPU target when compiled with runtime CPU detection

Zuxy zuxy.meng at gmail.com
Sun Nov 13 07:09:28 CET 2005


2005/11/13, Guillaume POIRIER <poirierg at gmail.com>:
> Hi,
>
> According to GCC's man page, changing mcpu to i586 just changes the
> scheduling of instructions, when it's -march that tells what
> instructions are allowed, so the proper solution is not there.
>
> The guy who reported the problem mentioned that changing this like:
>
>        #if __CPU__ >= 686 && !defined(RUNTIME_CPUDETECT)
>
> to #if 0 was fixing the problem for him. Now I'm wondering how _CPU_
> is set. I it looking at a variable set by the configure script (which
> I doubt very much)? What to do?

__CPU__ is defined as $iproc, which is in turn generally defined as
the family as returned by executing cpuid on a specific CPU. For VIA,

...
  CentaurHauls)
    case "$pfamily" in
    5) iproc=586
    if test "$pmodel" -ge 8; then
        proc=winchip2
    elif test "$pmodel" -ge 4; then
        proc=winchip-c6
    else
        proc=i586
    fi
    ;;
    6) iproc=686
        # VIA C3 has SSE, but doesn't have MMX2
        # workaround for SSE => MMX2 implication above
        _mmx2=no
    if test "$pmodel" -ge 9; then
        proc=c3-2
    else
        proc=i686
    fi
    ;;
    *) proc=i686 iproc=i686 ;;
    esac
    ;;
...

IIRC, in the general instruction set (excluding SIMD instructions) an
i686 differs from an i586 only in that the former supports cmov, fcmov
and ficomp, indicated by the CMOV bit in cpuid standard feature
string. For Intel and AMD, all Family 6 CPUs support cmov, and that's
what -march=686 assumes. Doesn't  a C2 support cmov while insisting it
be of family 6?


Is there an official VIA CPU manual available online?

--
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6




More information about the MPlayer-dev-eng mailing list