[FFmpeg-devel] [PATCH] Fix apply_welch_window_sse2 compilation on Mac OS X/x86
Wed Oct 17 22:05:11 CEST 2007
On Wed, 17 Oct 2007, Reimar D?ffinger wrote:
> Seems good to me, but someone must check the generated asm code if it is
> either the same or at least not something slower on the systems where it
> works currently (i.e. check that gcc does not something stupid like
> reloading i and/or j).
> Hm. On second thought. Why does gcc have a problem here? eax, ecx, edx,
> esi, edi and ebp _should_ be available and that would be enough (when
> compiling --disable-shared ebx would be available as well).
> Or does -fomit-frame-pointer not work here for some reason (thus
> allocating ebp)?
That may be it. While apply_welch_window_sse2 doesn't use the stack except
for variable spillage, it's only called in one place, so it gets inlined.
The caller allocates a variable-size array on the stack, so gcc decides to
use a frame pointer even with -fomit-frame-pointer.
That still shouldn't matter, because all the asm arguments are registers,
so the frame pointer and the pic pointer can't be involved in implicit
addressing, so the compiler should spill them if necessary. But gcc
isn't that smart.
But I don't think the fix is correct: It's not valid to jmp from one asm
block to another. If you split the asm block, you also have to write the
loop part in C. And the reason I put it in asm is that gcc doesn't
generate as efficient a loop.
More information about the ffmpeg-devel