Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.68
 
1.69
 
MAIN:ragge:20031112121311
 
reader.c
_>5959 void deltemp(NODE *p);
 6060 void optdump(struct interpass *ip);
 6161 void cvtemps(struct interpass *epil);
<>62 -int findops(NODE *p);
  62+int findops(NODE *p, int);
  63+int findasg(NODE *p, int);
  64+int finduni(NODE *p, int);
  65+int findleaf(NODE *p, int);
6366 int relops(NODE *p);
 6467 int asgops(NODE *p, int);
 6568 
<>66 -#define LREG    001
 67 -#define RREG    002
 68 -#define LOREG   004
 69 -#define ROREG   010
 70 -#define LTEMP   020
 71 -#define RTEMP   040
  69+static void genregs(NODE *p);
  70+static void gencode(NODE *p);
7271 
<> 72+/*
  73+ * Layout of findops() return value:
  74+ *      bit 0-1 where to store left node.
  75+ *      bit 2-3 where to store right node.
  76+ *      bit 4   set if right leg should be evaluated first
  77+ *      bit 5-  table index
  78+ */
  79+
  80+#define LREG            001
  81+#define LOREG           002
  82+#define LTEMP           003
  83+#define LMASK           003
  84+#define RREG            004
  85+#define ROREG           010
  86+#define RTEMP           014
  87+#define RMASK           014
  88+#define DORIGHT         020
  89+#define TBSH            5
  90+#define TBLIDX(idx)     ((idx) >> TBSH)
  91+#define MKIDX(tbl,mod)  (((tbl) << TBSH) | (mod))
  92+
  93+static char *ltyp[] = { "", "LREG", "LOREG", "LTEMP" };
  94+static char *rtyp[] = { "", "RREG", "ROREG", "RTEMP" };
  95+
7396 #define DELAYS 20
 7497 NODE *deltrees[DELAYS];
 7598 int deli;
     
 !
228251 void
 229252 codgen(NODE *p, int cookie)
 230253 {
<> 254+        canon(p);  /* creats OREG from * if possible and does sucomp */
  255+#ifdef PCC_DEBUG
  256+        if (e2debug) {
  257+                printf("geninsn called on:\n");
  258+                fwalk(p, e2print, 0);
  259+        }
  260+#endif
231261 
<> 262+        geninsn(p, cookie); /* Assign instructions for tree */
  263+        sucomp(p);  /* Calculate sub-tree evaluation order */
  264+#ifdef PCC_DEBUG
  265+        if (udebug) {
  266+                printf("genregs called on:\n");
  267+                fwalk(p, e2print, 0);
  268+        }
  269+#endif
  270+        genregs(p); /* allocate registers for instructions */
  271+        gencode(p); /* Emit instructions */
  272+#if 0
232273         for (;;) {
 233274                 canon(p);  /* creats OREG from * if possible and does sucomp */
 234275                 stotree = NIL;
     
 !
246287                 order( stotree, stocook );
 247288         }
 248289         order( p, cookie );
<> 290+#endif
249291 }
 250292 
 251293 #ifdef PCC_DEBUG
     
 !
299341 int odebug = 0;
 300342 
 301343 void
