[M3devel] tangential 64 bit...

Tony Hosking hosking at cs.purdue.edu
Tue Feb 26 21:14:18 CET 2008


Indeed, on a 32-bit platform [16_0 .. 16_ffffffff] is an empty type,  
because 16_ffffffff is interpreted as an INTEGER constant with value  
-1, so the subrange is [0..-1].

This implies that one should not be using a 32-bit compiler to compile  
the 64-bit version of BasicCtypes.i3 in the first place.

Of course, this also implies that one cannot directly cross-compile to  
64-bit targets from 32-bit hosts, which is kind of broken.  I suppose  
we could use LONGINT as necessary, realizing that LONGINT and INTEGER  
are distinct types that happen to have the same representation on 64- 
bit machines but different representation on 32-bit machines.  Does  
anyone know if it was *ever* possible in the old PM3 to cross-compile  
from 32-bit to 64-bit?  Presumably one needs an intermediate step  
where the C types used on the cross-compile host match those of the  
host instead of the target.

On Feb 26, 2008, at 1:53 PM, Jay wrote:

> alpha/osf doesn't work because basictypes/ctypes has a problem with  
> the 32bit or 64bit types.
> specifically "unsigned long" is "empty" for some reason and many  
> errors cascade from that.
>
> if you change:
>   unsigned_int       = [16_0 .. 16_ffffffff];
> to
>   unsigned_int       = [16_0 .. 16_fffffffe];
>
> you get:
>
>
> ***
> *** runtime error:
> ***    An array subscript was out of range.
> ***    file "../src/TWord.m3", line 199
> ***
>
> Presumably fixing this first problem is the first step in any "real"  
> 64 bit target (SPARC64, PPC64, AMD64, IA64), and the second problem  
> should just be fixed as a matter of course.
>
> I know this is the least of anyone's concerns..
>
>  - Jay
>
>
> Connect and share in new ways with Windows Live. Get it now!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080226/63383a19/attachment-0002.html>


More information about the M3devel mailing list