shithub: libvpx

Download patch

ref: 4e4e7fa9122ffbe7ab3612dce8d28d47441ce53a
parent: 806fa6aacad1c8514c100198b21f21768bf0bc54
author: Jingning Han <jingning@google.com>
date: Wed May 14 14:22:18 EDT 2014

Make x86inc support local variable array

This commit modifies the x86inc to allow explicit local buffer
allocation and the corresponding stack pointer adjustment.

Change-Id: I3cb2174e0242b5869a4ba0ca0cd240ee066836c3

--- a/third_party/x86inc/x86inc.asm
+++ b/third_party/x86inc/x86inc.asm
@@ -395,6 +395,23 @@
     %assign n_arg_names %0
 %endmacro
 
+%if ARCH_X86_64
+%macro ALLOC_STACK 2  ; stack_size, num_regs
+  %assign %%stack_aligment ((mmsize + 15) & ~15)
+  %assign stack_size_padded %1
+
+  %assign %%reg_num (%2 - 1)
+  %xdefine rsp_tmp r %+ %%reg_num
+  mov  rsp_tmp, rsp
+  sub  rsp, stack_size_padded
+  and  rsp, ~(%%stack_aligment - 1)
+%endmacro
+
+%macro RESTORE_STACK 0  ; reset rsp register
+  mov  rsp, rsp_tmp
+%endmacro
+%endif
+
 %if WIN64 ; Windows x64 ;=================================================
 
 DECLARE_REG 0,  rcx, ecx,  cx,   cl