Update source-repository in the .cabal file to point to the git repo
[ghc-prim.git] / GHC / IntWord32.hs
1 {-# OPTIONS_GHC -XNoImplicitPrelude #-}
2 {-# OPTIONS_HADDOCK hide #-}
3 -----------------------------------------------------------------------------
4 -- |
5 -- Module      :  GHC.IntWord32
6 -- Copyright   :  (c) The University of Glasgow, 1997-2008
7 -- License     :  see libraries/ghc-prim/LICENSE
8 --
9 -- Maintainer  :  cvs-ghc@haskell.org
10 -- Stability   :  internal
11 -- Portability :  non-portable (GHC Extensions)
12 --
13 -- Primitive operations on Int32# and Word32# on platforms where
14 -- WORD_SIZE_IN_BITS < 32.
15 --
16 -----------------------------------------------------------------------------
17
18 #include "MachDeps.h"
19
20 -- #hide
21 module GHC.IntWord32 (
22 #if WORD_SIZE_IN_BITS < 32
23     Int32#, Word32#, module GHC.IntWord32
24 #endif
25  ) where
26
27 #if WORD_SIZE_IN_BITS < 32
28 import GHC.Prim
29 import GHC.Types
30
31 foreign import unsafe "stg_eqWord32"      eqWord32#      :: Word32# -> Word32# -> Bool
32 foreign import unsafe "stg_neWord32"      neWord32#      :: Word32# -> Word32# -> Bool
33 foreign import unsafe "stg_ltWord32"      ltWord32#      :: Word32# -> Word32# -> Bool
34 foreign import unsafe "stg_leWord32"      leWord32#      :: Word32# -> Word32# -> Bool
35 foreign import unsafe "stg_gtWord32"      gtWord32#      :: Word32# -> Word32# -> Bool
36 foreign import unsafe "stg_geWord32"      geWord32#      :: Word32# -> Word32# -> Bool
37
38 foreign import unsafe "stg_eqInt32"       eqInt32#       :: Int32# -> Int32# -> Bool
39 foreign import unsafe "stg_neInt32"       neInt32#       :: Int32# -> Int32# -> Bool
40 foreign import unsafe "stg_ltInt32"       ltInt32#       :: Int32# -> Int32# -> Bool
41 foreign import unsafe "stg_leInt32"       leInt32#       :: Int32# -> Int32# -> Bool
42 foreign import unsafe "stg_gtInt32"       gtInt32#       :: Int32# -> Int32# -> Bool
43 foreign import unsafe "stg_geInt32"       geInt32#       :: Int32# -> Int32# -> Bool
44
45 foreign import unsafe "stg_int32ToWord32" int32ToWord32# :: Int32# -> Word32#
46 foreign import unsafe "stg_word32ToInt32" word32ToInt32# :: Word32# -> Int32#
47 foreign import unsafe "stg_intToInt32"    intToInt32#    :: Int# -> Int32#
48 foreign import unsafe "stg_wordToWord32"  wordToWord32#  :: Word# -> Word32#
49 foreign import unsafe "stg_word32ToWord"  word32ToWord#  :: Word32# -> Word#
50
51 foreign import unsafe "stg_plusInt32"     plusInt32#     :: Int32# -> Int32# -> Int32#
52 foreign import unsafe "stg_minusInt32"    minusInt32#    :: Int32# -> Int32# -> Int32#
53 foreign import unsafe "stg_timesInt32"    timesInt32#    :: Int32# -> Int32# -> Int32#
54 foreign import unsafe "stg_negateInt32"   negateInt32#   :: Int32# -> Int32#
55 foreign import unsafe "stg_quotInt32"     quotInt32#     :: Int32# -> Int32# -> Int32#
56 foreign import unsafe "stg_remInt32"      remInt32#      :: Int32# -> Int32# -> Int32#
57 foreign import unsafe "stg_quotWord32"    quotWord32#    :: Word32# -> Word32# -> Word32#
58 foreign import unsafe "stg_remWord32"     remWord32#     :: Word32# -> Word32# -> Word32#
59
60 foreign import unsafe "stg_and32"         and32#         :: Word32# -> Word32# -> Word32#
61 foreign import unsafe "stg_or32"          or32#          :: Word32# -> Word32# -> Word32#
62 foreign import unsafe "stg_xor32"         xor32#         :: Word32# -> Word32# -> Word32#
63 foreign import unsafe "stg_not32"         not32#         :: Word32# -> Word32#
64
65 foreign import unsafe "stg_iShiftL32"     iShiftL32#     :: Int32# -> Int# -> Int32#
66 foreign import unsafe "stg_iShiftRA32"    iShiftRA32#    :: Int32# -> Int# -> Int32#
67 foreign import unsafe "stg_shiftL32"      shiftL32#      :: Word32# -> Int# -> Word32#
68 foreign import unsafe "stg_shiftRL32"     shiftRL32#     :: Word32# -> Int# -> Word32#
69
70 #endif
71