[x264-devel] commit: fix x86_32 ads which failed to preserve a register (Loren Merritt )

git version control git at videolan.org
Mon Mar 17 07:16:19 CET 2008


x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Sun Mar 16 22:28:20 2008 -0600| [357ab3381fbe85eca5d076c1ab5f6814d2a03215]

fix x86_32 ads which failed to preserve a register

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=357ab3381fbe85eca5d076c1ab5f6814d2a03215
---

 common/x86/pixel-a.asm |   18 ++++++++----------
 common/x86/x86inc.asm  |    2 ++
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/common/x86/pixel-a.asm b/common/x86/pixel-a.asm
index 0d2eab3..84e2cf1 100644
--- a/common/x86/pixel-a.asm
+++ b/common/x86/pixel-a.asm
@@ -1377,7 +1377,6 @@ cglobal x264_pixel_ssim_end4_sse2, 3,3
     mov     r10, rsp
 %else
     %define t0  r4
-    PUSH    rbp
     mov     rbp, rsp
 %endif
     mov     r0d, r5m
@@ -1403,7 +1402,7 @@ cglobal x264_pixel_ssim_end4_sse2, 3,3
 ; int x264_pixel_ads4_mmxext( int enc_dc[4], uint16_t *sums, int delta,
 ;                             uint16_t *cost_mvx, int16_t *mvs, int width, int thresh )
 ;-----------------------------------------------------------------------------
-cglobal x264_pixel_ads4_mmxext, 4,5
+cglobal x264_pixel_ads4_mmxext, 4,7
     movq    mm6, [r0]
     movq    mm4, [r0+8]
     pshufw  mm7, mm6, 0
@@ -1438,7 +1437,7 @@ cglobal x264_pixel_ads4_mmxext, 4,5
     movd    [t0], mm1
     ADS_END 1
 
-cglobal x264_pixel_ads2_mmxext, 4,5
+cglobal x264_pixel_ads2_mmxext, 4,7
     movq    mm6, [r0]
     pshufw  mm5, r6m, 0
     pshufw  mm7, mm6, 0
@@ -1459,7 +1458,7 @@ cglobal x264_pixel_ads2_mmxext, 4,5
     movd    [t0], mm4
     ADS_END 1
 
-cglobal x264_pixel_ads1_mmxext, 4,5
+cglobal x264_pixel_ads1_mmxext, 4,7
     pshufw  mm7, [r0], 0
     pshufw  mm6, r6m, 0
     ADS_START 2
@@ -1481,7 +1480,7 @@ cglobal x264_pixel_ads1_mmxext, 4,5
     ADS_END 2
 
 %macro ADS_SSE2 1
-cglobal x264_pixel_ads4_%1, 4,5
+cglobal x264_pixel_ads4_%1, 4,7
     movdqa  xmm4, [r0]
     pshuflw xmm7, xmm4, 0
     pshuflw xmm6, xmm4, 0xAA
@@ -1550,7 +1549,7 @@ cglobal x264_pixel_ads4_%1, 4,5
 %endif ; ARCH
     ADS_END 2
 
-cglobal x264_pixel_ads2_%1, 4,5
+cglobal x264_pixel_ads2_%1, 4,7
     movq    xmm6, [r0]
     movd    xmm5, r6m
     pshuflw xmm7, xmm6, 0
@@ -1576,7 +1575,7 @@ cglobal x264_pixel_ads2_%1, 4,5
     movq    [t0], xmm1
     ADS_END 2
 
-cglobal x264_pixel_ads1_%1, 4,5
+cglobal x264_pixel_ads1_%1, 4,7
     movd    xmm7, [r0]
     movd    xmm6, r6m
     pshuflw xmm7, xmm7, 0
@@ -1624,8 +1623,9 @@ ADS_SSE2 ssse3
 ;     }
 ;     return nmv;
 ; }
-%ifdef ARCH_X86_64
+global x264_pixel_ads_mvs
 ALIGN 16
+%ifdef ARCH_X86_64
 x264_pixel_ads_mvs:
     ; mvs = r4
     ; masks = rsp
@@ -1667,7 +1667,6 @@ x264_pixel_ads_mvs:
     ret
 
 %else
-ALIGN 16
 x264_pixel_ads_mvs:
     ; no PROLOGUE, inherit from x264_pixel_ads1
     mov     ebx, [ebp+stack_offset+20] ; mvs
@@ -1707,7 +1706,6 @@ x264_pixel_ads_mvs:
     jl .loopi
 .end:
     pop     esp
-    pop     ebp
     RET
 %endif ; ARCH
 
diff --git a/common/x86/x86inc.asm b/common/x86/x86inc.asm
index 2453552..b8fbe13 100644
--- a/common/x86/x86inc.asm
+++ b/common/x86/x86inc.asm
@@ -228,9 +228,11 @@ DECLARE_REG 6, ebp, ebp, bp, [esp + stack_offset + 28]
     ASSERT %2 >= %1
     %assign stack_offset 0
     %assign regs_used %2
+    %ifdef __PIC__
     %if %3
         %assign regs_used regs_used+1
     %endif
+    %endif
     ASSERT regs_used <= 7
     PUSH_IF_USED 3
     PUSH_IF_USED 4



More information about the x264-devel mailing list