?? iir16_mac.s.list
字號:
;*********************************************
;* Freescale Semiconductor Inc.
;* (c) Copyright 2001 Freescale Semiconductor Inc.
;* ALL RIGHTS RESERVED.
;*********************************************
;* FILE NAME: iir16.s
;*********************************************
;!! These functions are "hand coded" in assembler and
;!! the C source is used as comments for short and clear description.
;!! C code used only for more clear andestending what assembler code do, where it is possible.
.section .text ;-=Locate the code in the ".text" section.=-
.align 4
.xdef _IIR16_MAC
;******************************************************
;* NAME: void IIR16( struct tIirStruct *pIIR, Frac16* pX, Frac16* pY, unsigned int n)
;*
;* DESCRIPTION: Computes a Infinite Impulse Response (IIR) filter for a array of 16-bit fractional data values.
;******************************************************
;* Used registers:
;* a2 pIIR - Pointer to a data structure containing private data for the IIR filter
;* 68(a7) pX - Pointer to the input array of n data elements
;* 72(a7) pY - Pointer to the output array of n data elements
;* d6 n - Length of the input and output vectors
;* d2 k - Counter for inner loop
;* d1 i - Counter for outer loop
;* d0 N - Length of coefficients array(N<=n)
;* a0 pCurY - Pointer to the current Y
;* a1 pCurX - Pointer to the current X
;* a3 pCurCoef - Pointer to the current coefficient -> {a0,a1,b1,a2,b2...}
;* a4 pCurHistory - Pointer to the current element of history buffer
;* a5 pPredY - Pointer to the previous Y
;* acc output - Accumulator
;******************************************************
_IIR16_MAC
;---=Saving values of used registers=---
0x00000000: 4fefffc4 lea -60(a7),a7
0x00000004: 48d77fff movem.l d0-d7/a0-a6,(a7)
;---=Most useful parameters are moved from stack to registers.=---
0x00000008: 2c2f004c move.l 76(a7),d6 ; n - Length of the input and output vectors
0x0000000c: 206f0048 move.l 72(a7),a0 ; pCurY=pY; - Pointer to the current Y.
0x00000010: 246f0040 move.l 64(a7),a2 ; -=N=pIIR->iIirCoefCount/2+1;=-
0x00000014: 202a0004 move.l 4(a2),d0
0x00000018: e288 lsr.l #1,d0
0x0000001a: 5280 addq.l #1,d0
;---====== Begin of cycle of getting Y[1]..Y[N-1] ======---
0x0000001c: 7201 moveq #1,d1 ; for(i=1;i<N;i++) -=Begin of outer loop (number 1)=-
.FORi1
0x0000001e: b280 cmp.l d0,d1 ; -=Comparing "i" with "N"
0x00000020: 64000070 bcc .ENDFORi1 ; { -=If (i=>N) then jump to .ENDFORi1=-
0x00000024: a13c00000000 move.l #0,acc ; output=0; -=Accumulator initialization=-
0x0000002a: 2c6f0044 move.l 68(a7),a6 ; pCurX=pX+i-1; -=Current sample pointer initialization=-
0x0000002e: 43f61a00 lea (0,a6,d1.l*2),a1
0x00000032: 2c6f0048 move.l 72(a7),a6 ; pPredY=pY+i-2; -=Previous Y pointer initialization=-
0x00000036: 4bf61afe lea (-2,a6,d1.l*2),a5
;---== Begin of cycle Getting Y[i] ==---
0x0000003a: 2652 move.l (a2),a3 ; pCurCoef=pIIR->pIirCoef; -=Current coefficient pointer initialization=-
;-=output=*pCurX--*(*pCurCoef++);=-
0x0000003c: 3621 move.w -(a1),d3 ; -=Getting current sample=-
0x0000003e: 381b move.w (a3)+,d4 ; -=Getting current coefficient=-
0x00000040: a8030200 mac.w d3.l,d4.l,<< ; -=Getting first iteration of inner loop=-
0x00000044: 7401 moveq #1,d2 ; for(k=1;k<i;k++) -=Begin of inner loop=-
0x00000046: 281b move.l (a3)+,d4 ; -=Getting next current coefficient=-
.FORk1 ; {
0x00000048: b481 cmp.l d1,d2 ; -=Comparing "k" with "i"=-
0x0000004a: 64000012 bcc .ENDFORk1 ; -=If (k=>i) then jump to .ENDFORk1=-
;-=use move long, parallel filling register,
; predecriment and post increment and use left shifting to get fractional multiplication=-
;-=output+=*pCurX--*(*pCurCoef++);=-
0x0000004e: 3621 move.w -(a1),d3 ; -=Getting next current sample=-
0x00000050: a8030280 mac.w d3.l,d4.u,<< ; -=First MAC=-
;-=output+=*pPredY--*(*pCurCoef++);=-
0x00000054: 3625 move.w -(a5),d3 ; -=Getting previous Y=-
0x00000056: a89b4203 mac.w d3.l,d4.l,<<,(a3)+,d4 ; -=Second MAC and getting next current coefficient=-
0x0000005a: 5282 addq.l #1,d2 ; -=Incrementing "k"=-
0x0000005c: 60ea bra .FORk1 ; -=Jumping to .FORk1=-
.ENDFORk1 ; }
;---==Testing that History Buffer is filled => this is not first calling of this function==--
0x0000005e: 4aaa000c tst.l 12(a2) ; if(pIIR->iIirHistoryCount>0) -=Testing that pFIR->iFirHistoryCount>0=-
0x00000062: 67000024 beq .ENDFORk2 ; { -=If (pFIR->iFirHistoryCount=0) then jump to .ENDFORk2=-
0x00000066: 2c6a0008 move.l 8(a2),a6 ; pCurHistory=pIIR->pIirHistory+pIIR->iIirHistoryCount-1;
0x0000006a: 2e2a000c move.l 12(a2),d7
0x0000006e: 49f67a00 lea (0,a6,d7.l*2),a4
0x00000072: 2401 move.l d1,d2 ; for(k=i;k<N;k++) -=Begin of inner loop=-
.FORk2
0x00000074: b480 cmp.l d0,d2 ; -=Comparing "k" with "N"=-
0x00000076: 64000010 bcc .ENDFORk2 ; { -=If (k=>N) then jump to .ENDFORk2=-
;-=use move long, parallel filling register,
; predecriment and post increment and use left shifting to get fractional multiplication=-
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -