From c02c02903d5c91d5bd7a1a7faf982b4ae60afec2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 18 Sep 2011 10:14:12 -0300 Subject: [PATCH] m1/perf/: a bunch of bug fixes all over the place --- m1/perf/eval.pl | 10 +++++----- m1/perf/main.c | 2 +- m1/perf/sched.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/m1/perf/eval.pl b/m1/perf/eval.pl index 6c80b02..24d0f17 100755 --- a/m1/perf/eval.pl +++ b/m1/perf/eval.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl -#while (<>) { -# last if /per-vertex PFPU fragment/; -#} +while (<>) { + last if /per-vertex PFPU fragment/; +} $i = 0; while (<>) { @@ -17,8 +17,8 @@ while (<>) { $a = $reg{$a} if defined $reg{$a}; $b = $reg{$b} if defined $reg{$b}; - if ($op eq "IF") { - $expr = "(IF $reg{002} $a $b)"; + if ($op eq "IF") { + $expr = "(IF ".$reg{"R002"}." $a $b)"; } elsif ($op eq "VECTOUT") { $res = "$a\n$b\n"; } elsif (defined $b) { diff --git a/m1/perf/main.c b/m1/perf/main.c index bf3999d..46dff9e 100644 --- a/m1/perf/main.c +++ b/m1/perf/main.c @@ -45,7 +45,7 @@ int main(int argc, char **argv) perror(name); exit(1); } - got = fread(buf, sizeof(buf)-1, 1, file); + got = fread(buf, 1, sizeof(buf)-1, file); if (got < 0) { perror(name); exit(1); diff --git a/m1/perf/sched.c b/m1/perf/sched.c index ec1ebda..9e3fb76 100644 --- a/m1/perf/sched.c +++ b/m1/perf/sched.c @@ -360,7 +360,7 @@ static void init_scheduler(struct fpvm_fragment *frag) list_init(&insn->dependants); switch (insn->arity) { case 3: - add_data_ref(insn, &insn->opb, FPVM_REG_IFB); + add_data_ref(insn, &insn->cond, FPVM_REG_IFB); /* fall through */ case 2: add_data_ref(insn, &insn->opb, frag->code[i].opb);