[MLton] different word sizes

Matthew Fluet fluet@cs.cornell.edu
Fri, 23 Apr 2004 19:07:13 -0400 (EDT)


> One thing I was wondering as I was implementing this packing stuff was
> if we were really gaining anything by having the codegen support Word8
> and Word16 and the associated primitives.  That is, what if I were
> just to represent those as Word32?  It would save various headaches in
> the code that have to make sure and introduce the coercions between
> sizes.  Plus, eliminating the coercsions would actually eliminate some
> code and some runtime.  Is there a downside I'm missing?

Like Henry, I'm not quite sure what exactly you are proposing.
Certainly one downside of dropping Word8 and Word16 would be loss of
some FFI stuff.  (Although, even that isn't that bad...  the calling
conventions for 8 and 16 bit operations (on x86) are promoted to 32 bit
when put on the stack.)