summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/codeGen/CgParallel.hs51
1 files changed, 22 insertions, 29 deletions
diff --git a/compiler/codeGen/CgParallel.hs b/compiler/codeGen/CgParallel.hs
index 2804104708..30771f14de 100644
--- a/compiler/codeGen/CgParallel.hs
+++ b/compiler/codeGen/CgParallel.hs
@@ -3,22 +3,15 @@
-- (c) The University of Glasgow -2006
--
-- Code generation relaed to GpH
--- (a) parallel
--- (b) GranSim
+-- (a) parallel
+-- (b) GranSim
--
-----------------------------------------------------------------------------
-{-# OPTIONS -fno-warn-tabs #-}
--- The above warning supression flag is a temporary kludge.
--- While working on this module you are encouraged to remove it and
--- detab the module (please do the detabbing in a separate patch). See
--- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
--- for details
-
module CgParallel(
- staticGranHdr,staticParHdr,
- granFetchAndReschedule, granYield,
- doGranAllocate
+ staticGranHdr,staticParHdr,
+ granFetchAndReschedule, granYield,
+ doGranAllocate
) where
import CgMonad
@@ -34,25 +27,25 @@ staticParHdr :: [CmmLit]
staticParHdr = []
--------------------------------------------------------
--- GranSim stuff
+-- GranSim stuff
--------------------------------------------------------
staticGranHdr :: [CmmLit]
-- Gransim header words in a static closure
staticGranHdr = []
-doGranAllocate :: CmmExpr -> Code
+doGranAllocate :: CmmExpr -> Code
-- macro DO_GRAN_ALLOCATE
doGranAllocate _hp
| not opt_GranMacros = nopC
- | otherwise = panic "doGranAllocate"
+ | otherwise = panic "doGranAllocate"
-------------------------
granFetchAndReschedule :: [(Id,GlobalReg)] -- Live registers
- -> Bool -- Node reqd?
- -> Code
+ -> Bool -- Node reqd?
+ -> Code
-- Emit code for simulating a fetch and then reschedule.
granFetchAndReschedule regs node_reqd
| opt_GranMacros && (node `elem` map snd regs || node_reqd)
@@ -65,16 +58,16 @@ granFetchAndReschedule regs node_reqd
fetch :: FCode ()
fetch = panic "granFetch"
- -- Was: absC (CMacroStmt GRAN_FETCH [])
- --HWL: generate GRAN_FETCH macro for GrAnSim
- -- currently GRAN_FETCH and GRAN_FETCH_AND_RESCHEDULE are miai
+ -- Was: absC (CMacroStmt GRAN_FETCH [])
+ --HWL: generate GRAN_FETCH macro for GrAnSim
+ -- currently GRAN_FETCH and GRAN_FETCH_AND_RESCHEDULE are miai
reschedule :: StgWord -> Bool -> Code
reschedule _liveness _node_reqd = panic "granReschedule"
- -- Was: absC (CMacroStmt GRAN_RESCHEDULE [
- -- mkIntCLit (I# (word2Int# liveness_mask)),
- -- mkIntCLit (if node_reqd then 1 else 0)])
-
+ -- Was: absC (CMacroStmt GRAN_RESCHEDULE [
+ -- mkIntCLit (I# (word2Int# liveness_mask)),
+ -- mkIntCLit (if node_reqd then 1 else 0)])
+
-------------------------
-- The @GRAN_YIELD@ macro is taken from JSM's code for Concurrent Haskell. It
@@ -82,26 +75,26 @@ reschedule _liveness _node_reqd = panic "granReschedule"
-- @Continue@ rather than the @EnterNodeCode@ function in the RTS). We emit
-- this kind of macro at the beginning of the following kinds of basic bocks:
-- \begin{itemize}
--- \item Slow entry code where node is not alive (see @CgClosure.lhs@). Normally
+-- \item Slow entry code where node is not alive (see @CgClosure.lhs@). Normally
-- we use @fetchAndReschedule@ at a slow entry code.
-- \item Fast entry code (see @CgClosure.lhs@).
-- \item Alternatives in case expressions (@CLabelledCode@ structures), provided
--- that they are not inlined (see @CgCases.lhs@). These alternatives will
+-- that they are not inlined (see @CgCases.lhs@). These alternatives will
-- be turned into separate functions.
granYield :: [(Id,GlobalReg)] -- Live registers
-> Bool -- Node reqd?
- -> Code
+ -> Code
granYield regs node_reqd
| opt_GranMacros && node_reqd = yield liveness
- | otherwise = nopC
+ | otherwise = nopC
where
liveness = mkRegLiveness regs 0 0
yield :: StgWord -> Code
yield _liveness = panic "granYield"
- -- Was : absC (CMacroStmt GRAN_YIELD
+ -- Was : absC (CMacroStmt GRAN_YIELD
-- [mkIntCLit (I# (word2Int# liveness_mask))])