This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C6701: for循环优化问题

Part Number: TMS320C6701
Other Parts Discussed in Thread: MATHLIB

您好,我最近在做DSP代码的优化,我有查看TMS320C6000 Programmer’s Guide 里面的优化策略,最近遇到的问题是 for循环中需要调用math库里面的atan2函数,致使该for循环不能作为流水线展开,我看到手册里面说需要将被调用函数做成inline函数,但不知道具体应该怎么做,请问能否给出相应的指导?

关于for循环的代码如下:

void calc_angle(double * restrict input_complex_array, int NPoints, double * restrict out_angle_array)
{
    /*double atan(double atan);*/
    int i;
    for (i = 0; i < NPoints; i++)
    {
        out_angle_array[i]=atan2(input_complex_array[2*i+1], input_complex_array[2*i]);
    }
}

关于函数被编译后的流水线信息如下:

;*----------------------------------------------------------------------------*
;*   SOFTWARE PIPELINE INFORMATION
;*      Disqualified loop: Loop contains a call
;*----------------------------------------------------------------------------*

非常期待您的回答!