⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ci16.asm

📁 CCS3.3自带的TI 5400系列DSP的dsplib文件。文档说明可以在TI公司网站上下载。
💻 ASM
字号:
;***********************************************************
; Version 2.20.01                                           
;***********************************************************
;============================================================================
; Description:  C54x Double Precision 16-Point Complex Inverse FFT
;
; Author:       Mike Hannah,  Texas Instruments, Inc.,  May 14, 1998
;
; Function:     _cifft32_16
;
; Inputs:       pInBuff in acc A
;
; Assumptions:  Input data is in InBuff and output will be in InBuff.
;               SXM=1 and FRCT=1.  CPL=1 since called from C.
;
;=============================================================================

N	.set	16

	.global	IfftStage1and2
	.global IfftStage3
	.global IfftButterfly
	.global	Itempdw1
	.global	Itempdw2

	.include sintab.q31

        .mmregs

        .text

        .global _cifft32_16

_cifft32_16:
        PSHM    ST0                                 ; 1 cycle
        PSHM    ST1                                 ; 1 cycle

        pshm    ar1
        pshm    ar6
        pshm    ar7

        RSBX    OVA                                 ; 1 cycle
        RSBX    OVB                                 ; 1 cycle

        rsbx    ovm                     ;disable overflow mode
        ssbx    sxm                     ;sxm enabled
        ssbx    frct                    ;<<1 to make Q31 from Q30 product
        stm     #0, BK                  ;use circ addressing in butterfly with zero length
        stlm    A, ar1                  ;store pInBuff into ar1
        pshm    ar1                     ;put pInBuff on stack for reuse

        ld      #-2, ASM                ;>>2 on stores to mem
;===== Compute 1st and 2nd stages of IFFT =====
        ld      *SP(0),A                ;pointer to DATA -> A
        stlm    A,ar2                   ;pointer to DATA       r1,i1
        add     #(2*2),A
        stlm    A,ar3                   ;pointer to DATA + 2   r2,i2
        ld      *SP(0),A                ;pointer to DATA -> A
        add     #(4*2),A
        stlm    A,ar4                   ;pointer to DATA + 4   r3,i3
        stm     #7*2-1,ar0              ;index
        stm     #16/4-1,BRC             ;execute N/4-1 times
        ld      *SP(0),A                ;pointer to DATA -> A
        add     #(6*2),A
        stlm    A,ar5                   ;pointer to DATA + 6   r4,i4
	.if	__far_mode
        fcall   IfftStage1and2          ;in-place
	.else
        call    IfftStage1and2
	.endif
;===== Compute 3rd stage of IFFT =====
        ld      *SP(0),A                ;pointer to DATA -> A
        stlm    A,ar2                   ;pointer to DATA       pr,pi
        add     #(8*2),A
        stlm    A,ar3                   ;pointer to DATA + 8   qr,qi
        stm     #9*2-1,ar0              ;index
        stm     #16/8-1,BRC             ;execute N/8-1 times '4 macros'
        stm     #Itempdw1,ar5           ;temp dword
        stm     #Itempdw2,ar6           ;temp dword
        stm     #SIN45+1,ar4            ;32-bit sin45 twiddle LSW
	.if	__far_mode
        fcall   IfftStage3              ;in-place
	.else
        call    IfftStage3
	.endif
;===== Compute 4th (last) stage of IFFT =====
;laststag .macro  DATA,stage,sin,cos
;        laststag dstn,4,isin4,cos4
        ld      *SP(0),A                ;pointer to DATA -> A
        stlm    A,ar2                   ;ar2 -> DATA
        add     #(16*2),A
        stlm    A,ar3                   ;ar3 -> DATA+(offset=N)
        stm     #16/2-2,BRC             ;execute startup + num-2 times general butterfly
        stm     #cos4+1,ar4             ;start on LSW of cosine in stage
        stm     #isin4+1,ar5            ;start on LSW of sine in stage
	.if	__far_mode
        fcall   IfftButterfly           ;in-place
	.else
        call    IfftButterfly
	.endif
        stm     #3,AR0                  ;index offset for butterfly optimization
;!!!!! Call occurs here !!!!!

        popm    ar1                     ;remove pInBuff from stack
        popm    ar7
        popm    ar6
        popm    ar1
        POPM    ST1                            ; 1 cycle
        POPM    ST0                            ; 1 cycle

	.if	__far_mode
        fret
        .else
        ret
        .endif

⌨️ 快捷键说明

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