<html><head><base href="x-msg://207/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>You should not assume that aliasing works for any of these operations.</div><br><div>
<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; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-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; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-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; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-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; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-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; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-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; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-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; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-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; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 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; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><font class="Apple-style-span" color="#0000FF"><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Antony Hosking</span></span></font></font><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-converted-space"> </span>|<span class="Apple-converted-space"> </span></span></span><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Office</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 |<span class="Apple-converted-space"> </span></span></span></font><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Mobile</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><br class="khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="Apple-interchange-newline"></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On 21 Jan 2010, at 02:02, Jay K wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; 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: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">Hm. Ok. TInt.Multiply allows aliasing but TWord.Multiply does not.<br> <br> <br>MODULE Main;<br>IMPORT RTIO, Target, TInt, TWord;<br>VAR a,b:Target.Int;<br>BEGIN<br>EVAL TInt.FromInt(1, BYTESIZE(INTEGER), a);<br>EVAL TInt.FromInt(1, BYTESIZE(INTEGER), b);<br>TWord.Multiply(a, b, a);<br>RTIO.PutText(TInt.ToText(a));<br>RTIO.Flush();<br>END Main.<br><br> <br>prints 0.<br> <br>The code in m3back:<br> <br> <br>PROCEDURE doindex_address (t: T; shift, size: INTEGER; neg: BOOLEAN) =<br>...<br> (* Beware TWord.Multiply: x * 1 = 0 *)<br> IF NOT TInt.Multiply(stop0.imm, tsize, stop0.imm) THEN<br> t.Err("doindex_address: multiply overflowed");<br> END;<br><br> <br> <br> - Jay<br><br> <br><hr id="stopSpelling">From:<span class="Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Wed, 20 Jan 2010 20:00:39 -0500<br>To:<span class="Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>CC:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>Subject: Re: [M3devel] [M3commit] m3back using Target.Int in place of INTEGER a lot now<br><br><div>Jay, I don't know what you are talking about there being a bug in TWord.Multiply.</div><div><br></div><div>This little program prints out 2, as would be expected:</div><div><br></div><div><div>MODULE Main;</div><div>IMPORT RTIO, TInt, TWord, Target;</div><div><br></div><div>VAR i := TInt.Two;</div><div> j: Target.Int;</div><div> buf: ARRAY[0..10] OF CHAR;</div><div>BEGIN</div><div> TWord.Multiply (i, TInt.One, j);</div><div> FOR k := 0 TO TInt.ToChars (i, buf) DO</div><div> RTIO.PutChar(buf[k]);</div><div> END;</div><div> RTIO.PutChar('\n');</div><div> RTIO.Flush();</div><div>END Main.</div><div><br></div></div><br><div><div>On 20 Jan 2010, at 18:59, Tony Hosking wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div style="word-wrap: break-word; ">Where's the bug in TWord.Multiply?<div>If there were a bug we would have seen it by now surely?</div><div><br><div><span class="ecxApple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal 12px/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><div><font class="ecxApple-style-span" color="#0000ff"><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); ">Antony Hosking</span></span></font></font><font class="ecxApple-style-span" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-converted-space"> </span>|<span class="ecxApple-converted-space"> </span></span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); ">Office</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light; "><span class="ecxApple-style-span" style="font-family: GillSans-Light; "> <skype:span id="softomate_v3_highlight_0" class="skype_v3_tb_injection" title="Call this phone number in United States of America with Skype: +17654946001" rtl="1" skypeid="0" skypeaction="call" nof="" isfax="" freecall="" fwidth=".w16" type=".flex" mode=".compat" path="file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/" durex2="%DADDYHEIGHT%" durex="%DADDYWIDTH%" context="+1 765 494 6001"><skype:span id="skype_v3_tb_img_r0" class="skype_v3_tb_imgR"></skype:span><skype:span id="skype_v3_tb_text0" class="skype_v3_tb_injectionIn"><skype:span id="skype_v3_tb_innerText0" class="skype_v3_tb_innerText"> +1 765 494 6001 </skype:span></skype:span><skype:span id="skype_v3_tb_img_s0" class="skype_v3_tb_imgS"></skype:span><skype:span id="skype_v3_tb_droppart_0" class="skype_v3_tb_imgA" title="Skype actions" skypeid="0" skypeaction="drop" skypesms="0" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/inactive_a.compat.flex.w16.gif); "><skype:span id="skype_v3_tb_img_f0" class="skype_v3_tb_imgFlag" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/famfamfam/US.gif); "></skype:span></skype:span></skype:span><span class="Apple-converted-space"> </span><skype:span id="softomate_v3_print_0" class="skype_v3_tb_injection_print" context="">+1 765 494 6001</skype:span><span class="Apple-converted-space"> </span>|<span class="ecxApple-converted-space"> </span></span></span></font><font class="ecxApple-style-span" color="#0000ff" face="Gill Sans"><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); "><span class="ecxApple-style-span" style="font-family: 'Gill Sans'; color: rgb(0, 0, 255); ">Mobile</span></span></font><font class="ecxApple-style-span" face="GillSans-Light"><span class="ecxApple-style-span" style="font-family: GillSans-Light; "><span class="ecxApple-style-span" style="font-family: GillSans-Light; "><span class="ecxApple-converted-space"> </span><skype:span id="softomate_v3_highlight_1" class="skype_v3_tb_injection" title="Call this phone number in United States of America with Skype: +17654275484" skypeid="1" skypeaction="call" nof="" isfax="" freecall="" fwidth=".w16" type=".flex" mode=".compat" path="file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/" durex2="%DADDYHEIGHT%" durex="%DADDYWIDTH%" context="+1 765 427 5484"><skype:span id="skype_v3_tb_droppart_1" class="skype_v3_tb_imgA" title="Skype actions" skypeid="1" skypeaction="drop" skypesms="1" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/inactive_a.compat.flex.w16.gif); "><skype:span id="skype_v3_tb_img_f1" class="skype_v3_tb_imgFlag" style="background-image: url(file://C:/Users/jay/Temp/__SkypeIEToolbar_Cache/e70d95847a8f5723cfca6b3fd9946506/static/famfamfam/US.gif); "></skype:span></skype:span><skype:span id="skype_v3_tb_img_s1" class="skype_v3_tb_imgS"></skype:span><skype:span id="skype_v3_tb_text1" class="skype_v3_tb_injectionIn"><skype:span id="skype_v3_tb_innerText1" class="skype_v3_tb_innerText"> +1 765 427 5484 </skype:span></skype:span><skype:span id="skype_v3_tb_img_r1" class="skype_v3_tb_imgR"></skype:span></skype:span><span class="Apple-converted-space"> </span><skype:span id="softomate_v3_print_1" class="skype_v3_tb_injection_print" context="">+1 765 427 5484</skype:span></span></span></font></div><div><font class="ecxApple-style-span" face="GillSans-Light"><br class="ecxkhtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="ecxApple-interchange-newline"></span></div></span><br class="ecxApple-interchange-newline"></div><br><div><div>On 20 Jan 2010, at 10:05, Jay K wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="text-transform: none; text-indent: 0px; border-collapse: separate; font: normal normal normal medium/normal Helvetica; white-space: normal; letter-spacing: normal; word-spacing: 0px; "><div class="ecxhmmessage" style="font-family: Verdana; font-size: 10pt; ">This is fairly large and tedious. If anyone has the patience to look at every single line, please do. Thanks.<br>I did look through pretty much every single line in search of the one bug I saw working on it.<br>It turns out the bug was in TWord though. TWord.Multiply(x, 1) = 0.<br>Which broke INC, it was adding 0 instead 1.<br>You could see the bug in RTIO.PutString where it just kept outputing the first character.<br>So I use TInt.Multiply instead.<br> <br> - Jay<br> <br><hr id="ecxstopSpelling">From:<span class="ecxApple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>To:<span class="ecxApple-converted-space"> </span><a href="mailto:jkrell@elego.de">jkrell@elego.de</a>;<span class="ecxApple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>Date: Wed, 20 Jan 2010 15:02:27 +0000<br>Subject: Re: [M3commit] CVS Update: cm3<br><br>diff attached<br><br><br><br><br><br> <br>> Date: Wed, 20 Jan 2010 16:01:32 +0000<br>> To:<span class="ecxApple-converted-space"> </span><a href="mailto:m3commit@elegosoft.com">m3commit@elegosoft.com</a><br>> From:<span class="ecxApple-converted-space"> </span><a href="mailto:jkrell@elego.de">jkrell@elego.de</a><br>> Subject: [M3commit] CVS Update: cm3<br>><span class="ecxApple-converted-space"> </span><br>> CVSROOT: /usr/cvs<br>> Changes by: jkrell@birch. 10/01/20 16:01:32<br>><span class="ecxApple-converted-space"> </span><br>> Modified files:<br>> cm3/m3-sys/m3back/src/: Codex86.i3 Codex86.m3 M3x86.m3<span class="ecxApple-converted-space"> </span><br>> M3x86Rep.i3 Stackx86.i3 Stackx86.m3<span class="ecxApple-converted-space"> </span><br>> cm3/m3-sys/m3middle/src/: TInt.i3 TInt.m3<span class="ecxApple-converted-space"> </span><br>><span class="ecxApple-converted-space"> </span><br>> Log message:<br>> convert much of m3back to use Target.Int instead of INTEGER<br>> This should at least allow it to propagate constant LONGINTs<br>> as well as perhaps otherwise help with implementing LONGINT,<br>> since the virtual stack is now of Target.Int instead of INTEGER<br>><span class="ecxApple-converted-space"> </span><br>> Beware that TWord.Multiply(x, 1) = 0, so I use TInt.Multiply instead<br>><span class="ecxApple-converted-space"> </span><br>> Also note that there's still a lot of "INTEGER" used.<br>><span class="ecxApple-converted-space"> </span><br></div></span></blockquote></div><br></div></div></blockquote></div><br></div></span><br class="Apple-interchange-newline"></blockquote></div><br></body></html>