#5414: Add unsafeShift to Data.Bits
---------------------------------+------------------------------------------
Reporter: tibbe | Owner: simonmar
Type: feature request | Status: new
Priority: normal | Component: libraries/base
Version: 7.2.1 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
`shiftL` and `shiftR` introduce an extra branch to check for overflows
(i.e. shifts with an amount larger than 32/64). This branch gets removed
if the shift amount is statically known, but otherwise leaves a branch in
the optimized code, slowing down bit manipulation code.
`unsafeShiftL` and `unsafeShiftR` translate directly to the underlying
hardware operation (which is undefined for shift amount larger than the
architectures word size).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5414>
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