Patch for Word64
Bulat Ziganshin
bulatz at HotPOP.com
Thu Nov 24 06:06:54 EST 2005
Hello Matt,
Thursday, November 24, 2005, 7:52:23 AM, you wrote:
>>> int64ToWord64# = unsafeCoerce#
>>> word64ToInt64# = unsafeCoerce#
M> (W32# x#) + (W32# y#) = W32# (narrow32Word# (x# `plusWord#` y#))
M> (W64# x#) + (W64# y#) = W64# (int64ToWord64# (word64ToInt64# x#
M> `plusInt64#` word64ToInt64# y#))
M> The definitions are those used on a 32-bit architecture. So, when it is
M> cheap the plusWord# function is used, but when it is "relatively expensive"
M> then extra conversions are added. Wouldn't it make sense to avoid the
M> conversions in all cases, regardless of whether they are free or not?
i'm agree that code simplification you already done is anyway Right
Thing. so it's better to apply your patch AND add abovementioned
definitions to help any other operations. about int32ToWord32# and so
on - they are defined through stg primitives, so anyway defining them
as unsafeCoerce# must make things a little faster
--
Best regards,
Bulat mailto:bulatz at HotPOP.com
More information about the Glasgow-haskell-users
mailing list