Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.94
 
1.95
 
MAIN:ragge:20040518142937
 
reader.c
_>790790         o = p->n_op;
 791791         p->n_op = REG;
 792792         p->n_lval = 0;
<> 793+        p->n_name = "";
793794         if (rewrite & RLEFT) {
 794795 #ifdef PCC_DEBUG
 795796                 if (l->n_op != REG)
     
 !
11081109 
 11091110 }
 11101111 
<> 1112+static int shltab[] = { 0, 0, LOREG, LREG };
  1113+static int shrtab[] = { 0, 0, ROREG, RREG };
  1114+
11111115 /*
 11121116  * Find the best ops for a given tree.
 11131117  * Different instruction sequences are graded as:
     
 !
11481152 
 11491153 if (f2debug) printf("findop got types\n");
 11501154                 shl = tshape(l, q->lshape);
<> 1155+if (shl != SRDIR) shl = 0;
11511156                 if ((q->lshape & SPECIAL) == 0) {
 11521157                         rsl = (q->lshape & (SAREG|STAREG)) != 0;
 11531158                         osl = (q->lshape & SOREG) && l->n_op == UMUL;
     
 !
11591164 if (f2debug) printf("findop lshape %d\n", shl);
 11601165 if (f2debug) fwalk(l, e2print, 0);
 11611166                 shr = tshape(r, q->rshape);
<> 1167+if (shr != SRDIR) shr = 0;
11621168                 if ((q->rshape & SPECIAL) == 0) {
 11631169                         rsr = (q->rshape & (SAREG|STAREG)) != 0;
 11641170                         osr = (q->rshape & SOREG) && r->n_op == UMUL;
     
 !
12861292  * Find the best relation op for matching the two trees it has.
 12871293  * This is a sub-version of the function findops() above.
 12881294  * The instruction with the lowest grading is emitted.
<> 1295+ *
  1296+ * Level assignment for priority:
  1297+ *      left    right   prio
  1298+ *      -       -       -
  1299+ *      direct  direct  1
  1300+ *      direct  OREG    2       # make oreg
  1301+ *      OREG    direct  2       # make oreg
  1302+ *      OREG    OREG    2       # make both oreg
  1303+ *      direct  REG     3       # put in reg
  1304+ *      OREG    REG     3       # put in reg, make oreg
  1305+ *      REG     direct  3       # put in reg
  1306+ *      REG     OREG    3       # put in reg, make oreg
  1307+ *      REG     REG     4       # put both in reg
12891308  */
 12901309 int
 12911310 relops(NODE *p)
 12921311 {
 12931312         extern int *qtable[];
 12941313         struct optab *q;
<>1295 -        int i, shl, shr, rsr, rsl;
  1314+        int i, shl, shr/* , rsr, rsl */;
12961315         NODE *l, *r;
 12971316         int *ixp;
 12981317         int rv = -1, mtchno = 10;
     
 !
13131332 
 13141333 if (f2debug) printf("relops got types\n");
 13151334                 shl = tshape(l, q->lshape);
<> 1335+#if 0
13161336                 rsl = (q->lshape & (SAREG|STAREG)) != 0 &&
 13171337                     (q->lshape & SPECIAL) == 0;
<> 1338+                if (rsl == 0 && l->n_op == UMUL && (q->lshape & SOREG))
  1339+                        rsl = 2;
13181340                 if (shl == 0 && rsl == 0)
 13191341                         continue; /* useless */
<> 1342+#else
  1343+                if (shl == 0)
  1344+                        continue; /* useless */
  1345+#endif
13201346 if (f2debug) printf("relops lshape %d\n", shl);
 13211347 if (f2debug) fwalk(l, e2print, 0);
 13221348                 shr = tshape(r, q->rshape);
<> 1349+#if 0
13231350                 rsr = (q->rshape & (SAREG|STAREG)) != 0 &&
 13241351                     (q->rshape & SPECIAL) == 0;
 13251352                 if (shr == 0 && rsr == 0)
 13261353                         continue; /* useless */
<> 1354+#else
  1355+                if (shr == 0)
  1356+                        continue; /* useless */
  1357+#endif
13271358 if (f2debug) printf("relops rshape %d\n", shr);
 13281359 if (f2debug) fwalk(r, e2print, 0);
 13291360                 if (q->needs & REWRITE)
 13301361                         break;  /* Done here */
 13311362 
<> 1363+                if (shl+shr < mtchno) {
  1364+                        mtchno = shl+shr;
  1365+                        rv = MKIDX(ixp[i], shltab[shl]|shrtab[shr]);
  1366+                }
  1367+#if 0
13321368                 if (shl && shr) {
 13331369                         /*
 13341370                          * Both shapes matches directly. For relops this
     
 !
13671403                         mtchno = 6;
 13681404                         rv = MKIDX(ixp[i], RREG|LREG);
 13691405                 }
<> 1406+#endif
13701407         }
 13711408 #ifdef PCC_DEBUG
 13721409         if (f2debug) {
     
 !
14271464 
 14281465 if (f2debug) printf("asgop got types\n");
 14291466                 shl = tshape(l, q->lshape);
<> 1467+if (shl != SRDIR) shl = 0;
14301468                 if (shl == 0) {
 14311469                         /* See if this can end up as an OREG */
 14321470                         if (p->n_left->n_op != UMUL)
     
 !
14391477 if (f2debug) fwalk(l, e2print, 0);
 14401478 
 14411479                 shr = tshape(r, q->rshape);
<> 1480+if (shr != SRDIR) shr = 0;
14421481                 rsr = (q->rshape & (SAREG|STAREG)) != 0 &&
 14431482                     (q->rshape & SPECIAL) == 0;
 14441483                 if (shr == 0 && rsr == 0)
     
 !
15211560 
 15221561 if (f2debug) printf("findleaf got types\n");
 15231562                 shl = tshape(p, q->rshape);
<> 1563+if (shl != SRDIR) shl = 0;
15241564                 if (shl == 0)
 15251565                         continue; /* shape must match */
 15261566 
     
 !
15811621 
 15821622 if (f2debug) printf("finduni got types\n");
 15831623                 shl = tshape(l, q->lshape);
<> 1624+if (shl != SRDIR) shl = 0;
<_15841625                 rsl = (q->lshape & (SAREG|STAREG)) != 0 &&
 15851626                     (q->lshape & SPECIAL) == 0;
 15861627                 if (shl == 0 && rsl == 0)
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-22 18:15 +0200