strange real timings partly explained

Stephen Weeks MLton@sourcelight.com
Wed, 20 Jun 2001 09:51:49 -0700


> Yikes:  Real64.real objects are not aligned mod 8.  This is bad.  It costs us
> CPU time, and also makes lots of test relatively unreproducible  since  where
> you end up mod 8 can make a big difference.
> 
> This  explained  some of the strange timings I was getting in testing mods to
> the heapsort program.

Yeah, I remember seeing up to a factor of two on barnes-hut before just due to
whether the stack pointer started out zero mod 8 or not.

> I'm guessing that this is true in both the heap and the stack.  

Yep.

> I know
> that in the stack real elements are aligned mod 8 relative to the stack
> top,

This is how I read allocate-registers as well.

> but there is nothing that ensures that stack frames have sizes that
> are aligned mod 8.  This would be easy enough to change, I think.

True and sort of true.  To force the sizes to be aligned mod 8 is easy.  To
force the bottom of the stack to be aligned mod 8 requires some mucking in the
GC, since, after all, stacks are allocated in the heap and can get moved
around.  It's on the todo list, but after this release.

Also Matthew, are double pseudo-regs aligned mod8?  That seems easy to do.