2 @// Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
4 @// Use of this source code is governed by a BSD-style license
5 @// that can be found in the LICENSE file in the root of the source
6 @// tree. An additional intellectual property rights grant can be found
7 @// in the file PATENTS. All contributing project authors may
8 @// be found in the AUTHORS file in the root of the source tree.
10 @// This file was originally licensed as follows. It has been
11 @// relicensed with permission from the copyright holders.
15 @// File Name: armSP_FFT_CToC_SC16_Radix2_ps_unsafe_s.s
16 @// OpenMAX DL: v1.0.2
17 @// Last Modified Revision: 6740
18 @// Last Modified Date: Wed, 18 Jul 2007
20 @// (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
25 @// Compute a Radix 2 FFT stage for a N point complex signal
30 @// Include standard headers
32 #include "dl/api/arm/armCOMM_s.h"
33 #include "dl/api/arm/omxtypes_s.h"
36 @// Import symbols required from other files
37 @// (For example tables)
42 @// Set debugging level
43 @//DEBUG_ON SETL {TRUE}
48 @// Guarding implementation by the processor name
63 @//Local Scratch Registers
65 #define outPointStep r3
90 .macro FFTSTAGE scaled, inverse, name
92 @// Define stack arguments
95 @// Update grpCount and grpSize rightaway inorder to reuse pGrpCount and pGrpSize regs
98 LSL grpCount,subFFTSize,#1
101 @// update subFFTSize for the next stage
102 MOV subFFTSize,grpCount
104 @// pOut0+1 increments pOut0 by 8 bytes
105 @// pOut0+outPointStep == increment of 4*outPointStep bytes = 2*size bytes
106 SMULBB outPointStep,grpCount,subFFTNum
107 MOV twStep,subFFTNum,LSL #1
108 LSR subFFTNum,subFFTNum,#1 @//grpSize
111 RSB dstStep,outPointStep,#8
114 @// Note: pointStep is 8 in this case: so need of extra reg
115 @// Loop on the groups: 2 groups at a time
119 VLD1 dW1S32[],[pTwiddle],twStep @//[wi | wr]
120 VLD1 dW2S32[],[pTwiddle],twStep
122 @// Process the sets for each grp: 2 sets at a time (no set looping required)
124 VLD1 dX0,[pSrc]! @// point0: of set0,set1 of grp0
125 VLD1 dX1,[pSrc]! @// point1: of set0,set1 of grp0
126 VLD1 dX2,[pSrc]! @// point0: of set0,set1 of grp1
127 VLD1 dX3,[pSrc]! @// point1: of set0,set1 of grp1
129 SUBS grpCount,grpCount,#4 @// decrement the loop counter
133 .ifeqs "\inverse", "TRUE"
135 VMLAL qT0,dX3,dW2 @// real part
137 VMLSL qT1,dX1,dW2 @// imag part
141 VMLSL qT0,dX3,dW2 @// real part
143 VMLAL qT1,dX1,dW2 @// imag part
153 .ifeqs "\scaled", "TRUE"
171 VST1 dY0,[pDst],outPointStep @// point0: of set0,set1 of grp0
172 VST1 dY1,[pDst],dstStep @// dstStep = -outPointStep + 8
173 VST1 dY2,[pDst],outPointStep @// point0: of set0,set1 of grp1
174 VST1 dY3,[pDst],dstStep @// point1: of set0,set1 of grp1
180 @// Reset and Swap pSrc and pDst for the next stage
182 SUB pDst,pSrc,outPointStep,LSL #1 @// pDst -= 2*size; pSrc -= 4*size bytes
183 SUB pSrc,pTmp,outPointStep
185 @// Reset pTwiddle for the next stage
186 SUB pTwiddle,pTwiddle,outPointStep @// pTwiddle -= 2*size bytes
192 M_START armSP_FFTFwd_CToC_SC16_Radix2_ps_OutOfPlace_unsafe,r4
193 FFTSTAGE "FALSE","FALSE",FWD
198 M_START armSP_FFTInv_CToC_SC16_Radix2_ps_OutOfPlace_unsafe,r4
199 FFTSTAGE "FALSE","TRUE",INV
204 M_START armSP_FFTFwd_CToC_SC16_Sfs_Radix2_ps_OutOfPlace_unsafe,r4
205 FFTSTAGE "TRUE","FALSE",FWDSFS
210 M_START armSP_FFTInv_CToC_SC16_Sfs_Radix2_ps_OutOfPlace_unsafe,r4
211 FFTSTAGE "TRUE","TRUE",INVSFS