<html><head><base href="x-msg://15/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">In general, it is OK for a cross-host to impose smaller restrictions than the target.  A native compiler should always be bootstrapped from any cross-compiled compiler anyway, at which point it will acquire it's native restrictions.<br>
<br><div><div>On Nov 20, 2010, at 7:26 PM, 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-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; font-size: medium; "><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; ">Target.Int is onerous, due to no operators (+, -, *, <, =) and everything can fail.<br>  Operators are nice. e.g. defining them for user defined types.<br><br><br>In some places, things are limited by an INTEGER number of bits.<br>In m3core/TextLiteral.i3 fiddle with this and cross from 32bits to 64:<br><br><br> (* DIV BITSIZE should not be here! *)<br> (* MaxBytes = LAST (INTEGER) DIV BITSIZE (Byte) - 7 - 8 * ORD(BITSIZE(INTEGER) = 64); *)<br> MaxBytes = 16_7FFFFFFF DIV BITSIZE (Byte) - 7 - 8 * ORD(BITSIZE(INTEGER) = 64);<br><br><br>Possibly due to ArrayType.m3:<br><br>    IF NOT TInt.ToInt (Type.Number (p.index), p.n_elts) THEN<br>      Error.Msg ("CM3 restriction: array has too many elements");<br>      p.n_elts := 1;<br>    END;<br><br>or<br><br>    IF (p.n_elts > 0) AND (p.elt_pack > 0)<br>      AND (p.n_elts > MAXSIZE DIV p.elt_pack) THEN<br>      Error.Msg ("CM3 restriction: array type too large");<br>      full_size := 0;<br>      p.total_size := 0;<br><br><br>or ArrayExpr.m3:<br><br><br>      IF NOT TInt.ToInt (nn, n) THEN<br>        Error.Msg ("array has too many elements");<br>      END;<br><br><br>Clearly it should work and it isn't difficult, but it is very very tedious and therefore also error prone.<br>You end up having to replace many instances of INTEGER, and then all the uses.<br>With LONGINT, perhaps, you can just change the types and not have to visit every single use.<span class="Apple-converted-space"> </span><br><br><br> - Jay<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: Sat, 20 Nov 2010 11:35:21 -0500<br>To:<span class="Apple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>CC:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>Subject: Re: [M3devel] LONGINT in frontend?<br><br>Target.Int is appropriate here, not LONGINT.<div>Where is the current 2Gbyte limit encoded?<br><br><div><div>On Nov 20, 2010, at 3:43 AM, Jay K wrote:</div><br class="ecxApple-interchange-newline"><blockquote><span class="ecxApple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium; "><div class="ecxhmmessage" style="font-size: 10pt; font-family: Tahoma; ">How about we use LONGINT a bunch in the frontend<br>instead of INTEGER? Either that, or Target.Int.<br>I do think 32bit frontend should be able to target<br>64bit target, including declaring data structures<br>larger than 2GB. (besides that the current limit<br>is 2 billion bits, not bytes like it should be..)<br><br>LONGINT is easier.<br><br>I won't get to either for a little while, other stuff first.<br><br> - Jay</div></span></blockquote></div><br></div></div></span><br class="Apple-interchange-newline"></blockquote></div><br></body></html>