[M3devel] LONGINT
Tony Hosking
hosking at cs.purdue.edu
Thu Jul 19 05:53:38 CEST 2007
I've successfully bootstrapped a CM3 compiler that supports LONGINT
as a 64-bit integer type (equivalent to "long long" in C) in addition
to INTEGER (same as "long" in C). This will be useful for
simplifying interfaces to C library routines that expect to be able
to treat 64-bit integers such as "off_t" for lseek, etc.
Currently, the compiler does not treat LONGINT as an ordinal type
(I'm not sure this would ever be a good idea) so it cannot be used to
index arrays, define enumerations etc., though the simple operations
ABS, MAX, MIN, addition, comparisons, MOD, multiplication,
subtraction, assignment, are all supported. This includes changes to
m3core (with support for Long.T similar to Word.T, plus RTTipe and
RTTypeMap, etc.) and libm3 for Pickle2, as well as to m3middle,
m3front, and the gcc-based compiler backend. There is still work
that needs to be done to support and test all the other M3 tools such
as network objects, etc., with support and testing needed in m3tk for
the new type, as well as in other tools like m3browser.
How best should I proceed to get this out to the community. I am
tempted to push it into the CVS head just so that it gets some
testing, but perhaps that is premature. I can confirm a complete
bootstrap via "do-cm3-std.sh" that appears to produce perfectly
functional executables, including mentor, etc.
More information about the M3devel
mailing list