CMSIS DSP library

Dependents:   KL25Z_FFT_Demo Hat_Board_v5_1 KL25Z_FFT_Demo_tony KL25Z_FFT_Demo_tony ... more

Fork of mbed-dsp by mbed official

Committer:
mbed_official
Date:
Fri Nov 08 13:45:10 2013 +0000
Revision:
3:7a284390b0ce
Synchronized with git revision e69956aba2f68a2a26ac26b051f8d349deaa1ce8

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 3:7a284390b0ce 1 ;/* ----------------------------------------------------------------------
mbed_official 3:7a284390b0ce 2 ;* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
mbed_official 3:7a284390b0ce 3 ;*
mbed_official 3:7a284390b0ce 4 ;* $Date: 17. January 2013
mbed_official 3:7a284390b0ce 5 ;* $Revision: V1.4.1
mbed_official 3:7a284390b0ce 6 ;*
mbed_official 3:7a284390b0ce 7 ;* Project: CMSIS DSP Library
mbed_official 3:7a284390b0ce 8 ;* Title: arm_bitreversal2.S
mbed_official 3:7a284390b0ce 9 ;*
mbed_official 3:7a284390b0ce 10 ;* Description: This is the arm_bitreversal_32 function done in
mbed_official 3:7a284390b0ce 11 ;* assembly for maximum speed. This function is called
mbed_official 3:7a284390b0ce 12 ;* after doing an fft to reorder the output. The function
mbed_official 3:7a284390b0ce 13 ;* is loop unrolled by 2.
mbed_official 3:7a284390b0ce 14 ;*
mbed_official 3:7a284390b0ce 15 ;* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
mbed_official 3:7a284390b0ce 16 ;*
mbed_official 3:7a284390b0ce 17 ;* Redistribution and use in source and binary forms, with or without
mbed_official 3:7a284390b0ce 18 ;* modification, are permitted provided that the following conditions
mbed_official 3:7a284390b0ce 19 ;* are met:
mbed_official 3:7a284390b0ce 20 ;* - Redistributions of source code must retain the above copyright
mbed_official 3:7a284390b0ce 21 ;* notice, this list of conditions and the following disclaimer.
mbed_official 3:7a284390b0ce 22 ;* - Redistributions in binary form must reproduce the above copyright
mbed_official 3:7a284390b0ce 23 ;* notice, this list of conditions and the following disclaimer in
mbed_official 3:7a284390b0ce 24 ;* the documentation and/or other materials provided with the
mbed_official 3:7a284390b0ce 25 ;* distribution.
mbed_official 3:7a284390b0ce 26 ;* - Neither the name of ARM LIMITED nor the names of its contributors
mbed_official 3:7a284390b0ce 27 ;* may be used to endorse or promote products derived from this
mbed_official 3:7a284390b0ce 28 ;* software without specific prior written permission.
mbed_official 3:7a284390b0ce 29 ;*
mbed_official 3:7a284390b0ce 30 ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
mbed_official 3:7a284390b0ce 31 ;* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
mbed_official 3:7a284390b0ce 32 ;* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
mbed_official 3:7a284390b0ce 33 ;* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
mbed_official 3:7a284390b0ce 34 ;* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
mbed_official 3:7a284390b0ce 35 ;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
mbed_official 3:7a284390b0ce 36 ;* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 3:7a284390b0ce 37 ;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 3:7a284390b0ce 38 ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
mbed_official 3:7a284390b0ce 39 ;* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
mbed_official 3:7a284390b0ce 40 ;* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 3:7a284390b0ce 41 ;* POSSIBILITY OF SUCH DAMAGE.
mbed_official 3:7a284390b0ce 42 ;* -------------------------------------------------------------------- */
mbed_official 3:7a284390b0ce 43 #if defined(__CC_ARM) //Keil
mbed_official 3:7a284390b0ce 44 #define CODESECT AREA ||.text||, CODE, READONLY, ALIGN=2
mbed_official 3:7a284390b0ce 45 #define LABEL
mbed_official 3:7a284390b0ce 46 #elif defined(__IASMARM__) //IAR
mbed_official 3:7a284390b0ce 47 #define CODESECT SECTION `.text`:CODE
mbed_official 3:7a284390b0ce 48 #define PROC
mbed_official 3:7a284390b0ce 49 #define LABEL
mbed_official 3:7a284390b0ce 50 #define ENDP
mbed_official 3:7a284390b0ce 51 #define EXPORT PUBLIC
mbed_official 3:7a284390b0ce 52 #elif defined (__GNUC__) //GCC
mbed_official 3:7a284390b0ce 53 .syntax unified
mbed_official 3:7a284390b0ce 54 .cpu cortex-m4
mbed_official 3:7a284390b0ce 55 .fpu softvfp
mbed_official 3:7a284390b0ce 56 #define THUMB .thumb
mbed_official 3:7a284390b0ce 57 #define CODESECT .section text
mbed_official 3:7a284390b0ce 58 #define EXPORT .global
mbed_official 3:7a284390b0ce 59 #define PROC :
mbed_official 3:7a284390b0ce 60 #define LABEL :
mbed_official 3:7a284390b0ce 61 #define ENDP
mbed_official 3:7a284390b0ce 62 #define END
mbed_official 3:7a284390b0ce 63 #endif
mbed_official 3:7a284390b0ce 64
mbed_official 3:7a284390b0ce 65 CODESECT
mbed_official 3:7a284390b0ce 66 THUMB
mbed_official 3:7a284390b0ce 67
mbed_official 3:7a284390b0ce 68 ;/*
mbed_official 3:7a284390b0ce 69 ;* @brief In-place bit reversal function.
mbed_official 3:7a284390b0ce 70 ;* @param[in, out] *pSrc points to the in-place buffer of unknown 32-bit data type.
mbed_official 3:7a284390b0ce 71 ;* @param[in] bitRevLen bit reversal table length
mbed_official 3:7a284390b0ce 72 ;* @param[in] *pBitRevTab points to bit reversal table.
mbed_official 3:7a284390b0ce 73 ;* @return none.
mbed_official 3:7a284390b0ce 74 ;*/
mbed_official 3:7a284390b0ce 75 EXPORT arm_bitreversal_32
mbed_official 3:7a284390b0ce 76
mbed_official 3:7a284390b0ce 77 #if defined(ARM_MATH_CM0) || defined(ARM_MATH_CM0PLUS)
mbed_official 3:7a284390b0ce 78
mbed_official 3:7a284390b0ce 79 arm_bitreversal_32 PROC
mbed_official 3:7a284390b0ce 80 ADDS r3,r1,#1
mbed_official 3:7a284390b0ce 81 PUSH {r4-r6}
mbed_official 3:7a284390b0ce 82 ADDS r1,r2,#0
mbed_official 3:7a284390b0ce 83 LSRS r3,r3,#1
mbed_official 3:7a284390b0ce 84 arm_bitreversal_32_0 LABEL
mbed_official 3:7a284390b0ce 85 LDRH r2,[r1,#2]
mbed_official 3:7a284390b0ce 86 LDRH r6,[r1,#0]
mbed_official 3:7a284390b0ce 87 ADD r2,r0,r2
mbed_official 3:7a284390b0ce 88 ADD r6,r0,r6
mbed_official 3:7a284390b0ce 89 LDR r5,[r2,#0]
mbed_official 3:7a284390b0ce 90 LDR r4,[r6,#0]
mbed_official 3:7a284390b0ce 91 STR r5,[r6,#0]
mbed_official 3:7a284390b0ce 92 STR r4,[r2,#0]
mbed_official 3:7a284390b0ce 93 LDR r5,[r2,#4]
mbed_official 3:7a284390b0ce 94 LDR r4,[r6,#4]
mbed_official 3:7a284390b0ce 95 STR r5,[r6,#4]
mbed_official 3:7a284390b0ce 96 STR r4,[r2,#4]
mbed_official 3:7a284390b0ce 97 ADDS r1,r1,#4
mbed_official 3:7a284390b0ce 98 SUBS r3,r3,#1
mbed_official 3:7a284390b0ce 99 BNE arm_bitreversal_32_0
mbed_official 3:7a284390b0ce 100 POP {r4-r6}
mbed_official 3:7a284390b0ce 101 BX lr
mbed_official 3:7a284390b0ce 102 ENDP
mbed_official 3:7a284390b0ce 103
mbed_official 3:7a284390b0ce 104 #else
mbed_official 3:7a284390b0ce 105
mbed_official 3:7a284390b0ce 106 arm_bitreversal_32 PROC
mbed_official 3:7a284390b0ce 107 ADDS r3,r1,#1
mbed_official 3:7a284390b0ce 108 CMP r3,#1
mbed_official 3:7a284390b0ce 109 IT LS
mbed_official 3:7a284390b0ce 110 BXLS lr
mbed_official 3:7a284390b0ce 111 PUSH {r4-r9}
mbed_official 3:7a284390b0ce 112 ADDS r1,r2,#2
mbed_official 3:7a284390b0ce 113 LSRS r3,r3,#2
mbed_official 3:7a284390b0ce 114 arm_bitreversal_32_0 LABEL ;/* loop unrolled by 2 */
mbed_official 3:7a284390b0ce 115 LDRH r8,[r1,#4]
mbed_official 3:7a284390b0ce 116 LDRH r9,[r1,#2]
mbed_official 3:7a284390b0ce 117 LDRH r2,[r1,#0]
mbed_official 3:7a284390b0ce 118 LDRH r12,[r1,#-2]
mbed_official 3:7a284390b0ce 119 ADD r8,r0,r8
mbed_official 3:7a284390b0ce 120 ADD r9,r0,r9
mbed_official 3:7a284390b0ce 121 ADD r2,r0,r2
mbed_official 3:7a284390b0ce 122 ADD r12,r0,r12
mbed_official 3:7a284390b0ce 123 LDR r7,[r9,#0]
mbed_official 3:7a284390b0ce 124 LDR r6,[r8,#0]
mbed_official 3:7a284390b0ce 125 LDR r5,[r2,#0]
mbed_official 3:7a284390b0ce 126 LDR r4,[r12,#0]
mbed_official 3:7a284390b0ce 127 STR r6,[r9,#0]
mbed_official 3:7a284390b0ce 128 STR r7,[r8,#0]
mbed_official 3:7a284390b0ce 129 STR r5,[r12,#0]
mbed_official 3:7a284390b0ce 130 STR r4,[r2,#0]
mbed_official 3:7a284390b0ce 131 LDR r7,[r9,#4]
mbed_official 3:7a284390b0ce 132 LDR r6,[r8,#4]
mbed_official 3:7a284390b0ce 133 LDR r5,[r2,#4]
mbed_official 3:7a284390b0ce 134 LDR r4,[r12,#4]
mbed_official 3:7a284390b0ce 135 STR r6,[r9,#4]
mbed_official 3:7a284390b0ce 136 STR r7,[r8,#4]
mbed_official 3:7a284390b0ce 137 STR r5,[r12,#4]
mbed_official 3:7a284390b0ce 138 STR r4,[r2,#4]
mbed_official 3:7a284390b0ce 139 ADDS r1,r1,#8
mbed_official 3:7a284390b0ce 140 SUBS r3,r3,#1
mbed_official 3:7a284390b0ce 141 BNE arm_bitreversal_32_0
mbed_official 3:7a284390b0ce 142 POP {r4-r9}
mbed_official 3:7a284390b0ce 143 BX lr
mbed_official 3:7a284390b0ce 144 ENDP
mbed_official 3:7a284390b0ce 145
mbed_official 3:7a284390b0ce 146 #endif
mbed_official 3:7a284390b0ce 147
mbed_official 3:7a284390b0ce 148 END