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

📄 amf_scaler_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_Scaler_Render.asm#3 $ 
// Part of : VisualAudio V2.5.0 
// Updated : $Date: 2006/10/12 $ by $Author: Fernando $




//    Module Name     : AMF_Scaler_Render.asm 
//    DSP Processor   : ADSP21161
//    Original Author : Mark A Wilson    
//    Date               : 4/24/03
//====================================================================================
// Processor resources used:
//    23 words pmem INTERNAL
// 151 cycles, tickSize=128 (23 + 2*tickSize/2)
//====================================================================================


#if 1

#include "processor.h"
#include "AMF_Scaler.h"
#include "asm_macros.h"
#include "asm_sprt.h"

.global    _AMF_Scaler_Render;            ;

.segment /pm SEG_MOD_FAST_CODE;
_AMF_Scaler_Render:

//====================================================================================
    entry;    
                            
//module entry arguments passed in registers: 
//  r4  = instance    (AMF_Scaler * restrict)
//  r8  = * buffers (float * restrict)
//  r12 = int tickSize

    puts=mode1;
    r0=i0; puts=r0;
    
    i4=r4;                        //i4->testModuleInstance[0]
    
    r0=lshift r12 by -1;        // half loop count for SIMD 
                                // tickSize now passed in r12
    f2=dm(AMF_Scaler_Amp,i4);    // f2= float Amp = instance->amp
    s2=f2;
    
    i4=r8;                        //i12->*buffers
    
    i0=dm(0,i4);                //r0=buffers[0]
    m4=2;                        // SIMD loop increment
    
    bit set mode1 PEYEN;        // Enable PEy:SIMD

    i4=dm(1,i4);                //r0=buffers[1]

    f1=dm(i0,m4);

AMF_Scaler_Render_loop_start:
    // for (i=0; i<tickSize; i++) 
    LCNTR=r0, DO AMF_Scaler_Render_loop_end UNTIL LCE;
        f0=f1*f2, f1=dm(i0,m4);        // f0 = in[i] * amp, f1=in[i++]
AMF_Scaler_Render_loop_end: 
        dm(i4,m4)=f0;                // out[i++]=f0

    bit clr mode1 PEYEN;    // Disable PEy:SIMD
        
//====================================================================================

    i0=gets(1);
    mode1=gets(2);
    alter(2);
    
//------------------------------------------------------------------------------------
_AMF_Scaler_Render.END:
    leaf_exit; // C-rth requires this instead of rts
//------------------------------------------------------------------------------------
.endseg;
#endif    

⌨️ 快捷键说明

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