[MLton] 64-bit pointers

Wesley W. Terpstra wesley@terpstra.ca
Mon, 5 Sep 2005 04:26:39 +0200


On Sep 5, 2005, at 4:02 AM, skaller wrote:
> On Sun, 2005-09-04 at 21:25 -0400, Matthew Fluet wrote:
>>> BTW, I've drifted over to the belief that simple 64bit
>>> pointers are best. Since amd64 is backwards compatible,
>>> there's no real problem for applications needing << 4GB.
>>> Just compile your program for i386 instead of amd64.
>
> Why use MLton to generate optimised code for a machine
> running in a mode 5 times slower than it could?

Err... 32bit apps and 64bit apps have pretty similar performance.
After all, there are the same number of math units, cache, branch-
prediction, ... in the chip. Modern x86 processors are all using
internal RISC-like operations, so the 32/64 bit stuff all gets
decoded into this anyways. What it comes down to addressing,
bigger precision, or rare instructions.

So, unless there is a particular instruction that you don't get without
using 64bit extensions (generally IMUL for 64bit), there's not that
much of a boost using amd64 over i386. Besides, i386 has SSE2/3
which is 128bit. What are we futzing around with 64bits for? :-)

All I am objecting to is the blanket 5* speed-up claim.
I highly doubt mlton programs will be much faster in 64bit mode.
Real speed-up in MLton could come from automatic vectorization.

I too, know many straw-man 64bit micro-benchmarks...