Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.157
 
1.158
 
MAIN:ragge:20051120214841
 
reader.c
_>805805         p->n_op = REG;
 806806         p->n_lval = 0;
 807807         p->n_name = "";
<>808 -#if 0
 809 -        if (xnewreg && (q->needs & NSPECIAL)) {
 810 -                int left, right, res, mask;
 811 -                nspecial(q, &left, &right, &res, &mask);
 812 -                p->n_rval = p->n_rall = ffs(res)-1;
 813 -        } else
 814 -#endif
  808+
815809         if (rewrite & RLEFT) {
 816810 #ifdef PCC_DEBUG
 817811                 if (l->n_op != REG)
 818812                         comperr("rewrite left");
 819813 #endif
<>820 -#ifdef MULTICLASS
 821 -                p->n_reg = p->n_rval = l->n_rval;
 822 -#else
 823 -                p->n_rall = p->n_rval = l->n_rval;
 824 -#endif
  814+                p->n_rval = p->n_reg;
825815         } else if (rewrite & RRIGHT) {
 826816 #ifdef PCC_DEBUG
 827817                 if (r->n_op != REG)
 828818                         comperr("rewrite right");
 829819 #endif
<>830 -#ifdef MULTICLASS
 831 -                p->n_reg = p->n_rval = r->n_rval;
 832 -#else
 833 -                p->n_rall = p->n_rval = l->n_rval;
 834 -#endif
  820+                p->n_rval = p->n_reg;
835821         } else if (rewrite & RESC1) {
<>836 -#ifdef MULTICLASS
 837 -                p->n_reg = p->n_rval = p->n_reg;
 838 -#else
 839 -                p->n_rval = p->n_rall;
 840 -#endif
  822+                p->n_rval = p->n_reg;
841823         } else if (rewrite & RESC2)
 842824 #ifdef MULTICLASS
 843825                 p->n_reg = p->n_rval = p->n_reg;
     
 !
870852         if (p->n_su == -1) /* For OREGs and similar */
 871853                 return gencode(p->n_left, cookie);
 872854 
<>873 -#ifdef MULTICLASS
874855         if (p->n_op == REG && p->n_reg == p->n_rval)
 875856                 return; /* meaningless move to itself */
 876857         if (p->n_op == ASSIGN && p->n_left->n_op == REG &&
     
 !
880861                 gencode(p->n_right, INREGS);
 881862                 return; /* meaningless assign */
 882863         }
<>883 -#else
 884 -        if (p->n_op == REG && p->n_rall == p->n_rval)
 885 -                return; /* meaningless move to itself */
 886 -        if (p->n_op == ASSIGN && p->n_left->n_op == REG &&
 887 -            p->n_left->n_rval == p->n_rall &&
 888 -            (p->n_su & RMASK) &&
 889 -            p->n_right->n_rall == p->n_rall) {
 890 -                gencode(p->n_right, INTAREG|INTBREG);
 891 -                return; /* meaningless assign */
 892 -        }
 893 -#endif
