FIX #1282: 64-bit unchecked shifts are not exported from base
authorSimon Marlow <simonmar@microsoft.com>
Thu, 23 Aug 2007 13:50:33 +0000 (13:50 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 23 Aug 2007 13:50:33 +0000 (13:50 +0000)
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.

GHC/Exts.hs
GHC/Int.hs
GHC/Word.hs

index be3fe53..f0c2321 100644 (file)
@@ -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
index 2bb7d5c..3a264ef 100644 (file)
@@ -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
index 0c9741d..492e332 100644 (file)
 -- #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