<> 344+geninsn(NODE *p, int cookie)
  345+{
  346+        int o, rv;
  347+
  348+#ifdef PCC_DEBUG
  349+        if (odebug) {
  350+                printf("geninsn(%p, ", p);
  351+                prcook(cookie);
  352+                printf(")\n");
  353+                fwalk(p, e2print, 0);
  354+        }
  355+#endif
  356+
  357+again:  switch (o = p->n_op) {
  358+        case PLUS:
  359+        case MINUS:
  360+        case MUL:
  361+        case DIV:
  362+        case MOD:
  363+        case AND:
  364+        case OR:
  365+        case ER:
  366+        case LS:
  367+        case RS:
  368+                if ((rv = findops(p, cookie)) < 0) {
  369+                        if (setbin(p))
  370+                                goto again;
  371+                        goto failed;
  372+                }
  373+        case ASSIGN:
  374+                if (o == ASSIGN)
  375+                    if ((rv = findasg(p, cookie)) < 0) {
  376+                        if (setasg(p, cookie))
  377+                                goto again;
  378+                        goto failed;
  379+                }
  380+                /*
  381+                 * Do subnodes conversions (if needed).
  382+                 */
  383+                switch (rv & LMASK) {
  384+                case LREG:
  385+                        geninsn(p->n_left, INTAREG|INTBREG);
  386+                        break;
  387+                case LOREG:
  388+                        offstar(p->n_left->n_left);
  389+                        p->n_left->n_su = -1;
  390+                        break;
  391+                case LTEMP:
  392+                        geninsn(p->n_left, INTEMP);
  393+                        break;
  394+                }
  395+
  396+                switch (rv & RMASK) {
  397+                case RREG:
  398+                        geninsn(p->n_right, INTAREG|INTBREG);
  399+                        break;
  400+                case ROREG:
  401+                        offstar(p->n_right->n_left);
  402+                        p->n_right->n_su = -1;
  403+                        break;
  404+                case RTEMP:
  405+                        geninsn(p->n_right, INTEMP);
  406+                        break;
  407+                }
  408+                p->n_su = rv;
  409+                break;
  410+
  411+        case REG:
  412+                if (istnode(p))
  413+                        cerror("geninsn REG");
  414+                /* FALLTHROUGH */
  415+        case OREG:
  416+                if ((cookie & (INTAREG|INTBREG)) == 0)
  417+                        cerror("geninsn OREG");
  418+                if ((rv = findleaf(p, cookie)) < 0) {
  419+                        if (setasg(p, cookie))
  420+                                goto again;
  421+                        goto failed;
  422+                }
  423+                p->n_su = rv;
  424+                break;
  425+
  426+        case UMUL:
  427+                if ((rv = finduni(p, cookie)) < 0) {
  428+                        if (setuni(p, cookie))
  429+                                goto again;
  430+                        goto failed;
  431+                }
  432+                switch (rv & LMASK) {
  433+                case LREG:
  434+                        geninsn(p->n_left, INTAREG|INTBREG);
  435+                        break;
  436+                }
  437+                p->n_su = rv;
  438+                break;
  439+
  440+        default:
  441+                cerror("geninsn: bad op %d", o);
  442+        }
  443+        return;
  444+
  445+failed:
  446+#ifdef PCC_DEBUG
  447+        fwalk(p, e2print, 0);
  448+#endif
  449+        cerror("Cannot generate code for op %d\n", o);
  450+}
  451+
  452+void
302453 order(NODE *p, int cook)
 303454 {
<>304 -        struct optab *q;
  455+//      struct optab *q;
305456         int o, ty, m, rv;
 306457         int cookie;
 307458         NODE *p1, *p2;
     
 !
392543         case RS:
 393544 
 394545                 /*
<> 546+                 * Get a suitable op.
  547+                 */
  548+                if ((rv = findops(p, cook)) < 0) {
  549+                        if (setbin(p))
  550+                                goto again;
  551+                        goto nomat;
  552+                }
  553+
  554+                /*
  555+                 * Do subnodes conversions (if needed).
  556+                 */
  557+                switch (rv & LMASK) {
  558+                case LREG:
  559+                        order(p->n_left, INTAREG|INTBREG);
  560+                        break;
  561+                case LOREG:
  562+                        offstar(p->n_left->n_left);
  563+                        canon(p->n_left);
  564+                        break;
  565+                case LTEMP:
  566+                        order(p->n_left, INTEMP);
  567+                        break;
  568+                }
  569+
  570+                switch (rv & RMASK) {
  571+                case RREG:
  572+                        order(p->n_right, INTAREG|INTBREG);
  573+                        break;
  574+                case ROREG:
  575+                        offstar(p->n_right->n_left);
  576+                        canon(p->n_right);
  577+                        break;
  578+                case RTEMP:
  579+                        order(p->n_right, INTEMP);
  580+                        break;
  581+                }
  582+                p->n_su = rv;
  583+                return;
  584+#if 0
  585+                /*
395586                  * Be sure that both sides are addressable.
 396587                  */
 397588 //printf("newstyle node %p\n", p);
     
 !
462653 //printf("newstyle ute %p\n", p);
 463654                 goto cleanup;
 464655 
<> 656+#endif
  657+
465658                 /*
 466659                  * For now just be sure that the trees on each side
 467660                  * are adressable.
     
 !
493686                 }
 494687                 rv = relops(p);
 495688                 m = FORCC;
<>496 -                goto foo;
  689+                break;
497690 
 498691         default:
 499692                 /* look for op in table */
     
 !
651844                 goto nomat;
 652845 
 653846         case ASSIGN:
<>654 -                if (setasg(p))
  847+                if (setasg(p, cook))
655848                         goto again;
 656849                 goto nomat;
 657850 
     
 !
683876         goto nomat;
 684877 }
 685878 
