<div dir="ltr">Hi David,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 4:03 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
On Tue, May 20, 2014 at 12:15:35PM +0000, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:<br>
&gt;<br>
&gt; Eliot Miranda uploaded a new version of VMMaker to project VM Maker:<br>
&gt; <a href="http://source.squeak.org/VMMaker/VMMaker.oscog-eem.724.mcz" target="_blank">http://source.squeak.org/VMMaker/VMMaker.oscog-eem.724.mcz</a><br>
&gt;<br>
&gt; ==================== Summary ====================<br>
&gt;<br>
&gt; Name: VMMaker.oscog-eem.724<br>
&gt; Author: eem<br>
&gt; Time: 20 May 2014, 5:14:34.356 am<br>
&gt; UUID: 30e942d9-0d06-42d3-8f9a-893dbdee37c2<br>
&gt; Ancestors: VMMaker.oscog-eem.723<br>
&gt;<br>
&gt; Slang/general:<br>
&gt; VMBIGENDIAN must *not* be defined during generation.  It<br>
&gt; should be taken from platforms/??/vm/sqConfig.h.  This should<br>
&gt; go a long way to fixing Doug&#39;s issues on PPC.<br>
&gt;<br>
<br>
For sure VMBIGENDIAN should not be generated from slang. But more generally,<br>
it is available at runtime via Interpreter&gt;&gt;isBigEnder, so the declaration<br>
in sqConfig.h should not be required either.<br></blockquote><div><br></div><div>IMO isBigEnder is a cruel joke:</div><div><br></div><div>isBigEnder</div><div><span class="" style="white-space:pre">        </span>&quot;Answer true (non-zero) if running on a big endian machine.&quot;</div>
<div><span class="" style="white-space:pre">        </span>| endianness anInt cString len i |</div><div><span class="" style="white-space:pre">        </span>&lt;var: &#39;cString&#39; type: &#39;char *&#39;&gt;</div><div><span class="" style="white-space:pre">        </span>&lt;var: &#39;endianness&#39; declareC: &#39;static sqInt endianness = -1&#39;&gt;</div>
<div><span class="" style="white-space:pre">        </span>(endianness == -1) ifFalse: [^ endianness]. &quot;answer cached value&quot;</div><div><span class="" style="white-space:pre">        </span>len := self cCode: &#39;sizeof(anInt)&#39;</div>
<div><span class="" style="white-space:pre">                        </span>inSmalltalk: [^ (Smalltalk endianness == #little) not].</div><div><span class="" style="white-space:pre">        </span>cString := self cCode: &#39;(char *) &amp;anInt&#39; inSmalltalk: [].</div>
<div><span class="" style="white-space:pre">        </span>i := 0.</div><div><span class="" style="white-space:pre">        </span>[i &lt; len] whileTrue:</div><div><span class="" style="white-space:pre">                </span>[cString at: i put: i.</div>
<div><span class="" style="white-space:pre">                </span>i := i + 1].</div><div><span class="" style="white-space:pre">        </span>endianness :=  anInt bitAnd: 255.</div><div><span class="" style="white-space:pre">        </span>^ endianness</div>
<div><br></div><div>This simply isn&#39;t usable for something like testing the numArgs in a frame to decide on pushTemp: whether to fetch the temp from the arguments side of the frame or the temporary side of the frame.  It is also unnecessarily complex, with the cacheing on first use.  Now every test of endianness (which is in 99.9999999% of cases constant throughout a program&#39;s run) involves at least two tests, is the cache valid? followed by what&#39;s the value of the cache?.</div>
<div><br></div><div>So I deleted it from Cog and instead use VMBIGENDIAN directly.  If we care about performance (and VM writes should), we don&#39;t want to fetch a constant value and test it, ever.  We want the value tested at compile time.</div>
<div></div></div><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>