ls_rad2.h

来自「realview22.rar」· C头文件 代码 · 共 85 行

H
85
字号
;
; $Copyright: 
; ----------------------------------------------------------------
; This confidential and proprietary software may be used only as
; authorised by a licensing agreement from ARM Limited
;   (C) COPYRIGHT 2000,2002 ARM Limited
;       ALL RIGHTS RESERVED
; The entire notice above must be reproduced on all authorised
; copies and copies may only be made to the extent permitted
; by a licensing agreement from ARM Limited.
; ----------------------------------------------------------------
; File:     ls_rad2.h,v
; Revision: 1.5
; ----------------------------------------------------------------
; $
;
; Optimised ARM assembler multi-radix FFT
; Please read the readme.txt before this file
;
; This file contains radix-2 final stage code
;

; DHS - This file has not been converted to the new format yet
;     - Requires more work
;
; In order that the Radix4 twiddle tables can be used for this
; last stage radix 2, we will only read N/4 twiddle factors:
;   1, w, w^2, ..., w^(N/4-1)
; and use symmetry to generate the rest: w^(N/4+k) = (+/-i)*w^k
; Thus we do butterflies in pairs:
;   the (k,N/2+k) and (N/4+k,3*N/4+k) butterflies are done together

cptr    RN 0    ; pointer to twiddle coefficients
dptr    RN 1    ; pointer to FFT data working buffer
dinc    RN 2    ; (N/2)<<datalog
cinc    RN 3    ; stride between twiddle coefficients in bytes

        MACRO
        LS_RAD2
        SETSHIFT postldshift, norm
        SETSHIFT postmulshift, norm+qshift
        ; dinc contains the number of bytes between the values to read
        ; for the radix 4 bufferfly
        ; Thus:
        ;  dinc*4 = number of bytes between the blocks at this level
        ;  dinc>>datalog = number of elements in each block at this level
        STMFD   sp!, {dptr, count}
        ADD     dptr, dptr, dinc        ; move to last of 2 butterflys
        MOV     count, dinc, LSR #$datalog              ; prepare counter

05      ; butterfly loop
        LOAD1COEF cptr, x1r, x1i
        LOADDATA  dptr, -dinc, x0r, x0i
        TWIDDLE   x0r, x0i, x1r, x1i, t0, t1
        LOADDATAZ  dptr, x0r, x0i
        SHIFTDATA x0r, x0i
        SET2REGS  h,t0,t1,x0r,x0i
        ADD     $h0r, x0r, x1r $postmulshift
        ADD     $h0i, x0i, x1i $postmulshift
        STORE   dptr, dinc, $h0r, $h0i
        SUB     $h1r, x0r, x1r $postmulshift
        SUB     $h1i, x0i, x1i $postmulshift
        STOREP  dptr, $h1r, $h1i
        ; load data in reversed order & perform twiddles
        LOAD1COEF cptr, x1r, x1i
        LOADDATA  dptr, -dinc, x2r, x2i
        TWIDDLE   x2r, x2i, x1r, x1i, t0, t1
        LOADDATAZ  dptr, x0r, x0i
        SHIFTDATA x0r, x0i
        SET2REGS        h,t0,t1,x0r,x0i
        ADD     $h0r, x0r, x1r $postmulshift
        ADD     $h0i, x0i, x1i $postmulshift
        STORE   dptr, dinc, $h0r, $h0i
        SUB     $h1r, x0r, x1r $postmulshift
        SUB     $h1i, x0i, x1i $postmulshift
        STOREP  dptr, $h1r, $h1i
        ; continue butterfly loop
        SUBS    count, count, #2
        BGT     %BT05
        ; finished stage
        LDMFD   sp!, {dptr, count}
        MEND

        END

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?