X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FabsCSyn%2FCosts.lhs;h=b6d955c1578eaf74b5b7ca8e2bcb4ff7d903e2b4;hb=a5f7799965947977599a777dae10f103f9b9fd1a;hp=3588fe5018997bb8c167722138652d2755f060c2;hpb=36c2d7c8e9da3b2e278d508ac25c7d53522f85f3;p=ghc-hetmet.git diff --git a/ghc/compiler/absCSyn/Costs.lhs b/ghc/compiler/absCSyn/Costs.lhs index 3588fe5..b6d955c 100644 --- a/ghc/compiler/absCSyn/Costs.lhs +++ b/ghc/compiler/absCSyn/Costs.lhs @@ -117,7 +117,7 @@ costs absC = CAssign (CReg _) (CTemp _ _) -> Cost (1,0,0,0,0) - CAssign (CReg _) (CAddr _) -> Cost (1,0,0,0,0) -- typ.: add %reg1,,%reg2 + CAssign (CReg _) source_m -> addrModeCosts source_m Rhs CAssign target_m source_m -> addrModeCosts target_m Lhs + addrModeCosts source_m Rhs @@ -242,16 +242,9 @@ addrModeCosts addr_mode side = CVal _ _ -> if lhs then Cost (0, 0, 0, 1, 0) else Cost (0, 0, 1, 0, 0) - CAddr _ -> if lhs then Cost (0, 0, 0, 1, 0) -- ??unchecked - else Cost (0, 0, 1, 0, 0) - CReg _ -> nullCosts {- loading from, storing to reg is free ! -} {- for costing CReg->Creg ops see special -} {- case in costs fct -} - CTableEntry base_mode offset_mode kind -> - addrModeCosts base_mode side + - addrModeCosts offset_mode side + - Cost (1,0,1,0,0) CTemp _ _ -> nullCosts {- if lhs then Cost (0, 0, 0, 1, 0) else Cost (0, 0, 1, 0, 0) -} @@ -272,9 +265,6 @@ addrModeCosts addr_mode side = CIntLike mode -> if lhs then Cost (0, 0, 0, 1, 0) else Cost (0, 0, 1, 0, 0) - CString _ -> if lhs then Cost (0, 0, 0, 1, 0) - else Cost (0, 0, 1, 0, 0) - CLit _ -> if lhs then nullCosts -- should never occur else Cost (1, 0, 0, 0, 0) -- typ.: mov lit,%reg @@ -326,7 +316,7 @@ stmtMacroCosts macro modes = GRAN_FETCH_AND_RESCHEDULE -> nullCosts {- GrAnSim bookkeeping -} GRAN_YIELD -> nullCosts {- GrAnSim bookkeeping -- added SOF -} THREAD_CONTEXT_SWITCH -> nullCosts {- GrAnSim bookkeeping -} - _ -> trace ("Costs.stmtMacroCosts: "++show macro) nullCosts + _ -> trace ("Costs.stmtMacroCosts") nullCosts -- ---------------------------------------------------------------------------