OSDN Git Service

2001-12-09 Daniel Berlin <dan@cgsoftware.com>
[pf3gnuchains/gcc-fork.git] / contrib / analyze_brprob
index 3c7e8e5..3650e60 100755 (executable)
@@ -112,13 +112,11 @@ BEGIN {nnames = 0}
 
     if (int(pred) < 50.0)
       {
-        hit = count - hit;
+        hit = count"-"hit;
       }
     counts[name]=counts[name] "+" count
     hits[name]=hits[name] "+" hit
-    if (float (hit) < (float (count) / 2))
-      hit = "("count" - "hit")";
-    phits[name]=phits[name] "+" hit
+    phits[name]=phits[name] "+(("hit")<"count"/2)*("count"-("hit"))+(("hit")>="count"/2)*("hit")"
 
     #BC crashes on long strings.  Irritating.
     if (length(counts[name]) > 2000)
@@ -130,9 +128,9 @@ BEGIN {nnames = 0}
   }
 END {
   # Heuristics called combined predicts just everything.
-  maxcounts = longeval(counts["first match"])
-  maxbranches = branches["first match"]
-  max = names["first match"]
+  maxcounts = longeval(counts["combined"])
+  maxbranches = branches["combined"]
+  max = names["combined"]
   printf("HEURISTICS                  BRANCHES  (REL)  HITRATE             COVERAGE  (REL)\n")
   for (i = 0; i < nnames ; i++)
    {