894864 
 895865         if (p->n_su & DORIGHT) {
<>896 -#ifdef MULTICLASS
897866                 gencode(p->n_right, INREGS);
<>898 -#else
 899 -                gencode(p->n_right, INTAREG|INTBREG);
 900 -#endif
901867                 if ((p->n_su & RMASK) == ROREG)
 902868                         canon(p);
 903869         }
 904870         if (p->n_su & LMASK) {
<>905 -#ifdef MULTICLASS
906871                 gencode(p->n_left, INREGS);
<>907 -#else
 908 -                gencode(p->n_left, INTAREG|INTBREG);
 909 -#endif
910872                 if ((p->n_su & LMASK) == LOREG)
 911873                         canon(p);
 912874         }
 913875         if ((p->n_su & RMASK) && !(p->n_su & DORIGHT)) {
<>914 -#ifdef MULTICLASS
915876                 gencode(p->n_right, INREGS);
<>916 -#else
 917 -                gencode(p->n_right, INTAREG|INTBREG);
 918 -#endif
919877                 if ((p->n_su & RMASK) == ROREG)
 920878                         canon(p);
 921879         }
 922880         if ((p->n_su & RMASK) == RREG) {
 923881                 if (q->needs & NSPECIAL) {
<>924 -                        struct rspecial *s = nspecial(q);
  882+                        int rr = rspecial(q, NRIGHT);
925883 
<>926 -#ifdef MULTICLASS
 927 -                        if (s->right && s->right[0] != p->n_right->n_reg) {
  884+                        if (rr >= 0 && rr != p->n_right->n_reg) {
928885                                 rmove(p->n_right->n_reg,
<>929 -                                    s->right[0], TCLASS(p->n_right->n_su));
 930 -#else
 931 -                        if (s->right && s->right[0] != p->n_right->n_rall) {
 932 -                                rmove(p->n_right->n_rall,
 933 -                                    s->right[0], p->n_type);
 934 -#endif
 935 -// XXX                          p->n_right->n_rall = s->right[0];
 936 -                                p->n_right->n_rval = s->right[0];
  886+                                    rr, TCLASS(p->n_right->n_su));
  887+                                p->n_right->n_reg = rr;
  888+                                p->n_right->n_rval = rr;
937889                         }
 938890                 } else if ((q->rewrite & RRIGHT) &&
<>939 -#ifdef MULTICLASS
940891                     p->n_right->n_reg != p->n_reg) {
 941892                         rmove(p->n_right->n_reg, p->n_reg, TCLASS(p->n_su));
 942893                         p->n_right->n_reg = p->n_reg;
 943894                         p->n_right->n_reg = p->n_reg;
<>944 -#else
 945 -                    p->n_right->n_rall != p->n_rall) {
 946 -                        rmove(p->n_right->n_rall, p->n_rall, p->n_type);
 947 -                        p->n_right->n_rall = p->n_rall;
 948 -                        p->n_right->n_rval = p->n_rall;
 949 -#endif
950895                 }
 951896         }
 952897         if ((p->n_su & LMASK) == LREG) {
 953898                 if (q->needs & NSPECIAL) {
<>954 -                        struct rspecial *s = nspecial(q);
  899+                        int rr = rspecial(q, NLEFT);
955900 
<>956 -#ifdef MULTICLASS
 957 -                        if (s->left && s->left[0] != p->n_left->n_reg) {
 958 -                                rmove(p->n_left->n_reg, s->left[0],
  901+                        if (rr >= 0 && rr != p->n_left->n_reg) {
  902+                                rmove(p->n_left->n_reg, rr,
959903                                     TCLASS(p->n_left->n_su));
<>960 -#else
 961 -                        if (s->left && s->left[0] != p->n_left->n_rall) {
 962 -                                rmove(p->n_left->n_rall, s->left[0], p->n_type);
 963 -#endif
 964 -// XXX                          p->n_left->n_rall = s->left[0];
 965 -                                p->n_left->n_rval = s->left[0];
  904+                                p->n_left->n_reg = rr;
  905+                                p->n_left->n_rval = rr;
966906                         }
 967907                 } else if ((q->rewrite & RLEFT) &&
<>968 -#ifdef MULTICLASS
969908                     p->n_left->n_reg != p->n_reg) {
 970909                         rmove(p->n_left->n_reg, p->n_reg, TCLASS(p->n_su));
 971910                         p->n_left->n_reg = p->n_reg;
 972911                         p->n_left->n_rval = p->n_reg;
<>973 -#else
 974 -                    p->n_left->n_rall != p->n_rall) {
 975 -                        rmove(p->n_left->n_rall, p->n_rall, p->n_type);
 976 -                        p->n_left->n_rall = p->n_rall;
 977 -                        p->n_left->n_rval = p->n_rall;
 978 -#endif
979912                 }
 980913         }
 981914 
 982915         expand(p, cookie, q->cstring);
<>983 -#ifdef MULTICLASS
 984 -        if (callop(p->n_op) && p->n_reg != RETREG) {
 985 -                rmove(RETREG, p->n_reg, TCLASS(p->n_su));
 986 -#else
 987 -        if (callop(p->n_op) && p->n_rall != RETREG) {
 988 -                rmove(RETREG, p->n_rall, p->n_type);
 989 -#endif
  916+        if (callop(p->n_op) && p->n_reg != RETREG(TCLASS(p->n_su))) {
  917+                rmove(RETREG(TCLASS(p->n_su)), p->n_reg, TCLASS(p->n_su));
990918         } else if (q->needs & NSPECIAL) {
<>991 -                struct rspecial *s = nspecial(q);
  919+                int rr = rspecial(q, NRES);
992920 
<>993 -#ifdef MULTICLASS
 994 -                if (s->res && p->n_reg != s->res[0])
 995 -                        rmove(s->res[0], p->n_reg, TCLASS(p->n_su));
 996 -#else
 997 -                if (s->res && p->n_rall != s->res[0])
 998 -                        rmove(s->res[0], p->n_rall, p->n_type);
 999 -#endif
  921+                if (rr >= 0 && p->n_reg != rr)
  922+                        rmove(rr, p->n_reg, TCLASS(p->n_su));
1000923         }
 1001924         rewrite(p, q->rewrite);
 1002925 }
     
 !
14471370         ip->lineno = thisline;
 14481371         return ip;
 14491372 }
<_ 1373+
  1374+int
  1375+rspecial(struct optab *q, int what)
  1376+{
  1377+        struct rspecial *r = nspecial(q);
  1378+        while (r->op) {
  1379+                if (r->op == what)
  1380+                        return r->num;
  1381+                r++;
  1382+        }
  1383+        return -1;
  1384+}
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-25 06:06 +0100