mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2025-01-05 18:50:14 +02:00
m1/perf/eval.pl: process both programs (frame and vertex) and dump all assigned-to fixed registers
This commit is contained in:
parent
7567c4f679
commit
b3796c855f
@ -1,18 +1,39 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
|
||||||
while (<>) {
|
|
||||||
last if /per-vertex PFPU fragment/;
|
sub flush
|
||||||
|
{
|
||||||
|
for (sort keys %use) {
|
||||||
|
print "$_ = ".$reg{$_}."\n";
|
||||||
|
}
|
||||||
|
print $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
while (<>) {
|
while (<>) {
|
||||||
|
if (/FPVM fragment:/) {
|
||||||
|
&flush if $i;
|
||||||
|
undef %tmp;
|
||||||
|
undef $i;
|
||||||
|
}
|
||||||
|
if (/PFPU fragment:/) {
|
||||||
|
undef $res;
|
||||||
|
undef %reg;
|
||||||
|
undef @val;
|
||||||
|
%use = %tmp;
|
||||||
|
$i = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tmp{"R$1"} = 1 if /^\d+:.*-> R0(\d+)/;
|
||||||
|
next unless defined $i;
|
||||||
|
|
||||||
next unless
|
next unless
|
||||||
/^(\d+):\s+(\S+)\s+(R\d+)?(,(R\d+))?.*?(->\s+(R\d+))?\s*$/;
|
/^(\d+):\s+(\S+)\s+(R\d+)?(,(R\d+))?.*?(->\s+(R\d+))?\s*$/;
|
||||||
# 1 2 3 4 5 6 7
|
# 1 2 3 4 5 6 7
|
||||||
($c, $op, $a, $b, $d) = ($1, $2, $3, $5, $7);
|
($c, $op, $a, $b, $d) = ($1, $2, $3, $5, $7);
|
||||||
undef $e;
|
undef $e;
|
||||||
$e = $1 if /E=(\d+)>/;
|
$e = $1 if /E=(\d+)>/;
|
||||||
die if $c != $i;
|
die "($i) $_" if $c != $i;
|
||||||
|
|
||||||
$a = $reg{$a} if defined $reg{$a};
|
$a = $reg{$a} if defined $reg{$a};
|
||||||
$b = $reg{$b} if defined $reg{$b};
|
$b = $reg{$b} if defined $reg{$b};
|
||||||
@ -20,7 +41,7 @@ while (<>) {
|
|||||||
if ($op eq "IF<R2>") {
|
if ($op eq "IF<R2>") {
|
||||||
$expr = "(IF ".$reg{"R002"}." $a $b)";
|
$expr = "(IF ".$reg{"R002"}." $a $b)";
|
||||||
} elsif ($op eq "VECTOUT") {
|
} elsif ($op eq "VECTOUT") {
|
||||||
$res = "$a\n$b\n";
|
$res = "A = $a\nB = $b\n";
|
||||||
} elsif (defined $b) {
|
} elsif (defined $b) {
|
||||||
$expr = "($op $a $b)";
|
$expr = "($op $a $b)";
|
||||||
} elsif (defined $a) {
|
} elsif (defined $a) {
|
||||||
@ -33,5 +54,4 @@ while (<>) {
|
|||||||
$reg{$d} = $val[$i] if defined $d;
|
$reg{$d} = $val[$i] if defined $d;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
&flush;
|
||||||
print $res;
|
|
||||||
|
Loading…
Reference in New Issue
Block a user