GHC FFI Return Type Bug

Alastair David Reid reid@cs.utah.edu
10 Sep 2001 13:20:33 -0600


> Thanks.  I think the decision here is to do the safe thing and mask
> the return results ourselves, since it's only one extra insn.  This
> won't make it into 5.02, tho.

So GHC's Int/Word implementation is different from Hugs'?  Hugs
represents Word8 (say) by a 32 bit int but doesn't guarantee that the
top 24 bits are all zero.  Instead we either use an 8-bit operation
when we operate on a word8 or we mask the arguments and use the 32-bit
operation (for *, /, ==, etc.) or we don't mask and use the 32-bit
operation (works for and, or, +, and some of the shifts)

-- 
Alastair Reid        reid@cs.utah.edu        http://www.cs.utah.edu/~reid/