<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>I would hesitate to implement small sets as LONGINT instead of INTEGER, since there is no guarantee that LONGINT is necessarily efficient, whereas INTEGER is intended to be the same as the natural word size of the target.</div><div><br></div><div>I could take a look at this but not anytime soon, since I have several other things I need to work on.</div><div><br></div><div>On Apr 14, 2008, at 10:51 AM, Jay wrote:</div></span></span></span></span></span></span></span></span></div></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><font size="2">currently set <,>,<=,>= are implemented merely as<br>integer <,>,<=,>=</font></div></span></blockquote><div><br></div><div>Yes, that seems quite wrong.  I can't imagine things ever worked properly if that is how they are implemented.</div><div><br></div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><font size="2"><br> <br>This is wrong.<br> <br>I believe it should be:<br> <br>a < b => (a & b) == a<br>a <= b => (a & b) == a (same as <=)</font></div></span></blockquote><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><font size="2">a > b => (a & b) == b<br>a >= b => (a & b) == b (same as >)</font></div></span></blockquote><div><br></div><div>Probably should be:</div><div><br></div><div>a <= b => (a & b) == a</div><div>a < b => (a # b) && ((a & b) == a)</div><div>a >= b => (a & b) == b</div><div>a > b => (a # b) && ((a & b) == b)</div><div><br></div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; "><font size="2"><br> <br>The bug is in the frontend.<br> <br>m3-sys\m3front\src\misc\CG.m3.<br> <br>The code should be /something/ like:<br> <br>PROCEDURE Set_compare (s: Size; op: Cmp) =<br>VAR tmp: Val;<br>  swap := FALSE;<br>BEGIN<br>  (* a op b => BOOLEAN *)<br>  IF Force_pair (commute := TRUE) THEN<br>    op := M3CG.SwappedCompare [op];<br>  END;<br>  IF (s <= Target.Integer.size) THEN<br>    IF (op = Cmp.EQ) OR (op = Cmp.NE) THEN<br>      cg.compare (Target.Word.cg_type, Target.Integer.cg_type, op);<br>    ELSE<br>      (* set a is less than or equal to set b, if all of set a's members are in set b. *)<br>      IF (op = Cmp.LT) OR (op = Cmp.LE) THEN<br>        swap := TRUE;<br>        Swap ();<br>      END;<br><strong>      tmp := Pop ();</strong><br><strong>      Push (tmp);</strong><br>      IF swap THEN<br>        Swap ();<br>      END;<br><strong>       cg.and (Target.Integer.cg_type);</strong><br><strong>       Push (tmp);</strong><br>      SimpleIndirectLoad (tmp^, Target.Word.cg_type);<br>      EVAL Force_pair (commute := TRUE);<br><strong>       cg.compare (Target.Word.cg_type, Target.Integer.cg_type, Cmp.EQ);</strong><br>      SPop (1, "Set_compare");<br>      Free (tmp);<br>    END;<br>  ELSE<br>    cg.set_compare (AsBytes (s), op, Target.Integer.cg_type);<br>  END;<br>  SPop (2, "Set_compare");<br>  SPush (Type.Int32);<br>END Set_compare;<br> <br>though this doesn't quite drive all the machinery correctly, since it yields assertion failures in the compiler due to an unbalanced software stack.<br>upgrade works, but the test case (p155) fails assertions in the integrated backend.<br> <br>I'd love to figure this out but have to do other stuff for now.<br>Anyone (if there is anyone) familiar with what all is being pushed and popped around here should be able to figure it out easily from this mail.<br>Otherwise I'll stare at more later.<br> <br>ps: "small" sets should probably be anything up to the number of bits in longint, rather than int or pointer, since that is probably efficient enough at the next level down. This is tangential.<br> <br>- Jay<br></font></div></span></blockquote></div><br></body></html>