[FFmpeg-devel] [PATCH] x86: vc1dsp: Convert vc1_inv_trans_*_dc to NASM format

Henrik Gramner henrik at gramner.com
Sun Jan 31 22:58:08 CET 2016

On Sun, Jan 31, 2016 at 10:18 PM, James Almer <jamrial at gmail.com> wrote:
> On 1/31/2016 4:48 PM, Timothy Gu wrote:
>> +; ff_vc1_inv_trans_?x?_dc_mmxext(uint8_t *dest, int linesize, int16_t *block)
>> +INIT_MMX mmxext
>> +cglobal vc1_inv_trans_4x4_dc, 3,4,0, dest, linesize, block
>> +    movsx         r3d, WORD [blockq]
> Can this value be negative? Because you're using it as an argument
> for lea using native size after movsx sign extended the value to 32
> bits, which means that on x86_64 the upper bits of the register will
> be zeroed.
> If it can you'll have to use blockq/r3q everywhere, and if it can't
> then use movzx and shr.

The destination of those lea instructions are 32-bit, so the upper
half is discarded anyway.

Fun fact: you _can_ use the 32-bit register form inside the lea
brackets, but doing so would just require a REX prefix without
affecting the output, so you don't really want to do that.

More information about the ffmpeg-devel mailing list