#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):
It looks as if mix2 calls a C procedure to perform 64-bit operations on a
32-bit machine. On a 64-bit machine the code for both is pretty much
identical. Here is the relevant bit:
{{{
HashStr.$wmix1 :: GHC.Word.Word32
-> GHC.Prim.Word#
-> GHC.Word.Word32
-> (# GHC.Word.Word32, GHC.Word.Word32, GHC.Word.Word32
#)
[GlobalId]
[Arity 3
NoCafRefs
Str: DmdType S(L)LL]
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 #)
}
HashStr.$wmix2 :: GHC.Word.Word64
-> GHC.Prim.Word#
-> GHC.Word.Word64
-> (# GHC.Word.Word64, GHC.Word.Word64, GHC.Word.Word64
#)
[GlobalId]
[Arity 3
NoCafRefs
Str: DmdType S(L)LL]
HashStr.$wmix2 =
\ (ww_soU :: GHC.Word.Word64)
(ww1_soX :: GHC.Prim.Word#)
(ww2_soZ :: GHC.Word.Word64) ->
case ww_soU of wild_ane { GHC.Word.W64# x#_ang ->
(# wild_ane,
GHC.Word.W64#
(GHC.Prim.xor#
(GHC.Prim.xor# ww1_soX (GHC.Prim.uncheckedShiftL# x#_ang 9))
(GHC.Prim.uncheckedShiftL# x#_ang 9)),
ww2_soZ #)
}
}}}
Perhaps someone would like to improve code generation for 64-bit ops on
32-bit machines?
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