x86: h264: Don't use redzone in AVX h264_deblock on Win64

Message ID 1361437894-23176-1-git-send-email-martin@martin.st
State Committed
Commit 311443f6c7eb230276e320f2d30a5d729cf32b76
Headers show

Commit Message

Martin Storsjö Feb. 21, 2013, 9:11 a.m.
From: Matt Wolenetz <wolenetz@chromium.org>

---
 libavcodec/x86/h264_deblock.asm |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Luca Barbato Feb. 21, 2013, 9:32 a.m. | #1
On 21/02/13 10:11, Martin Storsjö wrote:
> From: Matt Wolenetz <wolenetz@chromium.org>
> 

Ok if tested, few lines on what it fixes would be good for the general
audience.

lu
Martin Storsjö Feb. 21, 2013, 10:15 a.m. | #2
On Thu, 21 Feb 2013, Luca Barbato wrote:

> On 21/02/13 10:11, Martin Storsjö wrote:
>> From: Matt Wolenetz <wolenetz@chromium.org>
>> 
>
> Ok if tested, few lines on what it fixes would be good for the general
> audience.

Will amend the commit message - this fixes crashes in chromium on win64 on 
machines with AVX (crashes that apparently aren't triggered by fate)

// Martin
Ronald Bultje Feb. 22, 2013, 7:25 p.m. | #3
Hi,

On Thu, Feb 21, 2013 at 1:11 AM, Martin Storsjö <martin@martin.st> wrote:
> +%if WIN64
> +cglobal deblock_%1_luma_intra_8, 4,6,16,0x10
> +%else
>  cglobal deblock_%1_luma_intra_8, 4,6,16,ARCH_X86_64*0x50-0x50
> +%endif

I believe this doesn't need a stack pointer, so you can use -0x10.

Ronald
Ronald Bultje Feb. 22, 2013, 7:25 p.m. | #4
Hi,

On Fri, Feb 22, 2013 at 11:25 AM, Ronald S. Bultje <rsbultje@gmail.com> wrote:
> On Thu, Feb 21, 2013 at 1:11 AM, Martin Storsjö <martin@martin.st> wrote:
>> +%if WIN64
>> +cglobal deblock_%1_luma_intra_8, 4,6,16,0x10
>> +%else
>>  cglobal deblock_%1_luma_intra_8, 4,6,16,ARCH_X86_64*0x50-0x50
>> +%endif
>
> I believe this doesn't need a stack pointer, so you can use -0x10.

Oh actually that's 32bit only, so that never makes a functional
difference, so nevermind.

Ronald

Patch

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 1f1dbc6..67f9c02 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -621,7 +621,11 @@  DEBLOCK_LUMA v, 16
     %define t5 m11
     %define mask0 m12
     %define mask1p m13
+%if WIN64
+    %define mask1q [rsp]
+%else
     %define mask1q [rsp-24]
+%endif
     %define mpb_0 m14
     %define mpb_1 m15
 %else
@@ -640,7 +644,11 @@  DEBLOCK_LUMA v, 16
 ;-----------------------------------------------------------------------------
 ; void deblock_v_luma_intra( uint8_t *pix, int stride, int alpha, int beta )
 ;-----------------------------------------------------------------------------
+%if WIN64
+cglobal deblock_%1_luma_intra_8, 4,6,16,0x10
+%else
 cglobal deblock_%1_luma_intra_8, 4,6,16,ARCH_X86_64*0x50-0x50
+%endif
     lea     r4, [r1*4]
     lea     r5, [r1*3] ; 3*stride
     dec     r2d        ; alpha-1