From: Simon Marlow Date: Thu, 23 Aug 2007 13:50:33 +0000 (+0000) Subject: FIX #1282: 64-bit unchecked shifts are not exported from base X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3ce77a0160b7269972b98d81e8db4936047c1df6;p=ghc-base.git FIX #1282: 64-bit unchecked shifts are not exported from base I've exported these functions from GHC.Exts. They are still implemented using the FFI underneath, though. To avoid conditional exports, on a 64-bit build: uncheckedShiftL64# = uncheckShiftL# (etc.) which has a different type than the 32-bit version of uncheckedShiftL64#, but at least GHC.Exts exports the same names. --- diff --git a/GHC/Exts.hs b/GHC/Exts.hs index be3fe53..f0c2321 100644 --- a/GHC/Exts.hs +++ b/GHC/Exts.hs @@ -21,6 +21,8 @@ module GHC.Exts -- * Primitive operations module GHC.Prim, shiftL#, shiftRL#, iShiftL#, iShiftRA#, iShiftRL#, + uncheckedShiftL64#, uncheckedShiftRL64#, + uncheckedIShiftL64#, uncheckedIShiftRA64#, -- * Fusion build, augment, @@ -41,6 +43,7 @@ import Prelude import GHC.Prim import GHC.Base import GHC.Word +import GHC.Int import GHC.Num import GHC.Float import GHC.Ptr diff --git a/GHC/Int.hs b/GHC/Int.hs index 2bb7d5c..3a264ef 100644 --- a/GHC/Int.hs +++ b/GHC/Int.hs @@ -17,8 +17,9 @@ -- #hide module GHC.Int ( - Int8(..), Int16(..), Int32(..), Int64(..)) - where + Int8(..), Int16(..), Int32(..), Int64(..), + uncheckedIShiftL64#, uncheckedIShiftRA64# + ) where import Data.Bits @@ -29,7 +30,7 @@ import GHC.Num import GHC.Real import GHC.Read import GHC.Arr -import GHC.Word +import GHC.Word hiding (uncheckedShiftL64#, uncheckedShiftRL64#) import GHC.Show ------------------------------------------------------------------------ @@ -820,6 +821,8 @@ instance Bits Int64 where "fromIntegral/Int64->a" fromIntegral = \(I64# x#) -> fromIntegral (I# x#) #-} +uncheckedIShiftL64# = uncheckedIShiftL# +uncheckedIShiftRA64# = uncheckedIShiftRA# #endif instance Real Int64 where diff --git a/GHC/Word.hs b/GHC/Word.hs index 0c9741d..492e332 100644 --- a/GHC/Word.hs +++ b/GHC/Word.hs @@ -19,8 +19,10 @@ -- #hide module GHC.Word ( Word(..), Word8(..), Word16(..), Word32(..), Word64(..), - toEnumError, fromEnumError, succError, predError) - where + toEnumError, fromEnumError, succError, predError, + uncheckedShiftL64#, + uncheckedShiftRL64# + ) where import Data.Bits @@ -868,6 +870,9 @@ instance Bits Word64 where "fromIntegral/Word64->a" fromIntegral = \(W64# x#) -> fromIntegral (W# x#) #-} +uncheckedShiftL64# = uncheckedShiftL# +uncheckedShiftRL64# = uncheckedShiftRL# + #endif instance Show Word64 where