projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git]
/
ghc
/
compiler
/
absCSyn
/
Costs.lhs
diff --git
a/ghc/compiler/absCSyn/Costs.lhs
b/ghc/compiler/absCSyn/Costs.lhs
index
c32b010
..
0ce8907
100644
(file)
--- a/
ghc/compiler/absCSyn/Costs.lhs
+++ b/
ghc/compiler/absCSyn/Costs.lhs
@@
-44,8
+44,6
@@
These are first suggestions for scaling the costs. But, this scaling should be d
\end{pseudocode}
\begin{code}
\end{pseudocode}
\begin{code}
-#include "HsVersions.h"
-
#define ACCUM_COSTS(i,b,l,s,f) (i+b+l+s+f)
#define NUM_REGS 10 {- PprAbsCSyn.lhs -} {- runtime/c-as-asm/CallWrap_C.lc -}
#define ACCUM_COSTS(i,b,l,s,f) (i+b+l+s+f)
#define NUM_REGS 10 {- PprAbsCSyn.lhs -} {- runtime/c-as-asm/CallWrap_C.lc -}
@@
-57,13
+55,14
@@
module Costs( costs,
addrModeCosts, CostRes(Cost), nullCosts, Side(..)
) where
addrModeCosts, CostRes(Cost), nullCosts, Side(..)
) where
-IMP_Ubiq(){-uitous-}
+#include "HsVersions.h"
import AbsCSyn
import PrimOp ( primOpNeedsWrapper, PrimOp(..) )
import AbsCSyn
import PrimOp ( primOpNeedsWrapper, PrimOp(..) )
+import Util ( trace )
-- --------------------------------------------------------------------------
-- --------------------------------------------------------------------------
-data CostRes = Cost (Int, Int, Int, Int, Int)
+newtype CostRes = Cost (Int, Int, Int, Int, Int)
deriving (Text)
nullCosts = Cost (0, 0, 0, 0, 0) :: CostRes
deriving (Text)
nullCosts = Cost (0, 0, 0, 0, 0) :: CostRes
@@
-367,7
+366,9
@@
stmtMacroCosts macro modes =
GRAN_FETCH -> nullCosts {- GrAnSim bookkeeping -}
GRAN_RESCHEDULE -> nullCosts {- GrAnSim bookkeeping -}
GRAN_FETCH_AND_RESCHEDULE -> nullCosts {- GrAnSim bookkeeping -}
GRAN_FETCH -> nullCosts {- GrAnSim bookkeeping -}
GRAN_RESCHEDULE -> nullCosts {- GrAnSim bookkeeping -}
GRAN_FETCH_AND_RESCHEDULE -> nullCosts {- GrAnSim bookkeeping -}
+ GRAN_YIELD -> nullCosts {- GrAnSim bookkeeping -- added SOF -}
THREAD_CONTEXT_SWITCH -> nullCosts {- GrAnSim bookkeeping -}
THREAD_CONTEXT_SWITCH -> nullCosts {- GrAnSim bookkeeping -}
+ _ -> trace ("Costs.stmtMacroCosts: "++show macro) nullCosts
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
@@
-415,7
+416,7
@@
primOpCosts :: PrimOp -> CostRes
-- Special cases
-- Special cases
-primOpCosts (CCallOp _ _ _ _ _) = SAVE_COSTS + RESTORE_COSTS
+primOpCosts (CCallOp _ _ _ _ _ _) = SAVE_COSTS + RESTORE_COSTS
-- don't guess costs of ccall proper
-- for exact costing use a GRAN_EXEC
-- in the C code
-- don't guess costs of ccall proper
-- for exact costing use a GRAN_EXEC
-- in the C code
@@
-516,7
+517,7
@@
data PrimOp
-- Rest is unchecked so far -- HWL
-- Word#-related ops:
-- Rest is unchecked so far -- HWL
-- Word#-related ops:
- | AndOp | OrOp | NotOp | ShiftLOp | ShiftROp
+ | AndOp | OrOp | NotOp | XorOp | ShiftLOp | ShiftROp
| Int2WordOp | Word2IntOp -- casts
-- Addr#-related ops:
| Int2WordOp | Word2IntOp -- casts
-- Addr#-related ops: