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

Eric Decker cire831 at gmail.com
Thu Jun 25 12:06:05 PDT 2009


On Thu, Jun 25, 2009 at 11:54 AM, Philip Levis <pal at cs.stanford.edu> wrote:

>
> 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
>

I'm not following the analysis because I'm not sure what is
meant by hardware vs. software modulo.   % on the MSP430 is
implemented by a library routine that takes a significant number of
instructions.   Whereas the comparsion, jump, assignment take much
fewer.



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20090625/3cb85941/attachment.htm 


More information about the Tinyos-devel mailing list