[FFmpeg-devel] [RFC] fix AMD64 OpenBSD 4.7 compilation

David Conrad lessen42
Sat Aug 21 06:31:15 CEST 2010


On Aug 20, 2010, at 1:33 PM, Reimar D?ffinger wrote:

> Hello,
> newer binutils are very lenient, accepting e.g. eax as register for
> addressing (which means silently substituting it by rax, since eax can't
> be used for addresses).

It's not binutils being lenient; addressing with 32-bit registers is distinct from using 64-bit registers (it uses the 0x67 prefix.) If openbsd's binutils doesn't accept addressing using 32-bit registers it's buggy.

But the usage in cabac seem buggy anyway since there's no guarantee that the table addresses will be in the lower 32 bits.

> OpenBSD 4.7 comes with an older binutils that does not work like that.
> Issues are in libavcodec/cabac.h and libavcodec/x86/vp56_arith.h.
> Attached is a quick hack that fixes the build, though to avoid larger
> changes the CABAC code now generates different code on 64 bit
> (otherwise the macro would need far more arguments, the register name
> for calculations and the one for addressing - e.g. eax and REG_a).

> Anotther strange thing is that just using movzb instead of movzbl
> works fine, however movzw is not recognized, you have to explicitly
> use either movzwl or movzwq though to my knowledge both result in the
> same instruction code...

That sounds identical to a bug I ran into recently in clang with -integrated-as...

> Opinions?



More information about the ffmpeg-devel mailing list