2. “restrict”关键字
restrict的作用和-mt编译选项相似,它告诉编译器某个指针不会和函数中的其它指针指向同一个内存。
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个寄存器时,循环不可进行软件流水。
避免循环体内容过于复杂,造成寄存器组不够用。
如果要求一个寄存器的生命太长,这个代码不能进行软件流水。
循环结构中不要包含改变循环计数器数值的代码。