[MPlayer-dev-eng] [PATCH] configure cmov detection

Diego Biurrun diego at biurrun.de
Sun Oct 15 20:14:45 CEST 2006


On Sun, Oct 15, 2006 at 09:08:28PM +0300, Ivan Kalvachev wrote:
> 2006/10/15, Diego Biurrun <diego at biurrun.de>:
> >On Sun, Oct 15, 2006 at 08:36:23PM +0300, Ivan Kalvachev wrote:
> >> To let lavcodecs use cmov for cabac decoder (h264), we need to detect
> >> it in configure.
> >>
> >> I followed the _mmx way of detection.
> >>
> >> I'm not sure what processors besides i686 support cmov, so I wrote
> >> K6-2+ , feel free to correct me.
> >
> >I think you are trying to say "K6-2 or later" by K6-2+, this is not
> >correct, K6-2+ is a processor model.  It does not support cmov, though,
> >my K6-III+ does not.
> 
> I think I overdid the things.
> 
> The whole detection could be simple check if the cpu is 686 or newer.
> there is alredy code in libavutil that does this and it does use cmov.
> e.g. libavutil.h/internal.h:
> 
> #if __CPU__ >= 686 && !defined(RUNTIME_CPUDETECT)
> #define COPY3_IF_LT(x,y,a,b,c,d)\
> asm volatile (\
>    "cmpl %0, %3        \n\t"\
>    "cmovl %3, %0       \n\t"\
>    "cmovl %4, %1       \n\t"\
>    "cmovl %5, %2       \n\t"\
>    : "+r" (x), "+r" (a), "+r" (c)\
>    : "r" (y), "r" (b), "r" (d)\
> );
> #else
> ...

OK, then it should just be a matter of adding the proper ifdefs to
libavcdodec/cabac.h.  Since we already have a precedent for that it
should suffice.

Diego



More information about the MPlayer-dev-eng mailing list