?? iir16_emac.s.list
字號(hào):
;************************************************************************
;*
;* Copyright:
;* Freescale Semiconductor, INC. All Rights Reserved.
;* You are hereby granted a copyright license to use, modify, and
;* distribute the SOFTWARE so long as this entire notice is
;* retained without alteration in any modified and/or redistributed
;* versions, and that such modified versions are clearly identified
;* as such. No licenses are granted by implication, estoppel or
;* otherwise under any patents or trademarks of Freescale Semiconductor,
;* Inc. This software is provided on an "AS IS" basis and without warranty.
;*
;* To the maximum extent permitted by applicable law, FREESCALE
;* DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING
;* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
;* PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE
;* SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY
;* ACCOMPANYING WRITTEN MATERIALS.
;*
;* To the maximum extent permitted by applicable law, IN NO EVENT
;* SHALL FREESCALE BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
;* WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
;* INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
;* LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
;*
;* Freescale assumes no responsibility for the maintenance and support
;* of this software
;*************************************************************************
;*
;* FILE NAME: iir16.s
;*
;* PURPOSE: IIR16 routines definition
;*
;* AUTHOR: Andrey Butok
;* IIR16 function optimized for eMAC by Igor Drozdinsky
;*
;***********************************************************************
.text
;#define __EMAC_H
;#include "emac.h"
;#ifdef __FRACT_M
;#else
;#define 0x00000070 0x00000000
;#endif
.xdef _IIR16_EMAC
.extern _malloc
.extern _free
;******************************************************
;* 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
;* d0, d1 iCurY0, iCurY1, iCurY2, iCurY3 - Curent Y
;* d2, d3 iCurX0, iCurX1, iCurX2, iCurX3 - Curent X
;* d4 iCurA, iCurB - Curent coefficients
;* d5 j - inner loop counter
;* d7 i - outer loop counter
;* d6 tmp - saved value for inner loop counter calculation
;* a0 pX - Pointer to the current X for outer loop
;* a1 pY - Pointer to the current Y for outer loop
;* a4 pCurX - Pointer to the current X for inner loop
;* a4 pCurHistory - Pointer to the current element of history buffer
;* a5 pPredY - Pointer to the previous Y for inner loop
;* a3 pCurCoef - Pointer to the current coefficient
;* a6 pIirCoef - Pointer to the coefficients -> {a0,a1,b1,a2,b2...}
;* ACC0 iOut0 - Accumulator 0
;* ACC1 iOut1 - Accumulator 1
;* ACC2 iOut2 - Accumulator 2
;* ACC3 iOut3 - Accumulator 3
;******************************************************
_IIR16_EMAC
;---=Saving values of used registers=---
0x00000000: 4fefffc0 lea -64(a7), a7
0x00000004: 48d77fff movem.l d0-d7/a0-a6, (a7)
;--== Saving old MAC status register to the stack ==--
0x00000008: a980 move.l MACSR, d0
0x0000000a: 2f40003c move.l d0, 60(a7)
;--== Loading new MAC status register ==--
0x0000000e: 203c00000070 move.l #0x00000070, d0
0x00000014: a900 move.l d0, MACSR
;---=Most useful parameters are moved from stack to registers.=---
0x00000016: 206f0048 move.l 72(a7), a0 ;pX
0x0000001a: 226f004c move.l 76(a7), a1 ;pY
0x0000001e: 246f0044 move.l 68(a7), a2 ;pIIR
0x00000022: 2c52 move.l (a2), a6 ;pIirCoef = pIIR->pIirCoef
0x00000024: a13c00000000 move.l #0, ACC0
0x0000002a: a33c00000000 move.l #0, ACC1
0x00000030: a53c00000000 move.l #0, ACC2
0x00000036: a73c00000000 move.l #0, ACC3
;---====== Begin of cycle of getting Y[1]..Y[N] (N = (pIIR->iIirCoefCount - 1) / 2)======---
0x0000003c: 2e2a0004 move.l 4(a2), d7 ;
0x00000040: 5387 subq.l #1, d7 ;tmp = i = pIIR->iIirCoefCount - 1;
0x00000042: 2c07 move.l d7, d6 ;
0x00000044: e687 asr.l #3, d7
0x00000046: 670001c0 beq .EndD4Z ;if(i >> 3)
;{
;--==First N output samples computation==--
0x0000004a: 2e06 move.l d6, d7
0x0000004c: 5187 subq.l #8, d7 ;i -= 8;
;--==Computation without using history buffer==--
.BegD4 ;do{
;--== Next input samples loading ==--
0x0000004e: 2410 move.l (a0), d2 ;iCurX0 = pX[0]; iCurX1 = pX[1];
0x00000050: 26280004 move.l 4(a0), d3 ;iCurX2 = pX[2]; iCurX3 = pX[3];
0x00000054: 2848 movea.l a0, a4 ;pCurX = pX;
0x00000056: 41e80008 lea 8(a0), a0 ;pX += 4;
;--== Make four previous output samples zero==--
0x0000005a: 4280 clr.l d0 ;iCurY0 = iCurY1 = 0;
0x0000005c: 4281 clr.l d1 ;iCurY2 = iCurY3 = 0;
0x0000005e: 2a49 movea.l a1, a5 ;pCurY = pY;
;--== Next coefficient loading ==--
0x00000060: 264e move.l a6, a3 ;pCurCoef = pIirCoef;
0x00000062: 2813 move.l (a3), d4 ;iCurA = *pCurCoef;
0x00000064: 47eb0002 lea 2(a3), a3 ;pCurCoef++;
;--== Input samples and first coefficient multiplications ==--
0x00000068: a40402c0 mac.w d4.u, d2.u, <<, ACC0 ;iOut0 = iCurA * iCurX0;
0x0000006c: a4840240 mac.w d4.u, d2.l, <<, ACC1 ;iOut1 = iCurA * iCurX1;
0x00000070: a60402d0 mac.w d4.u, d3.u, <<, ACC2 ;iOut2 = iCurA * iCurX2;
0x00000074: a6840250 mac.w d4.u, d3.l, <<, ACC3 ;iOut3 = iCurA * iCurX3;
;--== The count of inner loops calculation ==--
0x00000078: 2a06 move.l d6, d5 ;
0x0000007a: 9a87 sub.l d7, d5 ;j = tmp - i - 8;
0x0000007c: 5185 subq.l #8, d5 ;
0x0000007e: 6f000056 ble .EndIn1 ;while(j > 0)
;{
.ForIn1Beg
;--== Next coefficients loading ==--
0x00000082: 281b move.l (a3)+, d4 ;iCurA = *pCurCoef++; iCurB = *pCurCoef++;
.ForIn1
;--== Three first input samples and coefficients multiplication ==--
0x00000084: a48402c0 mac.w d4.u, d2.u, <<, ACC1 ;iOut1 += iCurA * iCurX0;
0x00000088: a4040250 mac.w d4.u, d2.l, <<, ACC2 ;iOut2 += iCurA * iCurX1;
0x0000008c: a68402d0 mac.w d4.u, d3.u, <<, ACC3 ;iOut3 += iCurA * iCurX2;
;--== Three first output samples and coefficients multiplication ==--
0x00000090: a0840280 mac.w d4.l, d0.u, <<, ACC1 ;iOut1 += iCurB * iCurY0;
0x00000094: a0040210 mac.w d4.l, d0.l, <<, ACC2 ;iOut2 += iCurB * iCurY1;
0x00000098: a2840290 mac.w d4.l, d1.u, <<, ACC3 ;iOut3 += iCurB * iCurY2;
;--== Loading two next input samples ==--
0x0000009c: 2602 move.l d2, d3 ;iCurX3 = iCurX1; iCurX2 = iCurX0;
0x0000009e: 2424 move.l -(a4), d2 ;iCurX1 = *--pCurX; iCurX0 = *--pCurX;
;--== Loading two next output samples ==--
0x000000a0: 2200 move.l d0, d1 ;iCurY3 = iCurY1; iCurY2 = iCurY0;
0x000000a2: 2025 move.l -(a5), d0 ;iCurY1 = *--pCurY; iCurY0 = *--pCurY;
;--== Fourth input sample and coefficient multiplication ==--
0x000000a4: a4040240 mac.w d4.u, d2.l, <<, ACC0 ;iOut0 += iCurA * iCurX1;
;--== Fourth output sample and coefficient multiplication ==--
0x000000a8: a0040200 mac.w d4.l, d0.l, <<, ACC0 ;iOut0 += iCurB * iCurY1;
;--== Next coefficients loading ==--
0x000000ac: 281b move.l (a3)+, d4 ;iCurA = *pCurCoef++; iCurB = *pCurCoef++;
;--== Next four input sample and coefficients multiplication ==--
0x000000ae: a40402c0 mac.w d4.u, d2.u, <<, ACC0 ;iOut0 += iCurA * iCurX0;
0x000000b2: a4840240 mac.w d4.u, d2.l, <<, ACC1 ;iOut1 += iCurA * iCurX1;
0x000000b6: a60402d0 mac.w d4.u, d3.u, <<, ACC2 ;iOut2 += iCurA * iCurX2;
0x000000ba: a6840250 mac.w d4.u, d3.l, <<, ACC3 ;iOut3 += iCurA * iCurX3;
;--== Next four output sample and coefficients multiplication ==--
0x000000be: a0040280 mac.w d4.l, d0.u, <<, ACC0 ;iOut0 += iCurB * iCurY0;
0x000000c2: a0840200 mac.w d4.l, d0.l, <<, ACC1 ;iOut1 += iCurB * iCurY1;
0x000000c6: a2040290 mac.w d4.l, d1.u, <<, ACC2 ;iOut2 += iCurB * iCurY2;
;--== Last mac instruction with next coefficients loading ==--
0x000000ca: a81b1214 mac.w d4.l, d1.l, <<, (a3)+, d4, ACC3 ;iOut3 += iCurB * iCurY3;
;iCurA = *pCurCoef++; iCurB = *pCurCoef++;
0x000000ce: 5985 subq.l #4, d5 ; j -= 4;
0x000000d0: 6eb2 bgt .ForIn1 ;}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -