From 4455f6243a5d2599f2c2209a57110989def36884 Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Fri, 30 Jan 2015 11:58:00 +0000 Subject: [PATCH] WebRtcIsacfix_Time2SpecNeon and _Spec2TimeNeon: Fix stack alignment The ABI (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf) says to 8-byte-align stack frames. That means we have to push an even number of registers on function entry if we want to be able to make subroutine calls without adjusting the stack first. BUG=4177 R=bjornv@webrtc.org, henrik.lundin@webrtc.org, zhongwei.yao@arm.com Review URL: https://webrtc-codereview.appspot.com/33149004 Cr-Commit-Position: refs/heads/master@{#8214} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8214 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../codecs/isac/fix/source/transform_neon.S | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/transform_neon.S b/webrtc/modules/audio_coding/codecs/isac/fix/source/transform_neon.S index 6713b28695..98ce3899a5 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/transform_neon.S +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/transform_neon.S @@ -27,7 +27,8 @@ GLOBAL_LABEL WebRtcIsacfix_kSinTab2 DEFINE_FUNCTION WebRtcIsacfix_Time2SpecNeon .align 2 - push {r4-r11,lr} + push {r3-r11,lr} @ need to push r4-r11, but push r3 too to keep + @ stack 8-byte aligned sub sp, sp, #(16 + FRAMESAMPLES * 4) str r0, [sp] @ inre1Q9 @@ -227,7 +228,7 @@ Time2Spec_PostFftTransform: bgt Time2Spec_PostFftTransform add sp, sp, #(16 + FRAMESAMPLES * 4) - pop {r4-r11,pc} + pop {r3-r11,pc} .align 8 @ Cosine table 1 in Q14 @@ -328,7 +329,8 @@ _WebRtcIsacfix_kSinTab1: @ Label for iOS DEFINE_FUNCTION WebRtcIsacfix_Spec2TimeNeon .align 2 - push {r4-r11,lr} + push {r3-r11,lr} @ need to push r4-r11, but push r3 too to keep + @ stack 8-byte aligned sub sp, sp, #16 str r0, [sp] @ inreQ7 @@ -640,4 +642,4 @@ DemodulateAndSeparate: bgt DemodulateAndSeparate add sp, sp, #16 - pop {r4-r11,pc} + pop {r3-r11,pc}