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

Ivan Kalvachev ikalvachev at gmail.com
Thu Oct 26 13:51:11 CEST 2006


2006/10/26, Guillaume Poirier <gpoirier at mplayerhq.hu>:
> Hi,
>
> Diego Biurrun wrote:
> > On Sun, Oct 15, 2006 at 08:14:45PM +0200, Diego Biurrun wrote:
> >
> >>On Sun, Oct 15, 2006 at 09:08:28PM +0300, Ivan Kalvachev wrote:
>
> [..]
>
> >>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.
> >
> >
> > This has been solved differently in FFmpeg, HAVE_CMOV is now defined
> > there, so we should do the same.  We can either apply Ivan's patch to
> > configure or port the stuff that Guillaume put into FFmpeg's configure.
>
>
> What I have written of ffmpeg was quite simple and straightforward:
> the user passes the minimum cpu requirement to the configure script,
> and based on it we activate or not CMOV usage.
>
> On MPlayer, things are different, and could be implemented in a more
> intelligent manner.
>
> We are supposed to be parse /pro/cpuinfo, or the output of this tool,
> so we can detect CMOV support on host cpu that way (note that FFmpeg
> doesn't do that AFAIK).
>
> We are also supposed to detect the CPU type that fits -mcpu, -march,
> -mtune flags of gcc, so we can do the same trick as in FFMPEG (i.e.
> enable CMOV depending on the cpu name we are about to pass to -march).
>
> We can also do as Ivan did, which is to test if an asm sample compiles
> and executes correctly.
>
>
>
> I think that using /proc/cpuinfo (or the program TOOLS/cpuinfo) is the
> safest and easiest way to do it BUT that means we need to disable CMOV
> in case we cross-compile or in case we compile with runtime cpu
> detection. Not a big deal maybe, but Geexbox folks may not like this.
>
> The safest solution is do do as I did on FFmpeg. It requires more
> maintainance at first look. GeexBox folks will be happier because we
> should be able to make do with cross-compilation.
>
> I don't have any opinion on Ivan's solution, it just doesn't look to
> be superior to either of the two solutions above.
>
> Thoughts?

We can do both.
As Zuxy pointed out, mmx do both.
I don't see problem doing the same for cmov.

I did follow the mmx detection as sample, but skipped the "early cut"
based on specific platform test, as /proc/cpuinfo test are linux
centric. While
the asm detection is the only 100% sure.

I'm going to commit my patch, so Guillaume could implement proper
platform specific tests.
I guess these are required for cross-compiling.

The only change I'm gonna do, is the line
"+$_def_cmov	// only define if you have CMOV (i686+, without VIA C3)"

(that's according to what Rathann told me on irc).



More information about the MPlayer-dev-eng mailing list