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

📄 amf_polynomial_s_render.asm

📁 ADI SHARC DSP 音频算法标准模块库
💻 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_S_Render.asm#3 $ 
// Part of : VisualAudio V2.5.0 
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $




//    Module Name     : AMF_Polynomial_S_Render.asm 
//    DSP Processor   : ADSP21161
//    Original Author : Tim Stilson    
//    Date               : 1/29/04
//====================================================================================
// Processor resources used:
// 33 words pmem INTERNAL
// cycles ~= 35+(TICKSIZE*(1 + 2*NCOEFS + 2*(NCOEFS<3))
// 930 (2 coefs)
// 931 (3 coefs)
// 1187 (4 coefs)
// 1443 (5 coefs)
// 1699 (6 coefs)
// 1955 (7 coefs)
// 2211 (8 coefs)
// 2467 (9 coefs)
// 2723 (10 coefs)
// (SIMD used)
//====================================================================================

#if 1

    ////////////////////////////////////////////////////////////////////////////////
    //
    // History:
    //
    // 1/29/04  Tim Stilson: created based on AMF_FIR_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_S.h"
#include <asm_sprt.h>

// global routines
.global    _AMF_Polynomial_S_Render;            ;

.segment /pm SEG_MOD_FAST_CODE;

////////////////////////////////////////////////////////////////////////////////
// Polynomial_S
//
_AMF_Polynomial_S_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_S_Coefs,i4);                     // b0 & i0 point to filter coefficients
    
    r2=dm(AMF_Polynomial_S_NumCoefs,i4);                  // # coefs
    l9 = r2;
    
    // fixup innerloop count (poly order is one less than # coefs)
    r2 = r2-1;

    bit set MODE1 BDCST9 | PEYEN;        
    m4 = 2;

    lcntr=r12, do AMF_Polynomial_S_SampleLoop until lce;
        f0=dm(i0,m4),                  f4 =pm(i9,m14);  // f0/s0 = in[0] = x, f4/s4=coef[0]

        lcntr=r2, do AMF_Polynomial_S_CoefLoop until lce;
            f4=f0*f4,                  f12=pm(i9,m14);  // f4/s4 = poly*x, get coef
AMF_Polynomial_S_CoefLoop:
            f4=f4+f12;                                  // f4/s4 = poly*x+coef[j]
            
AMF_Polynomial_S_SampleLoop:
        dm(i2,m4)=f4;                                   // out[i/i+1] = poly


    bit clr mode1 BDCST9 | 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_S_Render.END:
    leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
    
.endseg;
#endif

⌨️ 快捷键说明

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