Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.169
 
1.170
 
MAIN:ragge:20060128072712
 
reader.c
_>625625         return r;
 626626 }
 627627 
<> 628+#ifdef PCC_DEBUG
  629+#define CDEBUG(x) if (c2debug) printf x
  630+#else
  631+#define CDEBUG(x)
  632+#endif
  633+
628634 /*
 629635  * Rewrite node after instruction emit.
 630636  */
     
 !
648654         if (cookie != FOREFF) {
 649655         if (p->n_su == DORIGHT)
 650656                 comperr("p->n_su == DORIGHT");
<>651 -        p->n_rval = DECRD(p->n_reg);
  657+        p->n_rval = DECRA(p->n_reg, 0);
652658 #if 0
 653659         if (rewrite & RLEFT) {
 654660 #ifdef PCC_DEBUG
 655661                 if (l->n_op != REG)
 656662                         comperr("rewrite left");
 657663 #endif
<>658 -                p->n_rval = DECRD(p->n_reg);
  664+                p->n_rval = DECRA(p->n_reg, 0);
659665         } else if (rewrite & RRIGHT) {
 660666 #ifdef PCC_DEBUG
 661667                 if (r->n_op != REG)
 662668                         comperr("rewrite right");
 663669 #endif
<>664 -                p->n_rval = DECRD(p->n_reg);
  670+                p->n_rval = DECRA(p->n_reg, 0);
665671         } else if (rewrite & RESC1) {
 666672                 p->n_rval = p->n_reg;
 667673         } else if (rewrite & RESC2)
     
 !
686692         if (p->n_su == -1) /* For OREGs and similar */
 687693                 return gencode(p->n_left, cookie);
 688694 
<>689 -        if (p->n_op == REG && DECRD(p->n_reg) == p->n_rval)
  695+        CDEBUG(("gencode: node %p\n", p));
  696+
  697+        if (p->n_op == REG && DECRA(p->n_reg, 0) == p->n_rval)
690698                 return; /* meaningless move to itself */
 691699         if (p->n_su & DORIGHT) {
 692700                 gencode(p->n_right, INREGS);
     
 !
709717                         int rr = rspecial(q, NRIGHT);
 710718 
 711719                         if (rr >= 0 && rr != p->n_right->n_rval) {
<> 720+                                CDEBUG(("gencode(%p) right nspec move\n", p));
712721                                 rmove(p->n_right->n_rval,
 713722                                     rr, p->n_right->n_type);
 714723                                 p->n_right->n_reg = rr;
 715724                                 p->n_right->n_rval = rr;
 716725                         }
 717726                 } else if ((q->rewrite & RRIGHT) &&
<>718 -                    DECRD(p->n_right->n_reg) != DECRD(p->n_reg)) {
  727+                    DECRA(p->n_right->n_reg, 0) != DECRA(p->n_reg, 0)) {
719728 #ifdef notyet
 720729                         if (p->n_op == ASSIGN)
 721730                                 comperr("ASSIGN error");
 722731 #endif
<> 732+                        CDEBUG(("gencode(%p) right move\n", p));
723733                         rmove(p->n_right->n_reg, p->n_reg, p->n_type);
 724734                         p->n_right->n_reg = p->n_reg;
 725735                         p->n_right->n_rval = p->n_reg;
     
 !
729739                 if (q->needs & NSPECIAL) {
 730740                         int rr = rspecial(q, NLEFT);
 731741 
<>732 -                        if (rr >= 0 && rr != p->n_left->n_reg) {
 733 -                                rmove(DECRD(p->n_left->n_reg), rr,
  742+                        if (rr >= 0 && rr != DECRA(p->n_left->n_reg, 0)) {
  743+                                CDEBUG(("gencode(%p) left nspec move\n", p));
  744+                                rmove(DECRA(p->n_left->n_reg, 0), rr,
734745                                     p->n_left->n_type);
 735746                                 p->n_left->n_reg = rr;
 736747                                 p->n_left->n_rval = rr;
 737748                         }
 738749                 } else if ((q->rewrite & RLEFT) &&
<>739 -                    DECRD(p->n_left->n_reg) != DECRD(p->n_reg)) {
  750+                    DECRA(p->n_left->n_reg, 0) != DECRA(p->n_reg, 0)) {
740751 #ifdef notyet
 741752                         if (p->n_op == ASSIGN)
 742753                                 comperr("ASSIGN error");
 743754 #endif
<> 755+                        CDEBUG(("gencode(%p) left move\n", p));
744756                         rmove(p->n_left->n_reg, p->n_reg, p->n_type);
 745757                         p->n_left->n_reg = p->n_reg;
 746758                         p->n_left->n_rval = p->n_reg;
     
 !
751763             p->n_left->n_op == REG && p->n_right->n_op == REG &&
 752764             p->n_left->n_rval == p->n_right->n_rval){
 753765                 /* do not emit anything */
<> 766+                CDEBUG(("gencode(%p) assign nothing\n", p));
754767                 rewrite(p, q->rewrite, cookie);
 755768                 return;
 756769         }
 757770 
<> 771+        CDEBUG(("emitting node %p\n", p));
  772+
758773         expand(p, cookie, q->cstring);
 759774         if (callop(p->n_op) && cookie != FOREFF &&
<>760 -            p->n_reg != RETREG(p->n_type)) {
 761 -                rmove(RETREG(p->n_type), DECRD(p->n_reg), p->n_type);
  775+            DECRA(p->n_reg, 0) != RETREG(p->n_type)) {
  776+                CDEBUG(("gencode(%p) retreg\n", p));
  777+                rmove(RETREG(p->n_type), DECRA(p->n_reg, 0), p->n_type);
762778         } else if (q->needs & NSPECIAL) {
 763779                 int rr = rspecial(q, NRES);
 764780 
<>765 -                if (rr >= 0 && p->n_reg != rr)
 766 -                        rmove(rr, DECRD(p->n_reg), p->n_type);
  781+                if (rr >= 0 && p->n_reg != rr) {
  782+                        CDEBUG(("gencode(%p) nspec retreg\n", p));
  783+                        rmove(rr, DECRA(p->n_reg, 0), p->n_type);
  784+                }
767785         } else if ((q->rewrite & RESC1) &&
<>768 -            (DECRA1(p->n_reg) != DECRD(p->n_reg))) {
 769 -                rmove(DECRA1(p->n_reg), DECRD(p->n_reg), p->n_type);
  786+            (DECRA(p->n_reg, 1) != DECRA(p->n_reg, 0))) {
  787+                CDEBUG(("gencode(%p) RESC1 retreg\n", p));
  788+                rmove(DECRA(p->n_reg, 1), DECRA(p->n_reg, 0), p->n_type);
770789         }
 771790         rewrite(p, q->rewrite, cookie);
 772791 }
     
 !
828847 #ifdef MULTICLASS
 829848                 int gregn(struct regw *);
 830849                 if (p->n_reg < 100000) /* XXX */
<>831 -                        fprintf(prfil, "REG %s", rnames[DECRD(p->n_reg)]);
  850+                        fprintf(prfil, "REG %s", rnames[DECRA(p->n_reg, 0)]);
832851                 else
 833852                         fprintf(prfil, "TEMP %d", gregn(p->n_regw));
 834853 #else
     
 !
979998 
 980999         if (p->n_op == UMUL) {
 9811000                 q = p->n_left;
<>982 -                if (q->n_op == REG && q->n_rval == DECRD(q->n_reg)) {
  1001+                if (q->n_op == REG && q->n_rval == DECRA(q->n_reg, 0)) {
9831002                         temp = q->n_lval;
 9841003                         r = q->n_rval;
 9851004                         cp = q->n_name;
     
 !
10111030 
 10121031                 if( (q->n_op==PLUS || q->n_op==MINUS) && qr->n_op == ICON &&
 10131032                                 ql->n_op==REG && szty(qr->n_type)==1 &&
<>1014 -                                (ql->n_rval == DECRD(ql->n_reg) ||
  1033+                                (ql->n_rval == DECRA(ql->n_reg, 0) ||
<_10151034                                 /* XXX */
 10161035                                  ql->n_rval == FPREG || ql->n_rval == STKREG)) {
 10171036                         temp = qr->n_lval;
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-21 01:28 +0100