No subject


Thu Jun 18 11:58:53 PDT 2009


a really big difference in performance and code generated.  So I would
suggest we should aim towards keeping things as platform independent as
possible while keeping an eye out for when things byte (sic) us.

What Vlado has touched on is why originally "int" was platform dependent.
 Use "int" when you want the native (assumed efficient) size integer.
 Problem is it causes problems.

eric


>
>
> Phil
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC

--001e680f18c077b46c046d31b2c5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Thu, Jun 25, 2009 at 12:44 PM, Philip=
 Levis <span dir=3D"ltr">&lt;<a href=3D"mailto:pal at cs.stanford.edu">pal at cs.=
stanford.edu</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im"><br>
On Jun 25, 2009, at 12:06 PM, Eric Decker wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<br>
<br>
On Thu, Jun 25, 2009 at 11:54 AM, Philip Levis &lt;<a href=3D"mailto:pal at cs=
.stanford.edu" target=3D"_blank">pal at cs.stanford.edu</a>&gt; wrote:<br>
<br>
On Jun 25, 2009, at 11:42 AM, Vlado Handziski wrote:<br>
<br>
Speaking about optimization, and looking at your example snippet: For the m=
sp430 platforms, it is always much more efficient to use word size array in=
dices. The code is a lot simpler and some nasty gcc bugs can be avoided mor=
e easy.<br>

<br>
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.<br>
<br>
Phil<br>
<br>
I&#39;m not following the analysis because I&#39;m not sure what is meant b=
y hardware vs. software modulo. =A0 % on the MSP430 is implemented by a lib=
rary routine that takes a significant number of instructions. =A0 Whereas t=
he comparsion, jump, assignment take much fewer.<br>

</blockquote>
<br></div>
By &quot;software modulo&quot; I mean &quot;a library routine.&quot; By &qu=
ot;hardware modulo&quot; I mean an ALU that computes modulo, e.g., as the i=
Mote2 has. The point is that making an iMote2 do a compare and jump is not =
a big overhead over a hardware modulo, while making an msp430 (or other MCU=
s) do a software modulo is a big overhead over a compare and jump. But star=
ting to set the width of variables in platform-independent code due to some=
 particulars of a popular MCU&#39;s compiler (as Vlado suggested) seems lik=
e a bad idea.</blockquote>
<div><br></div><div>In general, I agree with you.</div><div><br></div><div>=


More information about the Tinyos-devel mailing list