Portability | GHC |
---|---|
Stability | experimental |
Maintainer | bos@serpentine.com, rtomharper@googlemail.com, duncan@haskell.org |
Safe Haskell | Safe-Infered |
Data.Text.UnsafeShift
Description
Fast, unchecked bit shifting functions.
- class UnsafeShift a where
Documentation
class UnsafeShift a whereSource
This is a workaround for poor optimisation in GHC 6.8.2. It fails to notice constant-width shifts, and adds a test and branch to every shift. This imposes about a 10% performance hit.
These functions are undefined when the amount being shifted by is greater than the size in bits of a machine Int#.