Hi Bert,  All,<div><br></div><div>    Hold on!<br><br><div class="gmail_quote">On Wed, Jul 1, 2009 at 11:52 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
<br>
On 01.07.2009, at 19:02, Nicolas Cellier wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2009/7/1 David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Wed, Jul 01, 2009 at 08:32:18AM -0700, Andreas Raab wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Ouch. Yeah, I&#39;d say that&#39;s right...<br>
</blockquote>
<br>
This is from <a href="http://bugs.squeak.org/view.php?id=7260" target="_blank">http://bugs.squeak.org/view.php?id=7260</a>. I reopened the<br>
issue on Mantis.<br>
<br>
I&#39;ll apply the fix to VMMaker as soon as I can (but feel free to do the<br>
update if I don&#39;t get to it first; Bert you have developer access as well<br>
as Andreas of course).<br>
<br>
Dave<br>
<br>
</blockquote>
<br>
Ouch again, my fault.<br>
How can the tests pass... Hmm not enough test?<br>
</blockquote>
<br>
<br></div>
the failure would only be triggered for code like<br>
<br>
0.1 &lt;= 0.2 ifTrue: [...]<br>
<br>
but not for<br>
<br>
self assert: 0.1 &lt;= 0.2</blockquote><div><br></div><div>That&#39;s not my reading of booleanCheat:.  booleanCheat: takes a C boolean argument cond.  If the following bytecodes are those of a conditional branch then it either takes or skips those bytecodes based on the value of cond, otherwise it reifies cond as either true or false.  i.e. the jump and reification behaviours match (duh!).  So I think it *does* show up in both </div>

<div><br></div><div>    0.1 &lt;= 0.2 ifTrue: [...]</div><div>and</div><div>    self assert: 0.1 &lt;= 0.2</div><div><br></div><div>Further, the comment I have in my versions is I think correct:</div><div><br></div><div>
<div>
bytecodePrimGreaterOrEqual</div><div><span style="white-space:pre">        </span>| rcvr arg aBool |</div><div><span style="white-space:pre">        </span>rcvr := self internalStackValue: 1.</div>
<div><span style="white-space:pre">        </span>arg := self internalStackValue: 0.</div><div><span style="white-space:pre">        </span>(self areIntegers: rcvr and: arg) ifTrue:</div><div>
<span style="white-space:pre">                </span>[&quot;The C code can avoid detagging since tagged integers are still signed.</div><div><span style="white-space:pre">                </span> But this means the simulator must override to do detagging.&quot;</div>

<div><span style="white-space:pre">                </span>self cCode: &#39;&#39; inSmalltalk: [^self booleanCheat: (self integerValueOf: rcvr) &gt;= (self integerValueOf: arg)].</div><div><span style="white-space:pre">                </span>^self booleanCheat: rcvr &gt;= arg].</div>

<div><br></div><div><span style="white-space:pre">        </span>successFlag := true.</div><div>&gt;&gt;<span style="white-space:pre">        </span>&quot;Invert test so that NaN comparisons work correctly.&quot;</div>
<div><span style="white-space:pre">        </span>aBool := self primitiveFloatLess: rcvr thanArg: arg.</div><div><span style="white-space:pre">        </span>successFlag ifTrue: [^self booleanCheat: aBool not]</div>
<div><br></div><div>Because</div><div><br></div><div>    | aNaN | aNaN := Float nan.  nan &gt;= nan</div><div><br></div><div>must be false (since nan ~= nan) and because</div><div><br></div><div>    | aNaN | aNaN := Float nan.  nan &lt; nan</div>

<div><br></div><div>is true (because that&#39;s what the IEEE spec says (Nicholas can you confirm?)) then the inversion is correct, as with the inversion</div><div><br></div><div><div>    | aNaN | aNaN := Float nan.  nan &gt;= nan</div>

<div><br></div><div>is false, which is correct, isn&#39;t it?  (might be, might not be, but IANAIEEE754L)</div><div><br></div><div>So before we thrash breaking what looked a few weeks ago to be the right fix can we please write the relevant tests.  I nominate Nicholas as he wrote the bug fixes and revamped the tests we have in the first place.</div>

<div><br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><font color="#888888">
<br>
<br>
- Bert -<br>
<br>
<br>
</font></blockquote></div><br></div>