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

Diego Biurrun diego
Mon Oct 16 10:37:35 CEST 2006

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 ...

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).
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.


More information about the ffmpeg-devel mailing list