<div dir="ltr">sorry, wrong list.  Will do it right in future.  Mostly.<div><br></div><div>-cbc</div><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Chris Cunningham</b> <span dir="ltr">&lt;<a href="mailto:cunningham.cb@gmail.com">cunningham.cb@gmail.com</a>&gt;</span><br>Date: Fri, Aug 21, 2015 at 4:16 PM<br>Subject: Re: [squeak-dev] Questionable comment<br>To: The general-purpose Squeak developers list &lt;<a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.squeakfoundation.org</a>&gt;<br><br><br><div dir="ltr">Hi Eliot,<br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Aug 20, 2015 at 9:25 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Chris,<div class="gmail_extra"><br><div class="gmail_quote"><span>On Wed, Aug 19, 2015 at 1:06 PM, Chris Cunningham <span dir="ltr">&lt;<a href="mailto:cunningham.cb@gmail.com" target="_blank">cunningham.cb@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">well, not questionable - bad.<div><br></div><div>(in ByteArray)</div><div><br></div><div><div>long64At: index</div><div><span style="white-space:pre-wrap">        </span>&quot;Answer a 64-bit integer in Smalltalk order (little-endian).&quot;</div><div><span style="white-space:pre-wrap">        </span>| n1 n2 |</div><div><span style="white-space:pre-wrap">        </span>n1 := self unsignedLongAt: index bigEndian: true.</div><div><span style="white-space:pre-wrap">        </span>n2 := self unsignedLongAt: index+4 bigEndian: true.</div></div><div><br></div><div>These are obviously bigEndian now, nto litte-endian.</div><div><br></div><div>Does this mean Smalltalk order (or now Squeak order) has changed?</div></div></blockquote><div><br></div></span><div>This is not for general purpose.  The method is part of VMMaker.  Let&#39;s take it to vm-dev. </div><div>It&#39;s a simple mistake.  If you look at long64At:put: you&#39;ll see the comment is correct:</div></div></div></div></blockquote><div><br></div></span><div>Yes.  I had loaded the VMMaker to look at the ARM jit code (I&#39;m working on an ARM simulator - fun project), and then forgot I had it loaded.  then later, I needed to pull 64-bit integers out of a structure (while writing a KAFKA interface) and stumbled on this.  I think a generalized 64 bit put/access would be useful, and maybe even a general 128 bit too (although I have no need for it at this time).</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><div>long64At: index put: val</div><div><span style="white-space:pre-wrap">        </span>&quot;I store 64-bit integers in Smalltalk (little-endian) order.&quot;</div><div><span style="white-space:pre-wrap">        </span>self unsignedLongAt: index put: (val bitAnd: 16rFFFFFFFF) bigEndian: false.</div><div><span style="white-space:pre-wrap">        </span>self unsignedLongAt: index+4 put: (val bitShift: -32) bigEndian: false.</div><div><span style="white-space:pre-wrap">        </span>^val</div></div><div><br></div></div></div></div></blockquote></span><div>I&#39;m now confused.  Not only is the comment wrong, but it looks like the code is wrong.  The get (#long64At:) is actually getting the 64-bit integer in big-endian order (as witnessed by the two sub-calls, too), while the put it truly doing it in little-endian format.</div><div><br></div><div>Or am I missing something?</div><div><br></div><div>-cbc</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Thanks for finding this!</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>-cbc</div></div>
<br><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</font></span></div></div>
<br><br>
<br></blockquote></span></div><br></div></div>
</div><br></div></div>