Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.189
 
1.190
 
MAIN:ragge:20060608164515
 
reader.c
_>599599                 return; /* no register */
 600600         if (DECRA(p->n_reg, 0) == DECRA(q->n_reg, 0))
 601601                 return; /* no move necessary */
<> 602+        CDEBUG(("rmove: node %p, %s -> %s\n", p, rnames[DECRA(q->n_reg, 0)],
  603+            rnames[DECRA(p->n_reg, 0)]));
602604         rmove(DECRA(q->n_reg, 0), DECRA(p->n_reg, 0), p->n_type);
 603605         q->n_reg = q->n_rval = DECRA(p->n_reg, 0);
 604606 }
     
 !
619621         p->n_lval = 0;
 620622         p->n_name = "";
 621623 
<> 624+        if (o == ASSIGN) {
  625+                /* special rewrite care */
  626+                int reg = DECRA(p->n_reg, 0);
  627+                if (p->n_reg == -1)
  628+                        ;
  629+                else if (TBLIDX(l->n_su) && (DECRA(l->n_reg, 0) == reg))
  630+                        ;
  631+                else if (TBLIDX(r->n_su) && (DECRA(r->n_reg, 0) == reg))
  632+                        ;
  633+                else if (TBLIDX(l->n_su))
  634+                        rmove(DECRA(l->n_reg, 0), reg, p->n_type);
  635+                else if (TBLIDX(r->n_su))
  636+                        rmove(DECRA(r->n_reg, 0), reg, p->n_type);
  637+#if 0
  638+                else
  639+                        comperr("rewrite");
  640+#endif
  641+        }
622642         if (optype(o) != LTYPE)
 623643                 tfree(l);
 624644         if (optype(o) == BITYPE)
 625645                 tfree(r);
<> 646+        if (rewrite == 0)
  647+                return;
  648+        CDEBUG(("rewrite: %p, reg %s\n", p, rnames[DECRA(p->n_reg, 0)]));
626649         p->n_rval = DECRA(p->n_reg, 0);
 627650 }
 628651 
     
 !