<> 879+/*
  880+ * Count the number of registers needed to evaluate a tree.
  881+ * This is the trivial implementation, for machines with symmetric
  882+ * registers. Machines with difficult register assignment strategies
  883+ * will need to define this function themselves.
  884+ * Return value is the number of registers used so far.
  885+ */
  886+int
  887+sucomp(NODE *p)
  888+{
  889+        struct optab *q = &table[TBLIDX(p->n_su)];
  890+        int left, right;
  891+        int nreg;
  892+
  893+        if (p->n_su == -1)
  894+                return sucomp(p->n_left);
  895+
  896+        nreg = (q->needs & NACOUNT) * szty(p->n_type);
  897+
  898+        switch (p->n_su & RMASK) {
  899+        case RREG:
  900+        case ROREG:
  901+                right = sucomp(p->n_right);
  902+                break;
  903+        case RTEMP:
  904+                cerror("sucomp RTEMP");
  905+        default:
  906+                right = 0;
  907+        }
  908+        switch (p->n_su & LMASK) {
  909+        case LREG:
  910+        case LOREG:
  911+                left = sucomp(p->n_left);
  912+                break;
  913+        case LTEMP:
  914+                cerror("sucomp LTEMP");
  915+        default:
  916+                left = 0;
  917+        }
  918+//printf("sucomp: right %d left %d\n", right, left);
  919+        if (right > left)
  920+                p->n_su |= DORIGHT;
  921+        if (right > nreg)
  922+                nreg = right;
  923+        if (left > nreg)
  924+                nreg = right;
  925+        return nreg;
  926+}
  927+
  928+void
  929+genregs(NODE *p)
  930+{
  931+        rallo(p, NOPREF);
  932+}
  933+
  934+void
  935+gencode(NODE *p)
  936+{
  937+        struct optab *q = &table[TBLIDX(p->n_su)];
  938+
  939+        if (p->n_su == -1) /* For OREGs and similar */
  940+                return gencode(p->n_left);
  941+
  942+        if (p->n_su & DORIGHT) {
  943+                gencode(p->n_right);
  944+                if ((p->n_su & RMASK) == ROREG)
  945+                        canon(p);
  946+        }
  947+        if (p->n_su & LMASK) {
  948+                gencode(p->n_left);
  949+                if ((p->n_su & LMASK) == LOREG)
  950+                        canon(p);
  951+        }
  952+        if ((p->n_su & RMASK) && !(p->n_su & DORIGHT)) {
  953+                gencode(p->n_right);
  954+                if ((p->n_su & RMASK) == ROREG)
  955+                        canon(p);
  956+        }
  957+        if (!allo(p, q))
  958+                cerror("failed register allocation");
  959+        expand(p, FOREFF, q->cstring);
  960+        reclaim(p, q->rewrite, INTAREG);
  961+}
  962+
  963+
686964 int callflag;
 687965 int fregs;
 688966 
     
 !
10611339 #ifdef MYCANON
 10621340         MYCANON(p);             /* your own canonicalization routine(s) */
 10631341 #endif
<> 1342+#if 0
10641343         walkf(p, sucomp);       /* do the Sethi-Ullman computation */
<> 1344+#endif
10651345 
 10661346 }
 10671347 
     
 !
11841464  * The instruction with the lowest grading is emitted.
 11851465  */
 11861466 int
<>1187 -findops(NODE *p)
  1467+findops(NODE *p, int cookie)
