[Tinyos-devel] One should make limited use of the "%" operator

Philip Levis pal at cs.stanford.edu
Thu Jun 25 11:54:47 PDT 2009


On Jun 25, 2009, at 11:42 AM, Vlado Handziski wrote:

> Speaking about optimization, and looking at your example snippet:  
> For the msp430 platforms, it is always much more efficient to use  
> word size array indices. The code is a lot simpler and some nasty  
> gcc bugs can be avoided more easy.

But this is platform independent code. The cost ratio of an inequality  
and jump compared to a hardware modulo is much less than a software  
modulo and an inequality and jump.

Phil


More information about the Tinyos-devel mailing list