/*% cc -std=c99 -Wall -DTEST_PMOV -g -o # % */ #include #include #include static void assert_test(char *, int), fail(void); #include "../rega.c" static RMap mbeg; static Ins ins[NReg], *ip; int main() { Blk dummyb; Ins *i1; unsigned long long tm, rm; RMap mend; int reg[NReg]; int t, i, r, nr; tmp = (Tmp[Tmp0+NReg]){{0}}; for (t=0; t> (2*t)) & 3) { case 0: /* not in copy, not in use */ break; case 1: /* not in copy, in use */ radd(&mbeg, Tmp0+t, t+1); break; case 2: /* in copy, not in reg */ *ip++ = (Ins){OCopy, TMP(Tmp0+t), {R, R}}; break; case 3: /* in copy, in reg */ *ip++ = (Ins){OCopy, TMP(Tmp0+t), {R, R}}; radd(&mbeg, Tmp0+t, t+1); break; } if (ip == ins) /* cancel is the parallel move * is empty */ goto Nxt; /* find registers for temporaries * in mbeg */ nr = ip - ins; dummyb.nins = nr; rm = (1ull << (nr+1)) - 1; for (i=0; iarg[0] = TMP(reg[i]); #if 0 for (i=0; ito.val].name, i1->arg[0].val); exit(1); } static void assert_test(char *s, int x) { if (x) return; printf("!assertion failure: %s\n", s); fail(); } /* symbols required by the linker */ char debug['Z'+1]; Ins insb[NIns], *curi; void diag(char *s) { printf("!diag failure: %s\n", s); fail(); } void *alloc(size_t n) { return malloc(n); } Blk *blocka() { printf("!blocka called\n"); exit(1); }