11881468 {
 11891469         extern int *qtable[];
 11901470         struct optab *q;
<>1191 -        int i, shl, shr, tl, tr, is3, rsr, rsl;
  1471+        int i, shl, shr, tl, tr, is3, rsr, rsl, osr, osl;
11921472         NODE *l, *r;
 11931473         int *ixp;
 11941474         int rv = -1, mtchno = 10;
     
 !
12091489 
 12101490 if (f2debug) printf("findop got types\n");
 12111491                 shl = tshape(l, q->lshape);
<>1212 -                rsl = (q->lshape & (SAREG|STAREG)) != 0 &&
 1213 -                    (q->rshape & SPECIAL) == 0;
  1492+                if ((q->lshape & SPECIAL) == 0) {
  1493+                        rsl = (q->lshape & (SAREG|STAREG)) != 0;
  1494+                        osl = (q->lshape & SOREG) && l->n_op == UMUL;
  1495+                } else
  1496+                        rsl = osl = 0;
  1497+                
12141498                 if (shl == 0 && rsl == 0)
 12151499                         continue; /* useless */
 12161500 if (f2debug) printf("findop lshape %d\n", shl);
 12171501 if (f2debug) fwalk(l, e2print, 0);
 12181502                 shr = tshape(r, q->rshape);
<>1219 -                rsr = (q->rshape & (SAREG|STAREG)) != 0 &&
 1220 -                    (q->rshape & SPECIAL) == 0;
  1503+                if ((q->rshape & SPECIAL) == 0) {
  1504+                        rsr = (q->rshape & (SAREG|STAREG)) != 0;
  1505+                        osr = (q->rshape & SOREG) && r->n_op == UMUL;
  1506+                } else
  1507+                        rsl = osl = 0;
12211508                 if (shr == 0 && rsr == 0)
 12221509                         continue; /* useless */
 12231510 if (f2debug) printf("findop rshape %d\n", shr);
     
 !
12471534                         }
 12481535                         if (got < mtchno) {
 12491536                                 mtchno = got;
<>1250 -                                rv = ixp[i] << 2;
  1537+                                rv = MKIDX(ixp[i], 0);
12511538                         }
 12521539                         if (got != 10)
 12531540                                 continue;
     
 !
12631550                                 /* put left in temp, add to right */
 12641551                                 if (4 < mtchno) {
 12651552                                         mtchno = 4;
<>1266 -                                        rv = (ixp[i] << 2) | LREG;
  1553+                                        rv = MKIDX(ixp[i], LREG);
12671554                                 }
 12681555                         } else if (q->needs & NDLEFT) {
 12691556                                 if (4 < mtchno) {
 12701557                                         mtchno = 4;
<>1271 -                                        rv = (ixp[i] << 2) | LREG;
  1558+                                        rv = MKIDX(ixp[i], LREG);
12721559                                 }
 12731560                                 continue; /* Can't do anything else */
 12741561                         } else if (is3) {
 12751562                                 if (5 < mtchno) {
 12761563                                         mtchno = 5;
<>1277 -                                        rv = (ixp[i] << 2) | LREG;
  1564+                                        rv = MKIDX(ixp[i], LREG);
12781565                                 }
 12791566                                 continue; /* Can't do anything else */
 12801567                         }
     
 !
12901577                                 /* put right in temp, add to left */
 12911578                                 if (4 < mtchno) {
 12921579                                         mtchno = 4;
<>1293 -                                        rv = (ixp[i] << 2) | RREG;
  1580+                                        rv = MKIDX(ixp[i], RREG);
12941581                                 }
 12951582                         } else if (q->needs & NDRIGHT) {
 12961583                                 if (4 < mtchno) {
 12971584                                         mtchno = 4;
<>1298 -                                        rv = (ixp[i] << 2) | RREG;
  1585+                                        rv = MKIDX(ixp[i], RREG);
12991586                                 }
 13001587                                 continue; /* Can't do anything */
 13011588                         } else if (is3) {
 13021589                                 if (5 < mtchno) {
 13031590                                         mtchno = 5;
<>1304 -                                        rv = (ixp[i] << 2) | RREG;
  1591+                                        rv = MKIDX(ixp[i], RREG);
13051592                                 }
 13061593                                 continue; /* Can't do anything */
 13071594                         }
     
 !
13141601                         if (is3) {
 13151602                                 if (7 < mtchno) {
 13161603                                         mtchno = 7;
<>1317 -                                        rv = (ixp[i] << 2) | RREG|LREG;
  1604+                                        rv = MKIDX(ixp[i], RREG|LREG);
13181605                                 }
 13191606                         } else {
 13201607                                 if (6 < mtchno) {
 13211608                                         mtchno = 6;
<>1322 -                                        rv = (ixp[i] << 2) | RREG|LREG;
  1609+                                        rv = MKIDX(ixp[i], RREG|LREG);
13231610                                 }
 13241611                         }
 13251612                 }
 13261613         }
<>1327 -if (f2debug) { if (rv == -1) printf("findops failed\n"); else printf("findops entry %d, %s %s\n", rv >> 2, rv & RREG ? "RREG" : "", rv & LREG ? "LREG" : ""); }
  1614+#ifdef PCC_DEBUG
  1615+        if (f2debug) {
  1616+                if (rv == -1)
  1617+                        printf("findops failed\n");
  1618+                else
  1619+                        printf("findops entry %d(%s %s)\n",
  1620+                            TBLIDX(rv), ltyp[rv & LMASK], rtyp[(rv&RMASK)>>2]);
  1621+        }
  1622+#endif
