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

📄 iir32_mac.s.list

📁 freescale MAC DSP的算法库(FFT
💻 LIST
📖 第 1 页 / 共 2 页
字号:
                             ;*********************************************
                             ;* Freescale Semiconductor Inc.
                             ;* (c) Copyright 2001 Freescale Semiconductor Inc.
                             ;* ALL RIGHTS RESERVED.
                             ;*********************************************
                             ;* FILE NAME: iir32.s
                             ;*********************************************
                                                .section     .text            ;-=Locate the code in the ".text" section.=-
                                                .align       4                
                                                .xdef        _IIR32_MAC       
                             ;******************************************************
                             ;* NAME: void IIR32( struct tIirStruct *pIIR, Frac32* pX, Frac32* pY, unsigned int n)
                             ;*
                             ;* DESCRIPTION: Computes a Infinite Impulse Response (IIR) filter for a array of 32-bit fractional data values.
                             ;******************************************************
                             ;*	a2          pIIR	      - Pointer to a data structure containing private data for the iir filter
                             ;*	68(a7)      pX	      - Pointer to the input vector of n data elements
                             ;*	72(a7)      pY	      - Pointer to the output vector 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 vector(N<=n)
                             ;*	a0          pCurY	      - Pointer to the current Y
                             ;*	a1          pCurX       - Pointer to the current X
                             ;*	a3          pCurCoef    - Pointer to the current coefficient
                             ;*	a4          pCurHistory - Pointer to the current element of history buffer
                             ;*	a5          pPredY      - Pointer to the previous Y
                             ;*	acc         output	- Accumulator
                             ;******************************************************
                             _IIR32_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: 226f0044                            move.l       68(a7),a1        ; 	pCurX=pX;       - Pointer to the current X.
0x00000014: 246f0040                            move.l       64(a7),a2        ; 	-=N=pIIR->iIirCoefCount/2+1;=-
0x00000018: 202a0004                            move.l       4(a2),d0         
0x0000001c: e288                                lsr.l        #1,d0            
0x0000001e: 5280                                addq.l       #1,d0            
                             ;---====== Begin of cycle of getting Y[1]..Y[N-1] ======---
0x00000020: 7201                                moveq        #1,d1            ; 	for(i=1;i<N;i++)                      -=Begin of outer loop (number 1)=-
                             .FORi1                                           
0x00000022: b280                                cmp.l        d0,d1            ;                                          -=Comparing "i" with "N"
0x00000024: 64000070                            bcc          .ENDFORi1        ; 	{                                     -=If (i=>N) then jump to .ENDFORi1=-
0x00000028: a13c00000000                        move.l       #0,acc           ;                                          -=Accumulator initialization=-
0x0000002e: 2c6f0044                            move.l       68(a7),a6        ; 		pCurX=pX+i-1;                   -=Current sample pointer initialization=-
0x00000032: 43f61c00                            lea          (0,a6,d1.l*4),a1 ;
0x00000036: 2c6f0048                            move.l       72(a7),a6        ; 		pPredY=pY+i-2;                  -=Previous Y pointer initialization=-
0x0000003a: 4bf61cfc                            lea          (-4,a6,d1.l*4),a5 
                                                                              ;---== Begin of cycle Getting Y[i] ==---
0x0000003e: 2652                                move.l       (a2),a3          ; 		pCurCoef=pIIR->pIirCoef;        -=Current coefficient pointer initialization=-
                                                                              ;;-=output=*pCurX--*(*pCurCoef++);=-
0x00000040: 2621                                move.l       -(a1),d3         ; 		                                -=Getting current sample=-
0x00000042: 281b                                move.l       (a3)+,d4         ;                                          -=Getting current coefficient=-
0x00000044: a8030ac0                            mac.l        d3,d4,<<         ;                                          -=Getting first iteration of inner loop=-
0x00000048: 7401                                moveq        #1,d2            ; 		for(k=1;k<i;k++)                -=Begin of inner loop=-
0x0000004a: 281b                                move.l       (a3)+,d4         ;                                          -=Getting next current coefficient=-
                             .FORk1                                           ; 		{
0x0000004c: b481                                cmp.l        d1,d2            ;                                          -=Comparing "k" with "i"=-
0x0000004e: 64000012                            bcc          .ENDFORk1        ;                                          -=If (k=>i) then jump to .ENDFORk1=-
                                                                              ;-=output+=*pCurX--*(*pCurCoef++);=-
0x00000052: 2621                                move.l       -(a1),d3         ; 			                          -=Getting next current sample=-
0x00000054: a89b4ac3                            mac.l        d3,d4,<<,(a3)+,d4 ;                                       -=First MAC and getting next current coefficient=-
                                                                              ;-=output+=*pPredY--*(*pCurCoef++);=-
0x00000058: 2625                                move.l       -(a5),d3         ;                                          -=Getting previous Y=-
0x0000005a: a89b4ac3                            mac.l        d3,d4,<<,(a3)+,d4 ;                                       -=Second MAC and getting next current coefficient=-
0x0000005e: 5282                                addq.l       #1,d2            ;                                          -=Incrementing "k"=-
0x00000060: 60ea                                bra          .FORk1           ;                                          -=Jumping to .FORk1=-
                             .ENDFORk1                                        ; 		}
                                                                              ;---==Testing that History Buffer is filled => this is not first calling of this function==--  
0x00000062: 4aaa000c                            tst.l        12(a2)           ; 		if(pIIR->iIirHistoryCount>0)    -=Testing that pFIR->iFirHistoryCount>0=-
0x00000066: 67000026                            beq          .ENDFORk2        ; 		{                               -=If (pFIR->iFirHistoryCount=0) then jump to .ENDFORk2=-

0x0000006a: 2c6a0008                            move.l       8(a2),a6         ; 			pCurHistory=pIIR->pIirHistory+pIIR->iIirHistoryCount-1;
0x0000006e: 2e2a000c                            move.l       12(a2),d7        
0x00000072: 49f67c00                            lea          (0,a6,d7.l*4),a4 
0x00000076: 2401                                move.l       d1,d2            ; 			for(k=i;k<N;k++)          -=Begin of inner loop=-
                             .FORk2                                           
0x00000078: b480                                cmp.l        d0,d2            ;                                          -=Comparing "k" with "N"=-
0x0000007a: 64000012                            bcc          .ENDFORk2        ; 			{                         -=If (k=>N) then jump to .ENDFORk2=-

⌨️ 快捷键说明

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