projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Separate NondecreasingIndentation out into its own extension
[ghc-hetmet.git]
/
compiler
/
codeGen
/
Bitmap.hs
diff --git
a/compiler/codeGen/Bitmap.hs
b/compiler/codeGen/Bitmap.hs
index
c0b4909
..
acd398c
100644
(file)
--- a/
compiler/codeGen/Bitmap.hs
+++ b/
compiler/codeGen/Bitmap.hs
@@
-1,5
+1,5
@@
--
--
--- (c) The University of Glasgow 2003
+-- (c) The University of Glasgow 2003-2006
--
-- Functions for constructing bitmaps, which are used in various
--
-- Functions for constructing bitmaps, which are used in various
@@
-9,7
+9,8
@@
module Bitmap (
Bitmap, mkBitmap,
intsToBitmap, intsToReverseBitmap,
module Bitmap (
Bitmap, mkBitmap,
intsToBitmap, intsToReverseBitmap,
- mAX_SMALL_BITMAP_SIZE
+ mAX_SMALL_BITMAP_SIZE,
+ seqBitmap,
) where
#include "HsVersions.h"
) where
#include "HsVersions.h"
@@
-17,7
+18,9
@@
module Bitmap (
import SMRep
import Constants
import SMRep
import Constants
-import DATA_BITS
+import Util
+
+import Data.Bits
{-|
A bitmap represented by a sequence of 'StgWord's on the /target/
{-|
A bitmap represented by a sequence of 'StgWord's on the /target/
@@
-37,7
+40,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.
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
--
-- The list of @Int@s /must/ be already sorted.
intsToBitmap :: Int -> [Int] -> Bitmap
@@
-50,7
+53,7
@@
intsToBitmap size slots{- must be sorted -}
where (these,rest) = span (<wORD_SIZE_IN_BITS) slots
-- | Make a bitmap where the slots specified are the /zeros/ in the bitmap.
where (these,rest) = span (<wORD_SIZE_IN_BITS) slots
-- | Make a bitmap where the slots specified are the /zeros/ in the bitmap.
--- eg. @[1,2,4], size 4 ==> 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.
-- just to make the bitmap easier to read).
--
-- The list of @Int@s /must/ be already sorted.
@@
-77,3
+80,6
@@
mAX_SMALL_BITMAP_SIZE :: Int
mAX_SMALL_BITMAP_SIZE | wORD_SIZE == 4 = 27
| otherwise = 58
mAX_SMALL_BITMAP_SIZE | wORD_SIZE == 4 = 27
| otherwise = 58
+seqBitmap :: Bitmap -> a -> a
+seqBitmap = seqList
+