Commit ddee463e authored by Moritz Angermann's avatar Moritz Angermann
Browse files

[Cmm Sized] Adjust

parent f9b1c92a
......@@ -39,7 +39,11 @@ source-repository head
location: git://github.com/kolmodin/binary.git
library
build-depends: base >= 4.5.0.0 && < 5, bytestring >= 0.10.4, containers, array
build-depends: base >= 4.5.0.0 && < 5,
ghc-prim >= 0.5.0 && <0.9,
bytestring >= 0.10.4,
containers,
array
hs-source-dirs: src
exposed-modules: Data.Binary,
Data.Binary.Put,
......@@ -181,7 +185,7 @@ benchmark generics-bench
unordered-containers,
zlib,
criterion
other-modules:
Cabal24
GenericsBenchCache
......
......@@ -231,14 +231,28 @@ import qualified Data.ByteString.Lazy.Internal as L
import Data.Binary.Get.Internal hiding ( Decoder(..), runGetIncremental )
import qualified Data.Binary.Get.Internal as I
-- needed for casting words to float/double
import Data.Binary.FloatCast (wordToFloat, wordToDouble)
#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
-- needed for (# unboxing #) with magic hash
import GHC.Base
import GHC.Base hiding (extendWord8#, extendWord16#, extendWord32#, narrowWord8#, narrowWord16#, narrowWord32#)
import GHC.Word
#if MIN_VERSION_ghc_prim(0,8,0)
import GHC.Base (extendWord8#, extendWord16#, extendWord32#)
import GHC.Base (narrowWord8#, narrowWord16#, narrowWord32#)
#else
import GHC.Prim (Word#)
extendWord8#, extendWord16#, extendWord32# :: Word# -> Word#
narrowWord8#, narrowWord16#, narrowWord32# :: Word# -> Word#
extendWord8# w = w
extendWord16# w = w
extendWord32# w = w
narrowWord8# w = w
narrowWord16# w = w
narrowWord32# w = w
#endif
#endif
-- needed for casting words to float/double
import Data.Binary.FloatCast (wordToFloat, wordToDouble)
-- $lazyinterface
-- The lazy interface consumes a single lazy 'L.ByteString'. It's the easiest
......@@ -660,8 +674,8 @@ shiftl_w32 :: Word32 -> Int -> Word32
shiftl_w64 :: Word64 -> Int -> Word64
#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
shiftl_w16 (W16# w) (I# i) = W16# (w `uncheckedShiftL#` i)
shiftl_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftL#` i)
shiftl_w16 (W16# w) (I# i) = W16# (narrowWord16# ((extendWord16# w) `uncheckedShiftL#` i))
shiftl_w32 (W32# w) (I# i) = W32# (narrowWord32# ((extendWord32# w) `uncheckedShiftL#` i))
#if WORD_SIZE_IN_BITS < 64
shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL64#` i)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment