__restrict keyword for the XGATE compiler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

__restrict keyword for the XGATE compiler

791 Views
davide_ferrari
Contributor II

Hi

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

Many thanks

Davide

Labels (1)
0 Kudos
1 Reply

356 Views
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 Kudos