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 is a modification of armSP_FFT_CToC_SC32_Radix2_ls_unsafe_s.S
11 @// to support float instead of SC32.
16 @// Compute the last stage of a Radix 2 DIT in-order out-of-place FFT
17 @// stage for a N point complex signal.
22 @// Include standard headers
24 #include "dl/api/arm/armCOMM_s.h"
25 #include "dl/api/arm/omxtypes_s.h"
28 @// Import symbols required from other files
29 @// (For example tables)
34 @// Set debugging level
35 @//DEBUG_ON SETL {TRUE}
38 @// Guarding implementation by the processor name
53 @//Local Scratch Registers
56 #define outPointStep r3
76 .macro FFTSTAGE scaled, inverse, name
79 MOV outPointStep,subFFTSize,LSL #3
80 @// Update grpCount and grpSize rightaway
82 MOV subFFTNum,#1 @//after the last stage
83 LSL grpCount,subFFTSize,#1
85 @// update subFFTSize for the next stage
86 MOV subFFTSize,grpCount
88 RSB dstStep,outPointStep,#16
91 @// Loop on 2 grps at a time for the last stage
93 radix2lsGrpLoop\name :
94 @ dWr = [pTwiddle[0].Re, pTwiddle[1].Re]
95 @ dWi = [pTwiddle[0].Im, pTwiddle[1].Im]
96 VLD2 {dWr,dWi},[pTwiddle :64]!
98 @ dXr0 = [pSrc[0].Re, pSrc[2].Re]
99 @ dXi0 = [pSrc[0].Im, pSrc[2].Im]
100 @ dXr1 = [pSrc[1].Re, pSrc[3].Re]
101 @ dXi1 = [pSrc[1].Im, pSrc[3].Im]
102 VLD4 {dXr0,dXi0,dXr1,dXi1},[pSrc :128]!
103 SUBS grpCount,grpCount,#4 @// grpCount is multiplied by 2
105 .ifeqs "\inverse", "TRUE"
107 VMLA qT0,dWi,dXi1 @// real part
109 VMLS qT1,dWi,dXr1 @// imag part
114 VMLS qT0,dWi,dXi1 @// real part
116 VMLA qT1,dWi,dXr1 @// imag part
125 VST2 {dYr0,dYi0},[pDst],outPointStep
126 VST2 {dYr1,dYi1},[pDst],dstStep @// dstStep = step = -outPointStep + 16
128 BGT radix2lsGrpLoop\name
131 @// Reset and Swap pSrc and pDst for the next stage
133 SUB pDst,pSrc,outPointStep,LSL #1 @// pDst -= 4*size; pSrc -= 8*size bytes
134 SUB pSrc,pTmp,outPointStep
136 @// Reset pTwiddle for the next stage
137 SUB pTwiddle,pTwiddle,outPointStep @// pTwiddle -= 4*size bytes
143 M_START armSP_FFTFwd_CToC_FC32_Radix2_ls_OutOfPlace_unsafe,r4,""
144 FFTSTAGE "FALSE","FALSE",fwd
149 M_START armSP_FFTInv_CToC_FC32_Radix2_ls_OutOfPlace_unsafe,r4
150 FFTSTAGE "FALSE","TRUE",inv