<div dir="ltr">Hi Esteban,<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 20, 2015 at 2:37 PM, Esteban Lorenzano <span dir="ltr">&lt;<a href="mailto:estebanlm@gmail.com" target="_blank">estebanlm@gmail.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><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On 20 Oct 2015, at 23:28, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:</div><br><div><br><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Tue, Oct 20, 2015 at 1:35 PM, Esteban Lorenzano<span> </span><span dir="ltr">&lt;<a href="mailto:estebanlm@gmail.com" target="_blank">estebanlm@gmail.com</a>&gt;</span><span> </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><div style="word-wrap:break-word">well… I solve the problem. <div>Everything is about the first issue report (comparison is always true). </div><div>I changed first from “unsigned long” to “sqLong” but then I realised sqLong is defined as “long long” so this expression: </div><div><br></div><div><span style="white-space:pre-wrap">        </span>intValue bitXor: (intValue &lt;&lt; 1)) &gt;= 0</div><div><br></div><div>since number fitted in &quot;long long”, was also always true. Then of course it was converting into a SmallInteger a number that should be a LongPositiveInteger. </div><div><br></div><div>my fix: just to change #maybeInlinePositive32BitIntegerFor: and around to ensure parameter is “sqInt”. </div><div>That works. </div></div></blockquote><div><br></div><div>No, you can&#39;t cast within  maybeInlinePositive32BitIntegerFor:.  That will break its use on long long values.</div></div></div></blockquote><div><br></div><div>but now does not work, because compiler says it is always true (any unsigned comparison to &gt;= 0 will always evaluate to true for clang). </div><div>Unsigned long is always &gt;= 0.</div></div></div></blockquote><div><br></div><div>Yes.  But if called with a saint it won&#39;t be. What&#39;s the context?  This thing is used in lots of places.  Please tell me where you&#39;re finding the problem.</div><div><br></div><div> </div><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"><div style="word-wrap:break-word"><div><div>And with long long values (sqLong) always fit, so is also always true. </div></div></div></blockquote><div><br></div><div>OK, so is what you&#39;re saying that</div><div><br></div><div><div>isIntegerValue: intValue</div><div><span class="" style="white-space:pre">        </span>&quot;Answer if the given value can be represented as a Smalltalk integer value.</div><div><span class="" style="white-space:pre">        </span> In C, use a shift and XOR to set the sign bit if and only if the top two bits of the given</div><div><span class="" style="white-space:pre">        </span> value are the same, then test the sign bit. Note that the top two bits are equal for</div><div><span class="" style="white-space:pre">        </span> exactly those integers in the range that can be represented in 31-bits or 63-bits.&quot;</div><div><span class="" style="white-space:pre">        </span>&lt;api&gt;</div><div><span class="" style="white-space:pre">        </span>^self</div><div><span class="" style="white-space:pre">                </span>cCode: [(intValue bitXor: (intValue &lt;&lt; 1)) &gt;= 0]</div><div><span class="" style="white-space:pre">                </span>inSmalltalk: [intValue &gt;= 16r-40000000 and: [intValue &lt;= 16r3FFFFFFF]]</div></div><div><br></div><div>doesn&#39;t work for other than 32-bit values in clang?  Looks like this needs to be smarter.  If it is called with squints then it is fine, but if called with long long or unsigned long long we need to use the Smalltalk code:</div><div><br></div><div>    intValue &gt;= 16r-40000000 and: [intValue &lt;= 16r3FFFFFFF]<br></div><div><br></div><div>Slang can be (carefully) modified to do this.  But please, I need some specific examples, not just &quot;it doesn&#39;t work&quot;.  I need to know where it doesn&#39;t work, because in many places it works just fine, and changing things willy nilly is not the right thing to do (tm).</div><div><br></div><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"><div style="word-wrap:break-word"><div><div><br></div><div>I can of course ensure the type of parameter passed to maybeInlinePositive32BitIntegerFor before (not in the method). That will fulfil your requirement of not cast the function.</div><br><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><br></div><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"><div style="word-wrap:break-word"><div><br></div><div>Now, I have this doubts: </div><div><br></div><div>- how is possible this was working before? maybe this is a change in clang 7 (apple)?</div></div></blockquote><div><br></div><div>Unless we look in the debugger we won&#39;t know.</div></div></div></blockquote><div><br></div><div>I spent last 3 days doing it. #maybeInlinePositive32BitIntegerFor: was always “inlining”. </div><br><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div> </div><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"><div style="word-wrap:break-word"><div>- now I have a lot of complains of “comparison of unsigned expression is always true” all around the image. Should we take care about them?</div></div></blockquote><div><br></div><div>Looks like it.</div></div></div></blockquote><div><br></div><div>So this is a major problem, I think… I will check.</div><div><br></div><div>Esteban</div><br><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div> </div><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"><div style="word-wrap:break-word"><div><br></div><div>I will do some tests and commit to VMMaker tomorrow. </div></div></blockquote><div><br></div><div>Don&#39;t just blindly commit a fix that makes clang 7 work.  It could easily break everything elsewhere.  Instead, we need to understand the issues first.</div><div> </div><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"><div style="word-wrap:break-word"><div><br></div><div>cheers,</div><div>Esteban</div><div><br></div><div><br><div><blockquote type="cite"><div>On 19 Oct 2015, at 18:31, Esteban Lorenzano &lt;<a href="mailto:estebanlm@gmail.com" target="_blank">estebanlm@gmail.com</a>&gt; wrote:</div><br><div><div style="word-wrap:break-word"><div>Hi, </div><div><br></div><div>Does anyone tested Alien on Spur and &quot;El capitan&quot;? specifically callbacks?</div><div>For me, a completely broken :(</div><div><br></div><div>1) this structure (in maybeInlinePositive32BitIntegerFor: and others): </div><div><br></div><div><div><span style="white-space:pre-wrap">        </span>(integerValue &gt;= 0</div><div><span style="white-space:pre-wrap">        </span><span> </span>and: [objectMemory isIntegerValue: integerValue]) ifTrue:</div><div><span style="white-space:pre-wrap">                </span>[^objectMemory integerObjectOf: integerValue].</div></div><div><br></div><div>Does not works if “integer value” is an unsigned long, because compiler assumes it will always be true, then remove the if, then answers a wrong value. </div><div><br></div><div>2) <span style="color:rgb(120,73,42);font-family:Menlo;font-size:11px">assertCStackWellAligned </span>always fail. No idea why because if does not says anything, just jmp back to the regular flow. </div><div><br></div><div>3) finally, <span style="color:rgb(79,129,135);font-family:Menlo;font-size:11px">ceCaptureCStackPointers </span>also fails… this can be because (2) or because other reasons (it also jmps back so no clue) (method generateCaptureCStackPointers: clarifies is a hack, so I suppose it stopped to work). </div><div><br></div><div>I guess solution of (1) is easy: argument number just has to be a sqLong instead an unsigned long. </div><div><br></div><div>But for 2 and 3 I have no idea where to start.</div><div><br></div><div>Does anyone has an idea?</div><div><br></div><div>Esteban</div><div><br></div></div></div></blockquote></div><br></div></div><br></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br clear="all" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">--<span> </span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></blockquote></div><br></div><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>