13281623         return rv;
 13291624 }
 13301625 
     
 !
14191714 
 14201715 /*
 14211716  * Find a matching assign op.
<> 1717+ *
  1718+ * Level assignment for priority:
  1719+ *      left    right   prio
  1720+ *      -       -       -
  1721+ *      direct  direct  1
  1722+ *      direct  REG     2
  1723+ *      direct  OREG    3
  1724+ *      OREG    direct  4
  1725+ *      OREG    REG     5
  1726+ *      OREG    OREG    6
14221727  */
 14231728 int
<>1424 -asgops(NODE *p, int cookie)
  1729+findasg(NODE *p, int cookie)
14251730 {
 14261731         extern int *qtable[];
 14271732         struct optab *q;
<>1428 -        int i, shl, shr, rsr;
  1733+        int i, shl, shr, rsr, lvl = 10;
14291734         NODE *l, *r;
 14301735         int *ixp;
 14311736         int rv = -1;
 14321737 
<>1433 -if (f2debug) printf("asgops tree: ");
 1434 -if (f2debug) prcook(cookie);
 1435 -if (f2debug) printf("\n");
 1436 -if (f2debug) fwalk(p, e2print, 0);
  1738+#ifdef PCC_DEBUG
  1739+        if (f2debug) {
  1740+                printf("findasg tree: ");
  1741+                prcook(cookie);
  1742+                printf("\n");
  1743+                fwalk(p, e2print, 0);
  1744+        }
  1745+#endif
14371746 
 14381747         ixp = qtable[p->n_op];
 14391748         for (i = 0; ixp[i] >= 0; i++) {
     
 !
14521761 
 14531762 if (f2debug) printf("asgop got types\n");
 14541763                 shl = tshape(l, q->lshape);
<>1455 -                if (shl == 0)
 1456 -                        continue; /* left shape must always match */
  1764+                if (shl == 0) {
  1765+                        /* See if this can end up as an OREG */
  1766+                        if (p->n_left->n_op != UMUL)
  1767+                                continue;
  1768+                        if ((q->lshape & SOREG) == 0)
  1769+                                continue;
  1770+                }
  1771+
14571772 if (f2debug) printf("asgop lshape %d\n", shl);
 14581773 if (f2debug) fwalk(l, e2print, 0);
<> 1774+
14591775                 shr = tshape(r, q->rshape);
 14601776                 rsr = (q->rshape & (SAREG|STAREG)) != 0 &&
 14611777                     (q->rshape & SPECIAL) == 0;
     
 !
14711787                          * Both shapes matches.
 14721788                          * Ideal situation, encode and be done with it.
 14731789                          */
<>1474 -                        return ixp[i] << 2;
  1790+                        rv = MKIDX(ixp[i], 0);
  1791+                        break;
14751792                 }
 14761793 if (f2debug) printf("second\n");
 14771794                 if (shl) {
 14781795                         /*
 14791796                          * Left shape matched. Right node must be put into
 14801797                          * a temporary register.
 14811798                          */
<>1482 -                        return (ixp[i] << 2) | RREG;
  1799+                        if (lvl < 3)
  1800+                                continue;
  1801+                        lvl = 3;
  1802+                        rv = MKIDX(ixp[i], RREG);
  1803+                        continue;
14831804                 }
<> 1805+                if (shr) {
  1806+                        if (lvl < 4)
  1807+                                continue;
  1808+                        lvl = 4;
  1809+                        rv = MKIDX(ixp[i], LOREG);
  1810+                        continue;
  1811+                }
  1812+                if (lvl < 6)
  1813+                        continue;
  1814+                lvl = 6;
  1815+                rv = MKIDX(ixp[i], LOREG|RREG);
14841816         }
<>1485 -if (f2debug) { if (rv == -1) printf("asgops failed\n"); else printf("asgops entry %d, %s %s\n", rv >> 2, rv & RREG ? "RREG" : "", rv & LREG ? "LREG" : ""); }
  1817+#ifdef PCC_DEBUG
  1818+        if (f2debug) {
  1819+                if (rv == -1)
  1820+                        printf("findasg failed\n");
  1821+                else
  1822+                        printf("findasg entry %d(%s %s)\n",
  1823+                            TBLIDX(rv), ltyp[rv & LMASK], rtyp[(rv&RMASK)>>2]);
  1824+        }
  1825+#endif
