[Ffmpeg-devel] x86/SSE fix to ensure 16-byte alignment on local variables

Rich Felker dalias
Sun Nov 12 04:41:51 CET 2006


On Sat, Nov 11, 2006 at 02:39:34PM +0800, Zuxy Meng wrote:
> IIRC stack will be aligned to 16-byte boundary on x86-64 by default,
> so the hack is only needed for x86-32, on which an ABI change will be
> required.

Which is not an option. gcc has no authority to change the ABI, which
has been stable for the last 15+ years and for which there is no
legitimate reason to change.

> ICC aligns stack by using %ebx to save the original (possibly
> unaligned) stack pointer, but that means another valuable general
> register will be wasted.

It's easy to store the old stack pointer on the stack. The penalty
only applies for functions which have unusually-aligned buffers on the
stack, so it's largely irrelevant.

> The upcoming gcc 4.2.0 has a function attribute
> force_align_arg_pointer which might help, but I haven't tried it.

Not very useful since it's not available in most gcc versions (all
existing ones).

Rich





More information about the ffmpeg-devel mailing list