The CMSIS DSP 5 library

Dependents:   Nucleo-Heart-Rate ejercicioVrms2 PROYECTOFINAL ejercicioVrms ... more

Committer:
xorjoep
Date:
Thu Jun 21 11:56:27 2018 +0000
Revision:
3:4098b9d3d571
Parent:
1:24714b45cd1b
headers is a folder not a library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
xorjoep 1:24714b45cd1b 1 ;/* ----------------------------------------------------------------------
xorjoep 1:24714b45cd1b 2 ; * Project: CMSIS DSP Library
xorjoep 1:24714b45cd1b 3 ; * Title: arm_bitreversal2.S
xorjoep 1:24714b45cd1b 4 ; * Description: arm_bitreversal_32 function done in assembly for maximum speed.
xorjoep 1:24714b45cd1b 5 ; * Called after doing an fft to reorder the output.
xorjoep 1:24714b45cd1b 6 ; * The function is loop unrolled by 2. arm_bitreversal_16 as well.
xorjoep 1:24714b45cd1b 7 ; *
xorjoep 1:24714b45cd1b 8 ; * $Date: 27. January 2017
xorjoep 1:24714b45cd1b 9 ; * $Revision: V.1.5.1
xorjoep 1:24714b45cd1b 10 ; *
xorjoep 1:24714b45cd1b 11 ; * Target Processor: Cortex-M cores
xorjoep 1:24714b45cd1b 12 ; * -------------------------------------------------------------------- */
xorjoep 1:24714b45cd1b 13 ;/*
xorjoep 1:24714b45cd1b 14 ; * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved.
xorjoep 1:24714b45cd1b 15 ; *
xorjoep 1:24714b45cd1b 16 ; * SPDX-License-Identifier: Apache-2.0
xorjoep 1:24714b45cd1b 17 ; *
xorjoep 1:24714b45cd1b 18 ; * Licensed under the Apache License, Version 2.0 (the License); you may
xorjoep 1:24714b45cd1b 19 ; * not use this file except in compliance with the License.
xorjoep 1:24714b45cd1b 20 ; * You may obtain a copy of the License at
xorjoep 1:24714b45cd1b 21 ; *
xorjoep 1:24714b45cd1b 22 ; * www.apache.org/licenses/LICENSE-2.0
xorjoep 1:24714b45cd1b 23 ; *
xorjoep 1:24714b45cd1b 24 ; * Unless required by applicable law or agreed to in writing, software
xorjoep 1:24714b45cd1b 25 ; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
xorjoep 1:24714b45cd1b 26 ; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
xorjoep 1:24714b45cd1b 27 ; * See the License for the specific language governing permissions and
xorjoep 1:24714b45cd1b 28 ; * limitations under the License.
xorjoep 1:24714b45cd1b 29 ; */
xorjoep 1:24714b45cd1b 30
xorjoep 1:24714b45cd1b 31 #if defined ( __CC_ARM ) /* Keil */
xorjoep 1:24714b45cd1b 32 #define CODESECT AREA ||.text||, CODE, READONLY, ALIGN=2
xorjoep 1:24714b45cd1b 33 #define LABEL
xorjoep 1:24714b45cd1b 34 #elif defined ( __IASMARM__ ) /* IAR */
xorjoep 1:24714b45cd1b 35 #define CODESECT SECTION `.text`:CODE
xorjoep 1:24714b45cd1b 36 #define PROC
xorjoep 1:24714b45cd1b 37 #define LABEL
xorjoep 1:24714b45cd1b 38 #define ENDP
xorjoep 1:24714b45cd1b 39 #define EXPORT PUBLIC
xorjoep 1:24714b45cd1b 40 #elif defined ( __CSMC__ ) /* Cosmic */
xorjoep 1:24714b45cd1b 41 #define CODESECT switch .text
xorjoep 1:24714b45cd1b 42 #define THUMB
xorjoep 1:24714b45cd1b 43 #define EXPORT xdef
xorjoep 1:24714b45cd1b 44 #define PROC :
xorjoep 1:24714b45cd1b 45 #define LABEL :
xorjoep 1:24714b45cd1b 46 #define ENDP
xorjoep 1:24714b45cd1b 47 #define arm_bitreversal_32 _arm_bitreversal_32
xorjoep 1:24714b45cd1b 48 #elif defined ( __TI_ARM__ ) /* TI ARM */
xorjoep 1:24714b45cd1b 49 #define THUMB .thumb
xorjoep 1:24714b45cd1b 50 #define CODESECT .text
xorjoep 1:24714b45cd1b 51 #define EXPORT .global
xorjoep 1:24714b45cd1b 52 #define PROC : .asmfunc
xorjoep 1:24714b45cd1b 53 #define LABEL :
xorjoep 1:24714b45cd1b 54 #define ENDP .endasmfunc
xorjoep 1:24714b45cd1b 55 #define END
xorjoep 1:24714b45cd1b 56 #elif defined ( __GNUC__ ) /* GCC */
xorjoep 1:24714b45cd1b 57 #define THUMB .thumb
xorjoep 1:24714b45cd1b 58 #define CODESECT .section .text
xorjoep 1:24714b45cd1b 59 #define EXPORT .global
xorjoep 1:24714b45cd1b 60 #define PROC :
xorjoep 1:24714b45cd1b 61 #define LABEL :
xorjoep 1:24714b45cd1b 62 #define ENDP
xorjoep 1:24714b45cd1b 63 #define END
xorjoep 1:24714b45cd1b 64
xorjoep 1:24714b45cd1b 65 .syntax unified
xorjoep 1:24714b45cd1b 66 #endif
xorjoep 1:24714b45cd1b 67
xorjoep 1:24714b45cd1b 68 CODESECT
xorjoep 1:24714b45cd1b 69 THUMB
xorjoep 1:24714b45cd1b 70
xorjoep 1:24714b45cd1b 71 ;/*
xorjoep 1:24714b45cd1b 72 ;* @brief In-place bit reversal function.
xorjoep 1:24714b45cd1b 73 ;* @param[in, out] *pSrc points to the in-place buffer of unknown 32-bit data type.
xorjoep 1:24714b45cd1b 74 ;* @param[in] bitRevLen bit reversal table length
xorjoep 1:24714b45cd1b 75 ;* @param[in] *pBitRevTab points to bit reversal table.
xorjoep 1:24714b45cd1b 76 ;* @return none.
xorjoep 1:24714b45cd1b 77 ;*/
xorjoep 1:24714b45cd1b 78 EXPORT arm_bitreversal_32
xorjoep 1:24714b45cd1b 79 EXPORT arm_bitreversal_16
xorjoep 1:24714b45cd1b 80
xorjoep 1:24714b45cd1b 81 #if defined ( __CC_ARM ) /* Keil */
xorjoep 1:24714b45cd1b 82 #elif defined ( __IASMARM__ ) /* IAR */
xorjoep 1:24714b45cd1b 83 #elif defined ( __CSMC__ ) /* Cosmic */
xorjoep 1:24714b45cd1b 84 #elif defined ( __TI_ARM__ ) /* TI ARM */
xorjoep 1:24714b45cd1b 85 #elif defined ( __GNUC__ ) /* GCC */
xorjoep 1:24714b45cd1b 86 .type arm_bitreversal_16, %function
xorjoep 1:24714b45cd1b 87 .type arm_bitreversal_32, %function
xorjoep 1:24714b45cd1b 88 #endif
xorjoep 1:24714b45cd1b 89
xorjoep 1:24714b45cd1b 90 #if defined(ARM_MATH_CM0) || defined(ARM_MATH_CM0PLUS) || defined(ARM_MATH_ARMV8MBL)
xorjoep 1:24714b45cd1b 91
xorjoep 1:24714b45cd1b 92 arm_bitreversal_32 PROC
xorjoep 1:24714b45cd1b 93 ADDS r3,r1,#1
xorjoep 1:24714b45cd1b 94 PUSH {r4-r6}
xorjoep 1:24714b45cd1b 95 ADDS r1,r2,#0
xorjoep 1:24714b45cd1b 96 LSRS r3,r3,#1
xorjoep 1:24714b45cd1b 97 arm_bitreversal_32_0 LABEL
xorjoep 1:24714b45cd1b 98 LDRH r2,[r1,#2]
xorjoep 1:24714b45cd1b 99 LDRH r6,[r1,#0]
xorjoep 1:24714b45cd1b 100 ADD r2,r0,r2
xorjoep 1:24714b45cd1b 101 ADD r6,r0,r6
xorjoep 1:24714b45cd1b 102 LDR r5,[r2,#0]
xorjoep 1:24714b45cd1b 103 LDR r4,[r6,#0]
xorjoep 1:24714b45cd1b 104 STR r5,[r6,#0]
xorjoep 1:24714b45cd1b 105 STR r4,[r2,#0]
xorjoep 1:24714b45cd1b 106 LDR r5,[r2,#4]
xorjoep 1:24714b45cd1b 107 LDR r4,[r6,#4]
xorjoep 1:24714b45cd1b 108 STR r5,[r6,#4]
xorjoep 1:24714b45cd1b 109 STR r4,[r2,#4]
xorjoep 1:24714b45cd1b 110 ADDS r1,r1,#4
xorjoep 1:24714b45cd1b 111 SUBS r3,r3,#1
xorjoep 1:24714b45cd1b 112 BNE arm_bitreversal_32_0
xorjoep 1:24714b45cd1b 113 POP {r4-r6}
xorjoep 1:24714b45cd1b 114 BX lr
xorjoep 1:24714b45cd1b 115 ENDP
xorjoep 1:24714b45cd1b 116
xorjoep 1:24714b45cd1b 117 arm_bitreversal_16 PROC
xorjoep 1:24714b45cd1b 118 ADDS r3,r1,#1
xorjoep 1:24714b45cd1b 119 PUSH {r4-r6}
xorjoep 1:24714b45cd1b 120 ADDS r1,r2,#0
xorjoep 1:24714b45cd1b 121 LSRS r3,r3,#1
xorjoep 1:24714b45cd1b 122 arm_bitreversal_16_0 LABEL
xorjoep 1:24714b45cd1b 123 LDRH r2,[r1,#2]
xorjoep 1:24714b45cd1b 124 LDRH r6,[r1,#0]
xorjoep 1:24714b45cd1b 125 LSRS r2,r2,#1
xorjoep 1:24714b45cd1b 126 LSRS r6,r6,#1
xorjoep 1:24714b45cd1b 127 ADD r2,r0,r2
xorjoep 1:24714b45cd1b 128 ADD r6,r0,r6
xorjoep 1:24714b45cd1b 129 LDR r5,[r2,#0]
xorjoep 1:24714b45cd1b 130 LDR r4,[r6,#0]
xorjoep 1:24714b45cd1b 131 STR r5,[r6,#0]
xorjoep 1:24714b45cd1b 132 STR r4,[r2,#0]
xorjoep 1:24714b45cd1b 133 ADDS r1,r1,#4
xorjoep 1:24714b45cd1b 134 SUBS r3,r3,#1
xorjoep 1:24714b45cd1b 135 BNE arm_bitreversal_16_0
xorjoep 1:24714b45cd1b 136 POP {r4-r6}
xorjoep 1:24714b45cd1b 137 BX lr
xorjoep 1:24714b45cd1b 138 ENDP
xorjoep 1:24714b45cd1b 139
xorjoep 1:24714b45cd1b 140 #else
xorjoep 1:24714b45cd1b 141
xorjoep 1:24714b45cd1b 142 arm_bitreversal_32 PROC
xorjoep 1:24714b45cd1b 143 ADDS r3,r1,#1
xorjoep 1:24714b45cd1b 144 CMP r3,#1
xorjoep 1:24714b45cd1b 145 IT LS
xorjoep 1:24714b45cd1b 146 BXLS lr
xorjoep 1:24714b45cd1b 147 PUSH {r4-r9}
xorjoep 1:24714b45cd1b 148 ADDS r1,r2,#2
xorjoep 1:24714b45cd1b 149 LSRS r3,r3,#2
xorjoep 1:24714b45cd1b 150 arm_bitreversal_32_0 LABEL ;/* loop unrolled by 2 */
xorjoep 1:24714b45cd1b 151 LDRH r8,[r1,#4]
xorjoep 1:24714b45cd1b 152 LDRH r9,[r1,#2]
xorjoep 1:24714b45cd1b 153 LDRH r2,[r1,#0]
xorjoep 1:24714b45cd1b 154 LDRH r12,[r1,#-2]
xorjoep 1:24714b45cd1b 155 ADD r8,r0,r8
xorjoep 1:24714b45cd1b 156 ADD r9,r0,r9
xorjoep 1:24714b45cd1b 157 ADD r2,r0,r2
xorjoep 1:24714b45cd1b 158 ADD r12,r0,r12
xorjoep 1:24714b45cd1b 159 LDR r7,[r9,#0]
xorjoep 1:24714b45cd1b 160 LDR r6,[r8,#0]
xorjoep 1:24714b45cd1b 161 LDR r5,[r2,#0]
xorjoep 1:24714b45cd1b 162 LDR r4,[r12,#0]
xorjoep 1:24714b45cd1b 163 STR r6,[r9,#0]
xorjoep 1:24714b45cd1b 164 STR r7,[r8,#0]
xorjoep 1:24714b45cd1b 165 STR r5,[r12,#0]
xorjoep 1:24714b45cd1b 166 STR r4,[r2,#0]
xorjoep 1:24714b45cd1b 167 LDR r7,[r9,#4]
xorjoep 1:24714b45cd1b 168 LDR r6,[r8,#4]
xorjoep 1:24714b45cd1b 169 LDR r5,[r2,#4]
xorjoep 1:24714b45cd1b 170 LDR r4,[r12,#4]
xorjoep 1:24714b45cd1b 171 STR r6,[r9,#4]
xorjoep 1:24714b45cd1b 172 STR r7,[r8,#4]
xorjoep 1:24714b45cd1b 173 STR r5,[r12,#4]
xorjoep 1:24714b45cd1b 174 STR r4,[r2,#4]
xorjoep 1:24714b45cd1b 175 ADDS r1,r1,#8
xorjoep 1:24714b45cd1b 176 SUBS r3,r3,#1
xorjoep 1:24714b45cd1b 177 BNE arm_bitreversal_32_0
xorjoep 1:24714b45cd1b 178 POP {r4-r9}
xorjoep 1:24714b45cd1b 179 BX lr
xorjoep 1:24714b45cd1b 180 ENDP
xorjoep 1:24714b45cd1b 181
xorjoep 1:24714b45cd1b 182 arm_bitreversal_16 PROC
xorjoep 1:24714b45cd1b 183 ADDS r3,r1,#1
xorjoep 1:24714b45cd1b 184 CMP r3,#1
xorjoep 1:24714b45cd1b 185 IT LS
xorjoep 1:24714b45cd1b 186 BXLS lr
xorjoep 1:24714b45cd1b 187 PUSH {r4-r9}
xorjoep 1:24714b45cd1b 188 ADDS r1,r2,#2
xorjoep 1:24714b45cd1b 189 LSRS r3,r3,#2
xorjoep 1:24714b45cd1b 190 arm_bitreversal_16_0 LABEL ;/* loop unrolled by 2 */
xorjoep 1:24714b45cd1b 191 LDRH r8,[r1,#4]
xorjoep 1:24714b45cd1b 192 LDRH r9,[r1,#2]
xorjoep 1:24714b45cd1b 193 LDRH r2,[r1,#0]
xorjoep 1:24714b45cd1b 194 LDRH r12,[r1,#-2]
xorjoep 1:24714b45cd1b 195 ADD r8,r0,r8,LSR #1
xorjoep 1:24714b45cd1b 196 ADD r9,r0,r9,LSR #1
xorjoep 1:24714b45cd1b 197 ADD r2,r0,r2,LSR #1
xorjoep 1:24714b45cd1b 198 ADD r12,r0,r12,LSR #1
xorjoep 1:24714b45cd1b 199 LDR r7,[r9,#0]
xorjoep 1:24714b45cd1b 200 LDR r6,[r8,#0]
xorjoep 1:24714b45cd1b 201 LDR r5,[r2,#0]
xorjoep 1:24714b45cd1b 202 LDR r4,[r12,#0]
xorjoep 1:24714b45cd1b 203 STR r6,[r9,#0]
xorjoep 1:24714b45cd1b 204 STR r7,[r8,#0]
xorjoep 1:24714b45cd1b 205 STR r5,[r12,#0]
xorjoep 1:24714b45cd1b 206 STR r4,[r2,#0]
xorjoep 1:24714b45cd1b 207 ADDS r1,r1,#8
xorjoep 1:24714b45cd1b 208 SUBS r3,r3,#1
xorjoep 1:24714b45cd1b 209 BNE arm_bitreversal_16_0
xorjoep 1:24714b45cd1b 210 POP {r4-r9}
xorjoep 1:24714b45cd1b 211 BX lr
xorjoep 1:24714b45cd1b 212 ENDP
xorjoep 1:24714b45cd1b 213
xorjoep 1:24714b45cd1b 214 #endif
xorjoep 1:24714b45cd1b 215
xorjoep 1:24714b45cd1b 216 END