14861826         return rv;
 14871827 }
<_ 1828+
  1829+/*
  1830+ * Find an ASSIGN node that puts the value into a register.
  1831+ */
  1832+int
  1833+findleaf(NODE *p, int cookie)
  1834+{
  1835+        extern int *qtable[];
  1836+        struct optab *q;
  1837+        int i, shl;
  1838+        int *ixp;
  1839+        int rv = -1;
  1840+
  1841+#ifdef PCC_DEBUG
  1842+        if (f2debug) {
  1843+                printf("findleaf tree: ");
  1844+                prcook(cookie);
  1845+                printf("\n");
  1846+                fwalk(p, e2print, 0);
  1847+        }
  1848+#endif
  1849+
  1850+        ixp = qtable[p->n_op];
  1851+        for (i = 0; ixp[i] >= 0; i++) {
  1852+                q = &table[ixp[i]];
  1853+
  1854+if (f2debug) printf("findleaf: ixp %d\n", ixp[i]);
  1855+                if (ttype(p->n_type, q->rtype) == 0)
  1856+                        continue; /* Type must be correct */
  1857+
  1858+if (f2debug) printf("findleaf got types\n");
  1859+                shl = tshape(p, q->rshape);
  1860+                if (shl == 0)
  1861+                        continue; /* shape must match */
  1862+
  1863+if (f2debug) printf("findleaf got shapes %d\n", shl);
  1864+
  1865+                if (q->needs & REWRITE)
  1866+                        break;  /* Done here */
  1867+
  1868+                rv = MKIDX(ixp[i], 0);
  1869+                break;
  1870+        }
  1871+        if (f2debug) {
  1872+                if (rv == -1)
  1873+                        printf("findleaf failed\n");
  1874+                else
  1875+                        printf("findleaf entry %d(%s %s)\n",
  1876+                            TBLIDX(rv), ltyp[rv & LMASK], rtyp[(rv&RMASK)>>2]);
  1877+        }
  1878+        return rv;
  1879+}
  1880+
  1881+/*
  1882+ * Find a UNARY op that satisfy the needs.
  1883+ * For now, the destination is always a register.
  1884+ */
  1885+int
  1886+finduni(NODE *p, int cookie)
  1887+{
  1888+        extern int *qtable[];
  1889+        struct optab *q;
  1890+        NODE *l;
  1891+        int i, shl, rsl;
  1892+        int *ixp;
  1893+        int rv = -1;
  1894+
  1895+#ifdef PCC_DEBUG
  1896+        if (f2debug) {
  1897+                printf("finduni tree: ");
  1898+                prcook(cookie);
  1899+                printf("\n");
  1900+                fwalk(p, e2print, 0);
  1901+        }
  1902+#endif
  1903+
  1904+        l = getlr(p, 'L');
  1905+        ixp = qtable[p->n_op];
  1906+        for (i = 0; ixp[i] >= 0; i++) {
  1907+                q = &table[ixp[i]];
  1908+
  1909+if (f2debug) printf("finduni: ixp %d\n", ixp[i]);
  1910+                if (ttype(l->n_type, q->ltype) == 0)
  1911+                        continue; /* Type must be correct */
  1912+
  1913+if (f2debug) printf("finduni got types\n");
  1914+                shl = tshape(l, q->lshape);
  1915+                rsl = (q->lshape & (SAREG|STAREG)) != 0 &&
  1916+                    (q->lshape & SPECIAL) == 0;
  1917+                if (shl == 0 && rsl == 0)
  1918+                        continue; /* shape or regs must match */
  1919+
  1920+if (f2debug) printf("finduni got shapes %d\n", shl);
  1921+                if (q->needs & REWRITE)
  1922+                        break;  /* Done here */
  1923+
  1924+                rv = MKIDX(ixp[i], shl ? 0 : LREG);
  1925+                if (shl)
  1926+                        break;
  1927+        }
  1928+#ifdef PCC_DEBUG
  1929+        if (f2debug) {
  1930+                if (rv == -1)
  1931+                        printf("finduni failed\n");
  1932+                else
  1933+                        printf("finduni entry %d(%s %s)\n",
  1934+                            TBLIDX(rv), ltyp[rv & LMASK], rtyp[(rv&RMASK)>>2]);
  1935+        }
  1936+#endif
  1937+        return rv;
  1938+}
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-30 17:56 +0200