aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2013-01-02 13:34:48 -0500
committerReinhard Tartler <siretart@tauware.de>2013-01-06 15:46:12 +0100
commita55700541756022043075975bca6a0b7376595b7 (patch)
tree4414e2058144c909f6a5e0b6a45e2e3121540057
parent8069b44ebfa2f9b86e900f35919f2caae105e25b (diff)
downloadffmpeg-a55700541756022043075975bca6a0b7376595b7.tar.gz
x86: lavr: use the x86inc.asm automatic stack alignment in mixing functions
CC:libav-stable@libav.org (cherry picked from commit 95d01c3f1c33c079db04e24133ba4a6b00d62d4a) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavresample/x86/audio_mix.asm35
1 files changed, 9 insertions, 26 deletions
diff --git a/libavresample/x86/audio_mix.asm b/libavresample/x86/audio_mix.asm
index daf0a7b335..8a298e2081 100644
--- a/libavresample/x86/audio_mix.asm
+++ b/libavresample/x86/audio_mix.asm
@@ -260,29 +260,20 @@ MIX_1_TO_2_S16P_FLT
%else
%assign matrix_elements_stack 0
%endif
+%assign matrix_stack_size matrix_elements_stack * mmsize
-cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, src0, src1, len, src2, src3, src4, src5, src6, src7
+%assign needed_stack_size -1 * matrix_stack_size
+%if ARCH_X86_32 && in_channels >= 7
+%assign needed_stack_size needed_stack_size - 16
+%endif
-; get aligned stack space if needed
-%if matrix_elements_stack > 0
- %if mmsize == 32
- %assign bkpreg %1 + 1
- %define bkpq r %+ bkpreg %+ q
- mov bkpq, rsp
- and rsp, ~(mmsize-1)
- sub rsp, matrix_elements_stack * mmsize
- %else
- %assign matrix_stack_size matrix_elements_stack * mmsize
- %assign pad matrix_stack_size + (mmsize - gprsize) - (stack_offset & (mmsize - gprsize))
- ; on x86-32 for 7 and 8 channels we need more stack space for src pointers
- %if ARCH_X86_32 && in_channels >= 7
- %assign pad pad + 0x10
+cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, needed_stack_size, src0, src1, len, src2, src3, src4, src5, src6, src7
+
+; define src pointers on stack if needed
+%if matrix_elements_stack > 0 && ARCH_X86_32 && in_channels >= 7
%define src5m [rsp+matrix_stack_size+0]
%define src6m [rsp+matrix_stack_size+4]
%define src7m [rsp+matrix_stack_size+8]
- %endif
- SUB rsp, pad
- %endif
%endif
; load matrix pointers
@@ -463,14 +454,6 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, s
add lenq, mmsize
jl .loop
-; restore stack pointer
-%if matrix_elements_stack > 0
- %if mmsize == 32
- mov rsp, bkpq
- %else
- ADD rsp, pad
- %endif
-%endif
; zero ymm high halves
%if mmsize == 32
vzeroupper