[Ffmpeg-devel] [PATH] test if cpu supports CMOV

Diego Biurrun diego
Mon Oct 16 11:20:03 CEST 2006


On Mon, Oct 16, 2006 at 11:06:54AM +0200, Michael Niedermayer wrote:
> 
> On Mon, Oct 16, 2006 at 10:37:35AM +0200, Diego Biurrun wrote:
> > On Fri, Oct 13, 2006 at 12:03:52PM +0200, Michael Niedermayer wrote:
> > > 
> > > On Fri, Oct 13, 2006 at 05:35:13PM +0800, Zuxy Meng wrote:
> > > > 
> > > > 2006/10/13, Guillaume Poirier <gpoirier at mplayerhq.hu>:
> > > > >The attached patch (hopefully) allows to test for the presence of CMOV
> > > > >instruction, introduced in _real_ i686 CPUs.
> > > > >It's needed for latest and greatest CABAC code, as some cpus that
> > > > >claim to be i686 do not support cmov (such as VIA C3).
> > > > >
> > > > >This patch creates #define HAVE_CMOV 1 for config.h and
> > > > >TARGET_CMOV=yes for config.mak.
> > > > >I don't know if the name is too wise, maybe it would be better to have
> > > > > HAVE_X86_CMOV to specify that were are talking about x86 in
> > > > >particular (other CPU support conditional move too, sadly, PPC doesn't).
> > > > >
> > > 
> > > this will break runtime cpudetect (yeah i know my crap code already
> > > broke it but thats not supposed to stay that way in svn)
> > 
> > BTW, is there an ETA on this?  We've postponed MPlayer 1.0RC1 to the
> > next weekend yesterday because of the cmov issue ...
> 
> you can always take a older ffmpeg checkout which doesnt have these issues

Sure, there are plenty of possible workarounds.  We just want to know
whether we need to bother with it at all or if fixing it is on your TODO
for this week anyway.

> > We already have some cmov code in libavutil/common.h, which is enclosed
> > by '#if defined(ARCH_X86) && __CPU__ >= 686'.  I wanted to commit this
> > as a quick fix to libavcodec/cabac.h, but there are two problems:
> > 
> > 1) Apparently there are 686 CPUs without cmov (VIA C3).
> 
> i dont remember any bugreports for these in relation to the common.h code
> and grepping for c3 in mplayers configure shows
> ----
>     6) iproc=686
>         if test "$pmodel" -ge 9; then
>                 proc=c3-2
>         else
>                 proc=c3
>                 iproc=586
>         fi
>         ;;
> ----
> so this doest seems to be a real issue

For ffplay it might be an issue, but this is secondary.

> > 2) The #else case at cabac.h:472 will not compile (there is a single
> >    line with FIXTHIS on it) and even then it's broken, the decode only
> >    produces a gray picture.
> 
> ill fix this ASAP of course

Cool, thanks.

Diego




More information about the ffmpeg-devel mailing list