?? fir16_emac.s.list
字號:
;************************************************************************
;*
;* 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: fir16.s
;*
;* PURPOSE: FIR16 routines definition
;*
;* AUTHOR: Andrey Butok
;* FIR16 function optimized for eMAC by Igor Drozdinsky
;*
;***********************************************************************
.text
;#define __EMAC_H
;#include "emac.h"
;#ifdef __FRACT_M
;#else
;#define 0x00000070 0x00000000
;#endif
.xdef _FIR16_EMAC
.extern _malloc
.extern _free
;******************************************************
;* NAME: void FIR16( struct tFirStruct *pFIR, 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 pFIR - Pointer to a data structure containing private data for the IIR filter
;* d1 Old MAC status register
;* d2, d3 iCurX0, iCurX1, iCurX2, iCurX3 - Curent X
;* d4 iCurA0, iCurA1 - 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
;* a3 pCurCoef - Pointer to the current coefficient
;* a6 pFirCoef - Pointer to the coefficients -> {a0,a1,a2...}
;* ACC0 iOut0 - Accumulator 0
;* ACC1 iOut1 - Accumulator 1
;* ACC2 iOut2 - Accumulator 2
;* ACC3 iOut3 - Accumulator 3
;******************************************************
_FIR16_EMAC
;---=Saving values of used registers=---
0x00000000: 4fefffc4 lea -60(a7), a7
0x00000004: 48d77fff movem.l d0-d7/a0-a6, (a7)
;--== Saving old MAC status register to d1 ==--
0x00000008: a981 move.l MACSR, d1
;--== Loading new MAC status register ==--
0x0000000a: 203c00000070 move.l #0x00000070, d0
0x00000010: a900 move.l d0, MACSR
;---=Most useful parameters are moved from stack to registers.=---
0x00000012: 206f0044 move.l 68(a7), a0 ;pX
0x00000016: 226f0048 move.l 72(a7), a1 ;pY
0x0000001a: 246f0040 move.l 64(a7), a2 ;pIIR
0x0000001e: 2c52 move.l (a2), a6 ;pIirCoef = pIIR->pIirCoef
0x00000020: a13c00000000 move.l #0, ACC0
0x00000026: a33c00000000 move.l #0, ACC1
0x0000002c: a53c00000000 move.l #0, ACC2
0x00000032: a73c00000000 move.l #0, ACC3
;---====== Begin of cycle of getting Y[1]..Y[N] (N = (pIIR->iIirCoefCount - 1) / 2)======---
0x00000038: 2e2a0004 move.l 4(a2), d7 ;
0x0000003c: 5387 subq.l #1, d7 ;tmp = i = pIIR->iIirCoefCount - 1;
0x0000003e: 2c07 move.l d7, d6 ;
0x00000040: e487 asr.l #2, d7
0x00000042: 67000104 beq .EndD4Z ;if(i >> 2)
;{
;--==First N output samples computation==--
0x00000046: 2e06 move.l d6, d7
0x00000048: 5987 subq.l #4, d7 ;i -= 4;
;--==Computation without using history buffer==--
.BegD4 ;do{
;--== Next input samples loading ==--
0x0000004a: 2410 move.l (a0), d2 ;iCurX0 = pX[0]; icurX1 = pX[1];
0x0000004c: 26280004 move.l 4(a0), d3 ;iCurX2 = pX[2]; icurX3 = pX[3];
0x00000050: 2848 movea.l a0, a4 ;pCurX = pX;
0x00000052: 41e80008 lea 8(a0), a0 ;pX += 4;
0x00000056: 264e move.l a6, a3 ;pCurCoef = pIirCoef;
;--== Next coefficient loading ==--
0x00000058: 381b move.w (a3)+, d4 ;iCurA0 = *pCurCoef;
;--== Input samples and first coefficient multiplications ==--
0x0000005a: a4040280 mac.w d4.l, d2.u, <<, ACC0 ;iOut0 = iCurA0 * iCurX0;
0x0000005e: a4840200 mac.w d4.l, d2.l, <<, ACC1 ;iOut1 = iCurA0 * iCurX1;
0x00000062: a6040290 mac.w d4.l, d3.u, <<, ACC2 ;iOut2 = iCurA0 * iCurX2;
0x00000066: a6840210 mac.w d4.l, d3.l, <<, ACC3 ;iOut3 = iCurA0 * iCurX3;
;--== The count of inner loops calculation ==--
0x0000006a: 2a06 move.l d6, d5 ;
0x0000006c: 9a87 sub.l d7, d5 ;j = tmp - i - 4;
0x0000006e: 5985 subq.l #4, d5 ;
0x00000070: 6f000030 ble .EndIn1 ;while(j > 0)
;{
.ForIn1Beg
;--== Next coefficients loading ==--
0x00000074: 281b move.l (a3)+, d4 ;iCurA0 = *pCurCoef++;iCurA1 = *pCurCoef++;
.ForIn1
;--== Three first input samples and coefficients multiplication ==--
0x00000076: a48402c0 mac.w d4.u, d2.u, <<, ACC1 ;iOut1 += iCurA0 * iCurX0;
0x0000007a: a4040250 mac.w d4.u, d2.l, <<, ACC2 ;iOut2 += iCurA0 * iCurX1;
0x0000007e: a68402d0 mac.w d4.u, d3.u, <<, ACC3 ;iOut3 += iCurA0 * iCurX2;
;--== Loading two next input samples ==--
0x00000082: 2602 move.l d2, d3 ;iCurX3 = iCurX1; iCurX2 = iCurX0;
0x00000084: 2424 move.l -(a4), d2 ;iCurX1 = *--pCurX; iCurX0 = *--pCurX;
;--== Fourth input sample and coefficient multiplication ==--
0x00000086: a4040240 mac.w d4.u, d2.l, <<, ACC0 ;iOut0 += iCurA0 * iCurX1;
;--== Next four input sample and coefficients multiplication ==--
0x0000008a: a4040280 mac.w d4.l, d2.u, <<, ACC0 ;iOut0 += iCurA1 * iCurX0;
0x0000008e: a4840200 mac.w d4.l, d2.l, <<, ACC1 ;iOut1 += iCurA1 * iCurX1;
0x00000092: a6040290 mac.w d4.l, d3.u, <<, ACC2 ;iOut2 += iCurA1 * iCurX2;
;--== Last mac instruction with next coefficients loading ==--
0x00000096: a81b3214 mac.w d4.l, d3.l, <<, (a3)+, d4, ACC3 ;iOut3 += iCurA1 * iCurX3;
;iCurA0 = *pCurCoef++;iCurA1 = *pCurCoef++;
0x0000009a: 5585 subq.l #2, d5 ; j -= 2;
0x0000009c: 6ed8 bgt .ForIn1 ;}
.EndIn1C
;--== Correcting pointer to coefficients after inner loop ==--
0x0000009e: 47ebfffc lea -4(a3), a3 ;pCurCoef -= 4
.EndIn1
0x000000a2: 2a2a000c move.l 12(a2), d5 ;if(pIIR->iIirHistoryCount)
;---=Computation using history buffer==--
0x000000a6: 67000068 beq .BegNoHistory ;{
;--== The count of inner loops calculation ==--
0x000000aa: 2a07 move.l d7, d5 ;
0x000000ac: 5885 addq.l #4, d5 ;j = i + 4;
0x000000ae: 6f00005c ble .EndInH ;if(j > 0)
;{
;--== Setting curent history buffer pointer ==--
0x000000b2: 286a0008 move.l 8(a2), a4 ;
0x000000b6: d9c6 adda.l d6, a4 ;
0x000000b8: d9c6 adda.l d6, a4 ;pCurHistory = pIIR->pIirHistory + tmp * 2;
0x000000ba: 08050000 btst #0, d5 ;if(j & 1)
0x000000be: 67000022 beq .ForInHBeg ;{
;--== This part is executed only if j is odd ==--
;--== Next coefficients loading ==--
0x000000c2: 381b move.w (a3)+, d4 ;iCurA = *pCurCoef++;
;--== Next input sample loading from history buffer==--
0x000000c4: 3602 move.w d2, d3 ;iCurX3 = iCurX2;
0x000000c6: 3424 move.w -(a4), d2 ;iCurX2 = iCurX1
0x000000c8: 4842 swap d2 ;iCurX1 = iCurX0
0x000000ca: 4843 swap d3 ;iCurX0 = *--pCurHistory;
0x000000cc: a4040280 mac.w d4.l, d2.u, <<, ACC0 ;iOut0 += iCurA0 * iCurX0;
0x000000d0: a4840200 mac.w d4.l, d2.l, <<, ACC1 ;iOut1 += iCurA0 * iCurX1;
0x000000d4: a6040290 mac.w d4.l, d3.u, <<, ACC2 ;iOut2 += iCurA0 * iCurX2;
0x000000d8: a6840210 mac.w d4.l, d3.l, <<, ACC3 ;iOut3 += iCurA0 * iCurX3;
0x000000dc: 5385 subq.l #1, d5 ;j -= 1;
0x000000de: 6f00002c ble .EndInH ;}
;while(j > 0)
;{
.ForInHBeg
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -