📄 amf_polynomial_ds_render.asm
字号:
// Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved.
// This software is proprietary and confidential to Analog Devices, Inc. and its licensors.
// File : $Id: //depot/development/visualaudio/modules/2.5.0/SHARC/Source/AMF_Polynomial_DS_Render.asm#3 $
// Part of : VisualAudio V2.5.0
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $
// Module Name : AMF_Polynomial_DS_Render.asm
// DSP Processor : ADSP21161
// Original Author : Tim Stilson
// Date : 2/2/04
//====================================================================================
// Processor resources used:
// 35 words pmem INTERNAL
// cycles ~= 37+(TICKSIZE*(1 + 2*NCOEFS + 2*(NCOEFS<3))
// (SIMD used)
//====================================================================================
#if 1
////////////////////////////////////////////////////////////////////////////////
//
// History:
//
// 2/2/04 Tim Stilson: created based on AMF_Polynomial_S_Render.asm
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// Optimization note:
//
// This could be made almost 128 cycles (ticksize) cheaper by transposing the loops.
// The downside would be that the output would have to be used as a temp vector,
// so aliasing would no longer be possible. Since memory is considered more
// important than cycles, this optimization possibility was not implemented.
//
////////////////////////////////////////////////////////////////////////////////
#include <processor.h>
#include "AMF_Polynomial_DS.h"
#include <asm_sprt.h>
// global routines
.global _AMF_Polynomial_DS_Render; ;
.segment /pm SEG_MOD_FAST_CODE;
////////////////////////////////////////////////////////////////////////////////
// Polynomial_DS
//
_AMF_Polynomial_DS_Render:
// push context on stack
puts=mode1;
r0=i0; puts=r0;
puts=i9;
r0=i2; puts=r0;
puts=b9;
i4=r8; // i4->*buffers
// initialize input and output samples pointers
i0=dm(0,i4); // i1->buffers[0], input
i2=dm(1,i4); // i2->buffers[1], output
i4=r4; //i4->testModuleInstance[0]
// initialize coefficient pointer
b9=dm(AMF_Polynomial_DS_Coefs,i4); // b0 & i0 point to filter coefficients
r2=dm(AMF_Polynomial_DS_NumCoefs,i4); // # coefs
r0 = lshift r2 by 1; // dual-stereo uses 2x as many words
l9 = r0;
// fixup innerloop count (poly order is one less than # coefs)
r2 = r2-1;
bit set MODE1 PEYEN;
m4 = 2;
m12 = 2;
lcntr=r12, do AMF_Polynomial_DS_SampleLoop until lce;
f0=dm(i0,m4), f4 =pm(i9,m12); // f0/s0 = in[0] = x, f4/s4=coef[0,1]
lcntr=r2, do AMF_Polynomial_DS_CoefLoop until lce;
f4=f0*f4, f12=pm(i9,m12); // f4/s4 = poly*x, get coefs
AMF_Polynomial_DS_CoefLoop:
f4=f4+f12; // f4/s4 = poly*x+coef[j/j+1]
AMF_Polynomial_DS_SampleLoop:
dm(i2,m4)=f4; // out[i/i+1] = poly
bit clr mode1 PEYEN; // Disable PEy:SIMD
l9 = 0;
// pop context off stack
b9 = gets(1);
i2 = gets(2);
i9 = gets(3);
i0 = gets(4);
mode1=gets(5);
alter(5);
//------------------------------------------------------------------------------------
_AMF_Polynomial_DS_Render.END:
leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
.endseg;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -