Root/m1/perf/eval.pl

Source at commit c02c02903d5c91d5bd7a1a7faf982b4ae60afec2 created 8 years 1 month ago.
By Werner Almesberger, m1/perf/: a bunch of bug fixes all over the place
1#!/usr/bin/perl
2
3while (<>) {
4    last if /per-vertex PFPU fragment/;
5}
6
7$i = 0;
8while (<>) {
9    next unless
10        /^(\d+):\s+(\S+)\s+(R\d+)?(,(R\d+))?.*?(->\s+(R\d+))?\s*$/;
11    # 1 2 3 4 5 6 7
12    ($c, $op, $a, $b, $d) = ($1, $2, $3, $5, $7);
13    undef $e;
14    $e = $1 if /E=(\d+)>/;
15    die if $c != $i;
16
17    $a = $reg{$a} if defined $reg{$a};
18    $b = $reg{$b} if defined $reg{$b};
19
20    if ($op eq "IF<R2>") {
21        $expr = "(IF ".$reg{"R002"}." $a $b)";
22    } elsif ($op eq "VECTOUT") {
23        $res = "$a\n$b\n";
24    } elsif (defined $b) {
25        $expr = "($op $a $b)";
26    } elsif (defined $a) {
27        $expr = "($op $a)";
28    } else {
29        $expr = "($op)";
30    }
31
32    $val[$e] = $expr if defined $e;
33    $reg{$d} = $val[$i] if defined $d;
34    $i++;
35}
36
37print $res;
38

Archive Download this file

Branches:
master



interactive