[FFmpeg-devel] [PATCH] Fix apply_welch_window_sse2 compilation on Mac OS X/x86
Pierre d'Herbemont
pdherbemont
Thu Oct 18 02:02:16 CEST 2007
On Oct 17, 2007, at 10:05 PM, Loren Merritt wrote:
> 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.
There is no problem in jumping from one asm block to an other.
However there can be problem with labels.
Here, the only reason of jmp failing would be the definition of the
1: label by gcc between the two blocks. If I recall well gcc does
name it's label Lxxx, so no problem here. Moreover there shouldn't be
any jmp in the in-between code.
Here is the assembly output I get:
22531 1:
22532 movapd %xmm7, %xmm1
22533 mulpd %xmm1, %xmm1
22534 movapd %xmm6, %xmm0
22535 subpd %xmm1, %xmm0
22536 pshufd $0x4e, %xmm0, %xmm1
22537 cvtpi2pd (%edx,%esi), %xmm2
22538 cvtpi2pd (%eax,%ecx), %xmm3
22539
22540 sall $3, %edi
22541 movl %edi, -64(%ebp)
22542 movl -48(%ebp), %edx
22543 addl %edi, %edx
22544 movl 12(%ebp), %edi
22545 movl -48(%ebp), %eax
22546 leal (%eax,%edi,8), %edi
22547 movl %edi, -60(%ebp)
22548 movl -64(%ebp), %eax
22549 subl %eax, %edi
22550 movl %edi, %eax
22551 subl $16, %eax
22552 mulpd %xmm0, %xmm2
22553 mulpd %xmm1, %xmm3
22554 movapd %xmm2, (%edx,%esi,2)
22555 movupd %xmm3, (%eax,%ecx,2)
22556 subpd %xmm5, %xmm7
22557 sub $8, %ecx
22558 add $8, %esi
22559 jl 1b
Thanks for the review,
Pierre.
More information about the ffmpeg-devel
mailing list