mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-15 10:30:37 +02:00
m1/perf/sched.c: don't try to unblock references of next setter twice (more)
Also changed: - added commented-out #define DEBUG - work-around for abort() being a no-op in libbase
This commit is contained in:
parent
69cfc407d5
commit
0f80dcf118
@ -22,7 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
//#include <assert.h>
|
||||
|
||||
#include <fpvm/is.h>
|
||||
#include <fpvm/fpvm.h>
|
||||
@ -31,10 +31,15 @@
|
||||
|
||||
#include <hw/pfpu.h>
|
||||
|
||||
#undef assert
|
||||
#define assert(x) \
|
||||
do { if (!(x)) { printf("ASSERT: " #x "\n"); abort(); } } \
|
||||
while (0)
|
||||
|
||||
//#define REG_STATS
|
||||
//#define LCPF /* longest critical path first */
|
||||
|
||||
//#define DEBUG
|
||||
#ifdef DEBUG
|
||||
#define Dprintf printf
|
||||
#else
|
||||
@ -447,13 +452,14 @@ static void unblock(struct insn *insn)
|
||||
}
|
||||
|
||||
|
||||
static void put_reg_by_setter(struct insn *setter, int vm_reg)
|
||||
static void put_reg_by_ref(struct data_ref *ref, int vm_reg)
|
||||
{
|
||||
struct insn *setter = ref->dep;
|
||||
struct vm_reg *reg;
|
||||
|
||||
if (setter) {
|
||||
put_reg(setter->vm_insn->dest);
|
||||
if (setter->next_setter)
|
||||
if (setter->next_setter && setter->next_setter != ref->insn)
|
||||
unblock(setter->next_setter);
|
||||
} else {
|
||||
reg = sc->regs+vm_reg2idx(vm_reg);
|
||||
@ -483,15 +489,15 @@ static void issue(struct insn *insn, unsigned *code)
|
||||
|
||||
switch (insn->arity) {
|
||||
case 3:
|
||||
put_reg_by_setter(insn->cond.dep, FPVM_REG_IFB);
|
||||
put_reg_by_ref(&insn->cond, FPVM_REG_IFB);
|
||||
/* fall through */
|
||||
case 2:
|
||||
CODE(sc->cycle).opb = lookup_pfpu_reg(insn->vm_insn->opb);
|
||||
put_reg_by_setter(insn->opb.dep, insn->vm_insn->opb);
|
||||
put_reg_by_ref(&insn->opb, insn->vm_insn->opb);
|
||||
/* fall through */
|
||||
case 1:
|
||||
CODE(sc->cycle).opa = lookup_pfpu_reg(insn->vm_insn->opa);
|
||||
put_reg_by_setter(insn->opa.dep, insn->vm_insn->opa);
|
||||
put_reg_by_ref(&insn->opa, insn->vm_insn->opa);
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user