1 ;/* ----------------------------------------------------------------------
2 ; * Project: CMSIS DSP Library
3 ; * Title: arm_bitreversal2.S
4 ; * Description: arm_bitreversal_32 function done in assembly for maximum speed.
5 ; * Called after doing an fft to reorder the output.
6 ; * The function is loop unrolled by 2. arm_bitreversal_16 as well.
8 ; * $Date: 27. January 2017
11 ; * Target Processor: Cortex-M cores
12 ; * -------------------------------------------------------------------- */
14 ; * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved.
16 ; * SPDX-License-Identifier: Apache-2.0
18 ; * Licensed under the Apache License, Version 2.0 (the License); you may
19 ; * not use this file except in compliance with the License.
20 ; * You may obtain a copy of the License at
22 ; * www.apache.org/licenses/LICENSE-2.0
24 ; * Unless required by applicable law or agreed to in writing, software
25 ; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
26 ; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27 ; * See the License for the specific language governing permissions and
28 ; * limitations under the License.
31 #if defined ( __CC_ARM ) /* Keil */
32 #define CODESECT AREA ||.text||, CODE, READONLY, ALIGN=2
34 #elif defined ( __IASMARM__ ) /* IAR */
35 #define CODESECT SECTION `.text`:CODE
40 #elif defined ( __CSMC__ ) /* Cosmic */
41 #define CODESECT switch .text
47 #define arm_bitreversal_32 _arm_bitreversal_32
48 #elif defined ( __TI_ARM__ ) /* TI ARM */
50 #define CODESECT .text
51 #define EXPORT .global
52 #define PROC : .asmfunc
54 #define ENDP .endasmfunc
56 #elif defined ( __GNUC__ ) /* GCC */
58 #define CODESECT .section .text
59 #define EXPORT .global
72 ;* @brief In-place bit reversal function.
73 ;* @param[in, out] *pSrc points to the in-place buffer of unknown 32-bit data type.
74 ;* @param[in] bitRevLen bit reversal table length
75 ;* @param[in] *pBitRevTab points to bit reversal table.
78 EXPORT arm_bitreversal_32
79 EXPORT arm_bitreversal_16
81 #if defined ( __CC_ARM ) /* Keil */
82 #elif defined ( __IASMARM__ ) /* IAR */
83 #elif defined ( __CSMC__ ) /* Cosmic */
84 #elif defined ( __TI_ARM__ ) /* TI ARM */
85 #elif defined ( __GNUC__ ) /* GCC */
86 .type arm_bitreversal_16, %function
87 .type arm_bitreversal_32, %function
90 #if defined(ARM_MATH_CM0) || defined(ARM_MATH_CM0PLUS) || defined(ARM_MATH_ARMV8MBL)
92 arm_bitreversal_32 PROC
97 arm_bitreversal_32_0 LABEL
112 BNE arm_bitreversal_32_0
117 arm_bitreversal_16 PROC
122 arm_bitreversal_16_0 LABEL
135 BNE arm_bitreversal_16_0
142 arm_bitreversal_32 PROC
150 arm_bitreversal_32_0 LABEL ;/* loop unrolled by 2 */
177 BNE arm_bitreversal_32_0
182 arm_bitreversal_16 PROC
190 arm_bitreversal_16_0 LABEL ;/* loop unrolled by 2 */
198 ADD r12,r0,r12,LSR #1
209 BNE arm_bitreversal_16_0