[MPlayer-users] Proper FAST_CMOV check possible?

Edd Barrett vext01 at gmail.com
Thu Aug 5 00:14:19 CEST 2010


Hi,

On Wed, Aug 4, 2010 at 6:51 PM, Edd Barrett <vext01 at gmail.com> wrote:
> On Wed, Aug 4, 2010 at 4:20 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>> Edd Barrett <vext01 <at> gmail.com> writes:
>>
>>> I don't know why this is at the moment, but I hope to dig further in the
>>> future.
>>>
>>> In the meanwhile, any suggestions or hints are welcomed.
>>
>> diff -uw ffmpeg/config.h mplayer/config.h
>> diff -uw ffmpeg/config.mak mplayer/config.mak
>> cd ffmpeg
>> rm libavcodec/h264_cabac.o libavcodec/libavcodec.a
>> make V=1
>> and compare with MPlayer's compilation command.
>>
>> You could ask Mike Melanson or Michael Kostylev how FFmpeg builds on FATE, if
>> disable cmov is really required (is is also required for you with
>> --disable-debug?), you should disable it automatically for MPlayer.
>
> This is very odd and I think it mostly relates to binutils. If you set
> HAVE_EBX_AVAILABLE to 0, the build suceeds
>
> openbsd doesn't like something in the:
> #if ! ( ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE &&
> !defined(BROKEN_RELOCATIONS) )
> in libavcodec/cabac.h.
>
> It could be any one of those flags that I am supposed to turn off ofcourse.
>
> Next question is, does anyone see a suitible workaround?

After mor investigation in the ffmpeg code, it seems that their
configure script correctly identifies (?) HAVE_EBX_AVAILABLE 0. This
check:

---8<---
    # check whether EBX is available on x86
    check_asm ebx_available '""::"b"(0)' &&
        check_asm ebx_available '"":::"%ebx"'
---8<---

results in:

---8<---
check_asm ebx_available ""::"b"(0)
check_as
BEGIN /tmp/ffconf.XXXXX...18928.c
    1   void foo(void){ __asm__ volatile(""::"b"(0)); }
END /tmp/ffconf.XXXXX...18928.c
gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFIL
E_SOURCE -DPIC -fPIC -c -o /tmp/ffconf.XXXXX...18928.o /tmp/ffconf.XXXXX...18928
.c
/tmp/ffconf.XXXXX...18928.c: In function 'foo':
/tmp/ffconf.XXXXX...18928.c:1: error: can't find a register in class 'BREG' whil
e reloading 'asm'
/tmp/ffconf.XXXXX...18928.c:1: error: 'asm' operand has impossible constraints
check_cc
BEGIN /tmp/ffconf.XXXXX...18928.c
    1   int main(void) {
    2       int x=0;
    3       __asm__ volatile(
    4           ""
    5           :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x
)
    6       );
    7       return 0;
    8   }
END /tmp/ffconf.XXXXX...18928.c
gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFIL
E_SOURCE -DPIC -std=c99 -fomit-frame-pointer -fPIC -c -o /tmp/ffconf.XXXXX...189
28.o /tmp/ffconf.XXXXX...18928.c
/tmp/ffconf.XXXXX...18928.c: In function 'main':
/tmp/ffconf.XXXXX...18928.c:3: error: can't find a register in class 'GENERAL_RE
GS' while reloading 'asm'
---8<---

Do you need a check like this in mplayer?

-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk


More information about the MPlayer-users mailing list