However, the SPLOOP buffer cannot be used to handle loops that exceed 14 execute packets
For complex loops, such as nested loops, conditional branches inside loops, and function calls inside loops, the effectiveness of the compiler may be compromised.
The intrinsic operations are not function calls (though they have the appearance of function calls), so no branching is needed.Instead, the use of intrinsic is a way to tell the compiler to issue one or more particular instructions of the C6000 instruction set.
the restrict keyword can be applied to any pointers, regardless of whether it is a parameter, a local variable, or an element of a referenced dataobject. Moreover, because the restrict keyword is only effective in the function it is in, it can be used whenever needed
For complex loops, such as nested loops, conditional branches inside loops, and function calls inside loops, the effectiveness of the compiler may be compromised. When the situation becomes too complex, the compiler might not be able to pipeline at all.
编译器仅对内部循环执行软件流水。
软件流水循环可包含instrinsics,但不能包含函数调用。
循环结构中不可有break和goto语句,不可有条件中止,使循环提前退出的指令。
条件代码应尽量简单,在C64XX中,条件代码需要超过6个寄存器时,循环不可进行软件流水。
避免循环体内容过于复杂,造成寄存器组不够用。
如果要求一个寄存器的生命太长,这个代码不能进行软件流水。
循环结构中不要包含改变循环计数器数值的代码。
5. 使用SIMD并行处理多个数据的运算
TI 提供了多个支持SIMD的指令,如LDDW、STDW,分别用于并行64bit的数据加载和存储。
Assuming all the data used are actually 16-bit data, it would be ideal if the LDDW and STDW instructions can operate on 4 elements every time. However, if thedata is declared as 32-bit type, LDDW and STDW can only operate on 2 elements every time. Therefore,to fully utilize SIMD instructions, it is important to choose the smallest data size that works for the data.
The intrinsic operations are not function calls (though they have the appearance of function calls), so no branching is needed.Instead, the use of intrinsic is a way to tell the compiler to issue one or more particular instructions of the C6000 instruction set.
参考文献/资料
【1】Introduction to TMS320C6000 DSP Optimization--SPRABF2,2011.
【2】TMS320C6000 Programmer's Guide--SPRU198K,2011.
【3】董言治, 娄树理, 刘松涛. TMS320C6000系列DSP系统结构原理与应用教程[M]. 清华大学出版社, 2014.
【4】TI C6000 优化 startup guide.
【5】Optimization Techniques for the TI C6000 Compiler.
【6】Optimizing Modems Using Code Composer Studio and TI Resources.