update submodules for GHC.HetMet.GArrow -> Control.GArrow renaming
[ghc-hetmet.git] / includes / HaskellConstants.hs
index 666728c..51cdcaf 100644 (file)
@@ -1,5 +1,7 @@
 
 import Data.Bits (shiftL)
+import Data.Word
+import Data.Int
 
 -- This magical #include brings in all the everybody-knows-these magic
 -- constants unfortunately, we need to be *explicit* about which one
@@ -60,6 +62,9 @@ mIN_CHARLIKE, mAX_CHARLIKE :: Int
 mIN_CHARLIKE = MIN_CHARLIKE
 mAX_CHARLIKE = MAX_CHARLIKE
 
+mUT_ARR_PTRS_CARD_BITS :: Int
+mUT_ARR_PTRS_CARD_BITS = MUT_ARR_PTRS_CARD_BITS
+
 -- A section of code-generator-related MAGIC CONSTANTS.
 
 mAX_Vanilla_REG :: Int
@@ -135,6 +140,26 @@ wORD_SIZE = SIZEOF_HSWORD
 wORD_SIZE_IN_BITS :: Int
 wORD_SIZE_IN_BITS = wORD_SIZE * 8
 
+-- Define a fixed-range integral type equivalent to the target Int/Word
+
+#if SIZEOF_HSWORD == 4
+type TargetInt  = Int32
+type TargetWord = Word32
+#elif SIZEOF_HSWORD == 8
+type TargetInt  = Int64
+type TargetWord = Word64
+#else
+#error unknown SIZEOF_HSWORD
+#endif
+
+tARGET_MIN_INT, tARGET_MAX_INT, tARGET_MAX_WORD :: Integer
+tARGET_MIN_INT  = fromIntegral (minBound :: TargetInt)
+tARGET_MAX_INT  = fromIntegral (maxBound :: TargetInt)
+tARGET_MAX_WORD = fromIntegral (maxBound :: TargetWord)
+
+tARGET_MAX_CHAR :: Int
+tARGET_MAX_CHAR = 0x10ffff
+
 -- Amount of pointer bits used for semi-tagging constructor closures
 
 tAG_BITS :: Int
@@ -158,6 +183,11 @@ bLOCK_SIZE = BLOCK_SIZE
 bLOCK_SIZE_W :: Int
 bLOCK_SIZE_W = bLOCK_SIZE `quot` wORD_SIZE
 
+-- blocks that fit in an MBlock, leaving space for the block descriptors
+
+bLOCKS_PER_MBLOCK :: Int
+bLOCKS_PER_MBLOCK = BLOCKS_PER_MBLOCK
+
 -- Number of bits to shift a bitfield left by in an info table.
 
 bITMAP_BITS_SHIFT :: Int