mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2025-04-21 12:27:27 +03:00
m1/perf/: calculate effective register allocation and how it in comparison table
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
|
||||
sub flush
|
||||
{
|
||||
if ($nregs) {
|
||||
print 0+keys %reg, "/", (sort { $b cmp $a } keys %reg)[0],
|
||||
"\n";
|
||||
return;
|
||||
}
|
||||
for (sort keys %use) {
|
||||
print "$_ = ".$reg{$_}."\n";
|
||||
}
|
||||
@@ -10,6 +15,12 @@ sub flush
|
||||
}
|
||||
|
||||
|
||||
if ($ARGV[0] eq "-r") {
|
||||
shift @ARGV;
|
||||
$nregs = 1;
|
||||
}
|
||||
|
||||
|
||||
while (<>) {
|
||||
if (/FPVM fragment:/) {
|
||||
&flush if $i;
|
||||
@@ -35,11 +46,15 @@ while (<>) {
|
||||
$e = $1 if /E=(\d+)>/;
|
||||
die "($i) $_" if $c != $i;
|
||||
|
||||
$reg{$a} = 1 if $nregs && defined $a;
|
||||
$reg{$b} = 1 if $nregs && defined $b;
|
||||
|
||||
$a = $reg{$a} if defined $reg{$a};
|
||||
$b = $reg{$b} if defined $reg{$b};
|
||||
|
||||
if ($op eq "IF<R2>") {
|
||||
$expr = "(IF ".$reg{"R002"}." $a $b)";
|
||||
$reg{"R002"} = 1 if $nregs;
|
||||
} elsif ($op eq "VECTOUT") {
|
||||
$res = "A = $a\nB = $b\n";
|
||||
} elsif (defined $b) {
|
||||
|
||||
Reference in New Issue
Block a user