[Haskell] Performance, Optimization and Code Generation

Bulat Ziganshin bulat.ziganshin at gmail.com
Sat Sep 23 13:16:44 EDT 2006


Hello roconnor,

Saturday, September 23, 2006, 4:13:39 PM, you wrote:

> Also, shouldn't the calls to shiftL32# and shiftRL32# be calls to
> uncheckedShiftL32# and uncheckedShiftR32# since i'# and (32# -# i'#) are
> provably safe?

yes. below is the code used in my lib:

#ifdef __GLASGOW_HASKELL__

(I# a) <<# (I# b) = (I# (a `iShiftL#` b))
(I# a) >># (I# b) = (I# (a `uncheckedIShiftRL#` b))

#else /* ! __GLASGOW_HASKELL__ */

a <<# b = a `shiftL` b
a >># b = a `shiftR` b

#endif /* ! __GLASGOW_HASKELL__ */




-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell mailing list