631654 {
 632655         struct optab *q = &table[TBLIDX(p->n_su)];
 633656         NODE *p1, *l, *r;
<> 657+        int o = optype(p->n_op);
634658 
 635659         l = p->n_left;
 636660         r = p->n_right;
 637661 
 638662         if (TBLIDX(p->n_su) == 0) {
<>639 -                int o = optype(p->n_op);
 640 -
641663                 if (o == BITYPE && (p->n_su & DORIGHT))
 642664                         gencode(r, 0);
 643665                 if (optype(p->n_op) != LTYPE)
     
 !
659681                 for (p1 = r; p1->n_op == CM; p1 = p1->n_left)
 660682                         gencode(p1->n_right, FOREFF);
 661683                 gencode(p1, FOREFF);
<> 684+                o = UTYPE; /* avoid going down again */
662685         }
 663686 
<>664 -        if (optype(p->n_op) == BITYPE && (p->n_su & DORIGHT)) {
  687+        if (o == BITYPE && (p->n_su & DORIGHT)) {
665688                 gencode(r, INREGS);
 666689                 if (q->rewrite & RRIGHT)
 667690                         ckmove(p, r);
 668691         }
<>669 -        if (optype(p->n_op) != LTYPE) {
  692+        if (o != LTYPE) {
670693                 gencode(l, INREGS);
 671694                 if (q->rewrite & RLEFT)
 672695                         ckmove(p, l);
 673696         }
<>674 -        if (optype(p->n_op) == BITYPE && !(p->n_su & DORIGHT)) {
  697+        if (o == BITYPE && !(p->n_su & DORIGHT)) {
675698                 gencode(r, INREGS);
 676699                 if (q->rewrite & RRIGHT)
 677700                         ckmove(p, r);
     
 !
701724                         comperr("gencode: cross-reg-move");
 702725         }
 703726 
<>704 -#ifndef ragge
 705 -        if ((p->n_su & RMASK) == RREG) {
 706 -                if (q->needs & NSPECIAL) {
 707 -                        int rr = rspecial(q, NRIGHT);
 708 -
 709 -                        if (rr >= 0 && rr != p->n_right->n_rval) {
 710 -                                CDEBUG(("gencode(%p) right nspec move\n", p));
 711 -                                rmove(p->n_right->n_rval,
 712 -                                    rr, p->n_right->n_type);
 713 -                                p->n_right->n_reg = rr;
 714 -                                p->n_right->n_rval = rr;
 715 -                        }
 716 -                } else if ((q->rewrite & RRIGHT) &&
 717 -                    DECRA(p->n_right->n_reg, 0) != DECRA(p->n_reg, 0)) {
 718 -#ifdef notyet
 719 -                        if (p->n_op == ASSIGN)
 720 -                                comperr("ASSIGN error");
 721 -#endif
 722 -                        CDEBUG(("gencode(%p) right move\n", p));
 723 -                        rmove(DECRA(p->n_right->n_reg, 0),
 724 -                            DECRA(p->n_reg, 0), p->n_type);
 725 -                        p->n_right->n_reg = p->n_reg;
 726 -                        p->n_right->n_rval = p->n_reg;
 727 -                }
 728 -        }
 729 -        if ((p->n_su & LMASK) == LREG) {
 730 -                if (q->needs & NSPECIAL) {
 731 -                        int rr = rspecial(q, NLEFT);
 732 -
 733 -                        if (rr >= 0 && rr != DECRA(p->n_left->n_reg, 0)) {
 734 -                                CDEBUG(("gencode(%p) left nspec move\n", p));
 735 -                                rmove(DECRA(p->n_left->n_reg, 0), rr,
 736 -                                    p->n_left->n_type);
 737 -                                p->n_left->n_reg = rr;
 738 -                                p->n_left->n_rval = rr;
 739 -                        }
 740 -                } else if ((q->rewrite & RLEFT) &&
 741 -                    DECRA(p->n_left->n_reg, 0) != DECRA(p->n_reg, 0)) {
 742 -#ifdef notyet
 743 -                        if (p->n_op == ASSIGN)
 744 -                                comperr("ASSIGN error");
 745 -#endif
 746 -                        CDEBUG(("gencode(%p) left move\n", p));
 747 -                        rmove(DECRA(p->n_left->n_reg, 0),
 748 -                            DECRA(p->n_reg, 0), p->n_type);
 749 -                        p->n_left->n_reg = p->n_reg;
 750 -                        p->n_left->n_rval = p->n_reg;
 751 -                }
 752 -        }
 753 -#endif
 754 -
755727         if (p->n_op == ASSIGN &&
 756728             p->n_left->n_op == REG && p->n_right->n_op == REG &&
 757729             p->n_left->n_rval == p->n_right->n_rval){
     
 !
762734         }
 763735 
 764736         CDEBUG(("emitting node %p\n", p));
<>765 -        if (p->n_su == 0)
  737+        if (TBLIDX(p->n_su) == 0)
766738                 return;
 767739 
 768740         expand(p, cookie, q->cstring);
     
 !
781753             (DECRA(p->n_reg, 1) != DECRA(p->n_reg, 0))) {
 782754                 CDEBUG(("gencode(%p) RESC1 retreg\n", p));
 783755                 rmove(DECRA(p->n_reg, 1), DECRA(p->n_reg, 0), p->n_type);
<>784 -        } else if (p->n_op == ASSIGN) {
  756+        }
  757+#if 0
  758+                /* XXX - kolla upp det här */
  759+           else if (p->n_op == ASSIGN) {
785760                 /* may need move added if RLEFT/RRIGHT */
 786761                 /* XXX should be handled in sucomp() */
 787762                 if ((q->rewrite & RLEFT) && (p->n_left->n_op == REG) &&
     
 !
794769                         rmove(p->n_right->n_rval, DECRA(p->n_reg, 0), p->n_type);
 795770                 }
 796771         }
<> 772+#endif
<_797773         rewrite(p, q->rewrite, cookie);
 798774 }
 799775 
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-23 20:24 +0200