[MLton-devel] cvs commit: int64 support in x86-codegen

Matthew Fluet fluet@cs.cornell.edu
Thu, 31 Jul 2003 19:23:36 -0400 (EDT)


One other thing I meant to mention:
In order to translate a 64bit integer constant into x86 operand, I need to
extract the lo and hi order bits.  The simplest is the following:
       fun convert1 (ii: IntInf.t): Word.t * Word.t =
	  let
	     val lo = Word.fromIntInf ii
	     val ii = IntInf.~>> (ii, 0w32)
	     val hi = Word.fromIntInf ii
	  in
	     (lo, hi)
	  end
Unfortunately, this doesn't work for a SML/NJ compiles version of MLton,
because it tries to bounce through Int32.int for the conversion.
So, there is a second convert function in x86-translate.fun that
accomplishes the same thing by first constructing the hex string
representing the 64bit word corresponding to the integer, extracting the
lo and hi components of the string, and converting from the string to the
word.  It's currently commented out, but if anyone needs to use the the
SML/NJ compiled version of MLton (which I often do for debugging), then
switch to convert2.



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel