projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updates to follow the RTS tidyup
[ghc-base.git]
/
Data
/
Bits.hs
diff --git
a/Data/Bits.hs
b/Data/Bits.hs
index
46f009a
..
9b31397
100644
(file)
--- a/
Data/Bits.hs
+++ b/
Data/Bits.hs
@@
-48,7
+48,6
@@
module Data.Bits (
#ifdef __GLASGOW_HASKELL__
import GHC.Num
#ifdef __GLASGOW_HASKELL__
import GHC.Num
-import GHC.Real
import GHC.Base
#endif
import GHC.Base
#endif
@@
-292,8
+291,8
@@
instance Bits Integer where
complement a = -1 - a
#endif
complement a = -1 - a
#endif
- shift x i | i >= 0 = x * 2^i
- | otherwise = x `div` 2^(-i)
+ shift x i@(I# i#) | i >= 0 = shiftLInteger x i#
+ | otherwise = shiftRInteger x (negateInt# i#)
rotate x i = shift x i -- since an Integer never wraps around
rotate x i = shift x i -- since an Integer never wraps around