[project @ 2004-02-12 02:04:59 by mthomas]
[ghc-hetmet.git] / glafp-utils / nofib-analyse / Main.hs
index 40839f3..c073eab 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.6 2002/02/28 18:50:40 keithw Exp $
+-- $Id: Main.hs,v 1.8 2002/09/18 12:36:39 simonmar Exp $
 
 -- (c) Simon Marlow 1997-1999
 -----------------------------------------------------------------------------
@@ -99,6 +99,7 @@ per_prog_result_tab =
        , SpecP "Instructions" "instrs" instrs run_status always_ok
        , SpecP "Memory Reads" "mem-reads" mem_reads run_status always_ok
        , SpecP "Memory Writes" "mem-writes" mem_writes run_status always_ok
+       , SpecP "Cache Misses" "cache-misses" cache_misses run_status always_ok
        ]
 
 per_module_result_tab =
@@ -395,7 +396,7 @@ class Num a => Result a where
 
 instance Result Int where
        convert_to_percentage 0 size = 100
-       convert_to_percentage base size = (fromInt size / fromInt base) * 100
+       convert_to_percentage base size = (fromIntegral size / fromIntegral base) * 100
 
        result_to_string n = show (n `div` 1024) ++ "k"
 
@@ -489,7 +490,7 @@ calc_gmsd :: [BoxValue a] -> (BoxValue Float, BoxValue Float, BoxValue Float)
 calc_gmsd xs 
   | null percentages = (RunFailed NotDone, RunFailed NotDone, RunFailed NotDone)
   | otherwise        = let sqr x = x * x
-                           len   = fromInt (length percentages)
+                           len   = fromIntegral (length percentages)
                            logs  = map log percentages
                            lbar  = sum logs / len
                            devs  = map (sqr . (lbar-)) logs