Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.187
 
1.188
 
MAIN:ragge:20060603145348
 
reader.c
_>590590 #endif
 591591 
 592592 /*
<>593 - * Rewrite node after instruction emit.
  593+ * Do a register-register move if necessary.
594594  */
 595595 static void
<> 596+ckmove(NODE *p, NODE *q)
  597+{
  598+        if (q->n_op != REG)
  599+                return; /* no register */
  600+        if (DECRA(p->n_reg, 0) == DECRA(q->n_reg, 0))
  601+                return; /* no move necessary */
  602+        rmove(DECRA(q->n_reg, 0), DECRA(p->n_reg, 0), p->n_type);
  603+        q->n_reg = q->n_rval = DECRA(p->n_reg, 0);
  604+}
  605+
  606+/*
  607+ * Rewrite node to register after instruction emit.
  608+ */
  609+static void
596610 rewrite(NODE *p, int rewrite, int cookie)
 597611 {
 598612         NODE *l, *r;
     
 !
616630 gencode(NODE *p, int cookie)
 617631 {
 618632         struct optab *q = &table[TBLIDX(p->n_su)];
<>619 -        NODE *p1;
  633+        NODE *p1, *l, *r;
620634 
<> 635+        l = p->n_left;
  636+        r = p->n_right;
  637+
621638         if (TBLIDX(p->n_su) == 0) {
 622639                 int o = optype(p->n_op);
 623640 
 624641                 if (o == BITYPE && (p->n_su & DORIGHT))
<>625 -                        gencode(p->n_right, 0);
  642+                        gencode(r, 0);
626643                 if (optype(p->n_op) != LTYPE)
<>627 -                        gencode(p->n_left, 0);
  644+                        gencode(l, 0);
628645                 if (o == BITYPE && !(p->n_su & DORIGHT))
<>629 -                        gencode(p->n_right, 0);
  646+                        gencode(r, 0);
630647                 return;
 631648         }
 632649 
     
 !
639656                 lastcall(p); /* last chance before function args */
 640657         if (p->n_op == CALL || p->n_op == FORTCALL || p->n_op == STCALL) {
 641658                 /* Print out arguments first */
<>642 -                for (p1 = p->n_right; p1->n_op == CM; p1 = p1->n_left)
  659+                for (p1 = r; p1->n_op == CM; p1 = p1->n_left)
643660                         gencode(p1->n_right, FOREFF);
 644661                 gencode(p1, FOREFF);
 645662         }
 646663 
<>647 -        if (optype(p->n_op) == BITYPE && (p->n_su & DORIGHT))
 648 -                gencode(p->n_right, INREGS);
  664+        if (optype(p->n_op) == BITYPE && (p->n_su & DORIGHT)) {
  665+                gencode(r, INREGS);
  666+                if (q->rewrite & RRIGHT)
  667+                        ckmove(p, r);
  668+        }
  669+        if (optype(p->n_op) != LTYPE) {
  670+                gencode(l, INREGS);
  671+                if (q->rewrite & RLEFT)
  672+                        ckmove(p, l);
  673+        }
  674+        if (optype(p->n_op) == BITYPE && !(p->n_su & DORIGHT)) {
  675+                gencode(r, INREGS);
  676+                if (q->rewrite & RRIGHT)
  677+                        ckmove(p, r);
  678+        }
649679 
<>650 -        if (optype(p->n_op) != LTYPE)
 651 -                gencode(p->n_left, INREGS);
 652 -
 653 -        if (optype(p->n_op) == BITYPE && !(p->n_su & DORIGHT))
 654 -                gencode(p->n_right, INREGS);
 655 -
 656 -#ifdef ragge
657680         canon(p);
<> 681+
658682         if (q->needs & NSPECIAL) {
<>659 -                int rs;
 660 -#endif
 661 -FIXA utskriftsordningen av instruktioner.
  683+                int rr = rspecial(q, NRIGHT);
  684+                int lr = rspecial(q, NLEFT);
662685 
<> 686+                if (rr >= 0) {
  687+                        if (r->n_op != REG)
  688+                                comperr("gencode: rop != REG");
  689+                        if (rr != r->n_rval)
  690+                                rmove(r->n_rval, rr, r->n_type);
  691+                        r->n_rval = r->n_reg = rr;
  692+                }
  693+                if (lr >= 0) {
  694+                        if (l->n_op != REG)
  695+                                comperr("gencode: lop != REG");
  696+                        if (lr != l->n_rval)
  697+                                rmove(l->n_rval, lr, l->n_type);
  698+                        l->n_rval = l->n_reg = lr;
  699+                }
  700+                if (rr >= 0 && lr >= 0 && (l->n_reg == rr || r->n_reg == lr))
  701+                        comperr("gencode: cross-reg-move");
  702+        }
  703+
  704+#ifndef ragge
663705         if ((p->n_su & RMASK) == RREG) {
 664706                 if (q->needs & NSPECIAL) {
 665707                         int rr = rspecial(q, NRIGHT);
     
 !
708750                         p->n_left->n_rval = p->n_reg;
 709751                 }
 710752         }
<> 753+#endif
711754 
 712755         if (p->n_op == ASSIGN &&
 713756             p->n_left->n_op == REG && p->n_right->n_op == REG &&
     
 !
722765         if (p->n_su == 0)
 723766                 return;
 724767 
<>725 -        canon(p);
  768+//      canon(p);
726769 //fwalk(p, e2print, 0);
 727770         expand(p, cookie, q->cstring);
 728771         if (callop(p->n_op) && cookie != FOREFF &&
     
 !
732775         } else if (q->needs & NSPECIAL) {
 733776                 int rr = rspecial(q, NRES);
 734777 
<>735 -                if (rr >= 0 && p->n_reg != rr) {
  778+                if (rr >= 0 && DECRA(p->n_reg, 0) != rr) {
<_736779                         CDEBUG(("gencode(%p) nspec retreg\n", p));
 737780                         rmove(rr, DECRA(p->n_reg, 0), p->n_type);
 738781                 }
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-10-02 12:32 +0200