X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcodeGen%2FBitmap.hs;h=2a8f72d2e50fb262481dd4d965f4c125a48f021d;hp=c0b490978cf6ec54e66ee88ce5e74b3716409b63;hb=17b297d97d327620ed6bfab942f8992b2446f1bf;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1 diff --git a/compiler/codeGen/Bitmap.hs b/compiler/codeGen/Bitmap.hs index c0b4909..2a8f72d 100644 --- a/compiler/codeGen/Bitmap.hs +++ b/compiler/codeGen/Bitmap.hs @@ -1,11 +1,18 @@ -- --- (c) The University of Glasgow 2003 +-- (c) The University of Glasgow 2003-2006 -- -- Functions for constructing bitmaps, which are used in various -- places in generated code (stack frame liveness masks, function -- argument liveness masks, SRT bitmaps). +{-# OPTIONS_GHC -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- for details + module Bitmap ( Bitmap, mkBitmap, intsToBitmap, intsToReverseBitmap, @@ -17,7 +24,8 @@ module Bitmap ( import SMRep import Constants -import DATA_BITS + +import Data.Bits {-| A bitmap represented by a sequence of 'StgWord's on the /target/ @@ -37,7 +45,7 @@ chunkToBitmap chunk = foldr (.|.) 0 [ 1 `shiftL` n | (True,n) <- zip chunk [0..] ] -- | Make a bitmap where the slots specified are the /ones/ in the bitmap. --- eg. @[1,2,4], size 4 ==> 0xb@. +-- eg. @[0,1,3], size 4 ==> 0xb@. -- -- The list of @Int@s /must/ be already sorted. intsToBitmap :: Int -> [Int] -> Bitmap @@ -50,7 +58,7 @@ intsToBitmap size slots{- must be sorted -} where (these,rest) = span ( 0x8@ (we leave any bits outside the size as zero, +-- eg. @[0,1,3], size 4 ==> 0x4@ (we leave any bits outside the size as zero, -- just to make the bitmap easier to read). -- -- The list of @Int@s /must/ be already sorted.