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

David Conrad lessen42
Sat Aug 21 08:37:14 CEST 2010


On Aug 21, 2010, at 2:22 AM, Reimar D?ffinger wrote:

> On Sat, Aug 21, 2010 at 12:31:15AM -0400, David Conrad wrote:
>> 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.
> 
> I somehow missed that existed...
> It's still a bit of a waste of bytes, since it could use the 64 bit registers.

Arithmetic instructions need an rex prefix to use 64-bit registers, so using 32-bit will probably use fewer bytes.
Maybe use something like "leal (%q0, %q1), %3" for the lea-as-add case.

>> But the usage in cabac seem buggy anyway since there's no guarantee that the table addresses will be in the lower 32 bits.
> 
> The e* registers are not used for any addresses, only for offsets.
> Unless using the 0x67 prefix means using 32 bit addresses, not only
> 32 bit registers for the offsets...

Yes, the 0x67 prefix means 32-bit addressing.



More information about the ffmpeg-devel mailing list