]> granicus.if.org Git - libvpx/commitdiff
Make x86inc support local variable array
authorJingning Han <jingning@google.com>
Thu, 15 May 2014 01:22:18 +0000 (18:22 -0700)
committerJingning Han <jingning@google.com>
Mon, 19 May 2014 22:14:45 +0000 (15:14 -0700)
This commit modifies the x86inc to allow explicit local buffer
allocation and the corresponding stack pointer adjustment.

Change-Id: I3cb2174e0242b5869a4ba0ca0cd240ee066836c3

third_party/x86inc/x86inc.asm

index 5b22b94d68ca70f722d13c7765f5d1f49a48ade1..213467662e4e627130769a612e8c2dcf937535a6 100644 (file)
@@ -395,6 +395,23 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
     %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