[x265] [PATCH] asm: align stack to 64-bytes, to avoid crash

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Wed Apr 16 16:02:54 CEST 2014


# HG changeset patch
# User Dnyaneshwar G <dnyaneshwar at multicorewareinc.com>
# Date 1397656046 -19800
#      Wed Apr 16 19:17:26 2014 +0530
# Node ID 02ab691ea6ecceb5495d0ffa3f71d7752aecc046
# Parent  0b696c7f46f261f66ecebbe3280b17c01165f3d0
asm: align stack to 64-bytes, to avoid crash

diff -r 0b696c7f46f2 -r 02ab691ea6ec source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Tue Apr 15 14:07:33 2014 -0500
+++ b/source/common/x86/intrapred8.asm	Wed Apr 16 19:17:26 2014 +0530
@@ -619,7 +619,13 @@
   %define bottomRow2    m10
   %define bottomRow3    m11
 %else
-cglobal intra_pred_planar32, 4,7,8,0-(4*mmsize)
+cglobal intra_pred_planar32, 4,7,8
+  ; align stack to 64-bytes
+  mov r6, rsp
+  sub rsp, 64+gprsize
+  and rsp, ~63
+  mov [rsp+64], r6
+
   %define bottomRow0    [rsp + 0 * mmsize]
   %define bottomRow1    [rsp + 1 * mmsize]
   %define bottomRow2    [rsp + 2 * mmsize]
@@ -713,7 +719,9 @@
     dec             r3
     jnz .loop
 %undef COMP_PRED_PLANAR_ROW
-
+%if ARCH_X86_64 == 0
+    mov rsp, [rsp+64]
+%endif
     RET
 
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list