__restrict keyword for the XGATE compiler

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

__restrict keyword for the XGATE compiler

1,312 次查看
davide_ferrari
Contributor II

Hi

does anybody know which is the usage of the __restrict keyword for the XGate compiler?

Many thanks

Davide

标签 (1)
0 项奖励
回复
1 回复

877 次查看
CompilerGuru
NXP Employee
NXP Employee

The semantic is the same as the restrict keyword in ANSI C99.

 

It basically means that the structure pointer to by a restricted pointer is not modified by some other alias.

More concretely for the RS08, __restrict is used for the pointer to the parameter block for a channel to allow the compiler to keep parameter values in registers even when calling other functions.

Without restrict, the compiler just knows about a pointer to a struct and would not know that the values in the struct did not change, so he would have to reload them whenever used.

 

Daniel

0 项奖励
回复