[MLton-devel] porting to x86-64

Matthew Fluet fluet@CS.Cornell.EDU
Mon, 21 Oct 2002 15:53:49 -0400 (EDT)


> I definitely want 64-bit int/words for the X86, but doing them in ML (as
> opposed to the code generator directly) would be fine.  The only support that
> would be useful would be 32 * 32 -> 64, and maybe 64 / 32 -> 32 or something
> like that.

Really?  I would think that would be quite slow.  For a 64bit add, you'd
be replacing

add Xl,Yl
adc Xh,Yh
jo L

with

add Xl,Yl
jno NoCarry:
Carry:
inc Yh
jo L
NoCarry:
add Xh,Yh
jo L

On the other hand, it would be nicer to write the code for a 64bit
multiply in ML than in assembly.

It's going to be easier to push 64bit through the whole codegen than it
would be to push it through just a part.  We'd certainly need FFI support
for 64bit (for file positions, etc.).  A middle-of-the-road solution
(which is really nothing more than a couple of primitives) would be to
support:
MLton.Int64.highWord : int64 -> word32
MLton.Int64.lowWord : int64 -> word32
MLton.Int64.makeInt : word32 * word32 -> int64
which could initially be used to implement 64bit operations, and we could
migrate operations to assembly as needed.



-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future 
of  Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ad.doubleclick.net/clk;4699841;7576298;k?http://www.sun.com/javavote
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel