[MPlayer-dev-eng] [PATCH] configure cmov detection
Guillaume Poirier
gpoirier at mplayerhq.hu
Thu Oct 26 10:44:29 CEST 2006
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?
Guillaume
More information about the MPlayer-dev-eng
mailing list