#1433: Difference in strictness/unpackability between Word64 and Word32 (on a 32
bit machine)
-------------------------+--------------------------------------------------
    Reporter:  sorear    |        Owner:         
        Type:  bug       |       Status:  new    
    Priority:  normal    |    Milestone:         
   Component:  Compiler  |      Version:  6.7    
    Severity:  normal    |   Resolution:         
    Keywords:            |   Difficulty:  Unknown
          Os:  Linux     |     Testcase:         
Architecture:  x86       |  
-------------------------+--------------------------------------------------
Comment (by simonpj):

 You don't say what "it" is, but I think I see what you mean.  Here's the
 code for `wmix1`:
 {{{
 HashStr.$wmix1 =
   \ (ww_sp7 :: GHC.Word.Word32)
     (ww1_spa :: GHC.Prim.Word#)
     (ww2_spc :: GHC.Word.Word32) ->
     case ww_sp7 of wild_anX { GHC.Word.W32# x#_anZ ->
     (# wild_anX,
        GHC.Word.W32#
          (GHC.Prim.xor#
             (GHC.Prim.xor#
                ww1_spa (GHC.Prim.narrow32Word#
                     (GHC.Prim.uncheckedShiftL# x#_anZ 9)))
             (GHC.Prim.narrow32Word# (GHC.Prim.uncheckedShiftL# x#_anZ
 9))),
        ww2_spc #)
     }
 }}}
 I think your question is: why isn't the first argument, `ww_sp7`, passed
 unboxed? The answer is that this argument is '''returned''' as part of the
 result (see `wild_anX`).  So if the first arg was passed unboxed, the
 worker would have to re-box it in order to return it.  GHC tries not to do
 that.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1433>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to