Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.287
 
1.288
 
MAIN:ragge:20140601113352
 
reader.c
_>8181 void saveip(struct interpass *ip);
 8282 void deltemp(NODE *p, void *);
 8383 static void cvtemps(struct interpass *ipole, int op, int off);
<>84 -NODE *store(NODE *);
8584 static void fixxasm(struct p2env *);
 8685 
 8786 static void gencode(NODE *p, int cookie);
     
 !
184183  * a new place, and remove the move-to-temp statement.
 185184  */
 186185 static int
<>187 -stkarg(int tnr, int (*soff)[2])
  186+stkarg(int tnr, int *soff)
188187 {
 189188         struct p2env *p2e = &p2env;
 190189         struct interpass *ip;
     
 !
219218                     p->n_left->n_op == PLUS &&
 220219                     p->n_left->n_left->n_op == REG &&
 221220                     p->n_left->n_right->n_op == ICON) {
<>222 -                        soff[0][0] = regno(p->n_left->n_left);
 223 -                        soff[0][1] = (int)p->n_left->n_right->n_lval;
  221+                        soff[0] = (int)p->n_left->n_right->n_lval;
224222                 } else if (p->n_op == OREG) {
<>225 -                        soff[0][0] = regno(p);
 226 -                        soff[0][1] = (int)p->n_lval;
  223+                        soff[0] = (int)p->n_lval;
227224                 } else
 228225                         comperr("stkarg: bad arg");
 229226                 tfree(ip->ip_node);
     
 !
240237 static void
 241238 findaof(NODE *p, void *arg)
 242239 {
<>243 -        int (*aof)[2] = arg;
  240+        int *aof = arg;
244241         int tnr;
 245242 
 246243         if (p->n_op != ADDROF || p->n_left->n_op != TEMP)
 247244                 return;
 248245         tnr = regno(p->n_left);
<>249 -        if (aof[tnr][0])
  246+        if (aof[tnr])
250247                 return; /* already gotten stack address */
 251248         if (stkarg(tnr, &aof[tnr]))
 252249                 return/* argument was on stack */
<>253 -        aof[tnr][0] = FPREG;
 254 -        aof[tnr][1] = BITOOR(freetemp(szty(p->n_left->n_type)));
  250+        aof[tnr] = freetemp(szty(p->n_left->n_type));
255251 }
 256252 
 257253 /*
     
 !
327323 {
 328324         void deljumps(struct p2env *);
 329325         struct p2env *p2e = &p2env;
<>330 -        int (*addrp)[2];
  326+        int *addrp;
331327         MARK mark;
 332328 
 333329         if (ip->type == IP_PROLOG) {
     
 !
683679         return rv;
 684680 }
 685681 
<>686 -/*
 687 - * Store a given subtree in a temporary location.
 688 - * Return an OREG node where it is located.
 689 - */
 690 -NODE *
 691 -store(NODE *p)
 692 -{
 693 -        extern struct interpass *storesave;
 694 -        struct interpass *ip;
 695 -        NODE *q, *r;
 696 -        int s;
 697 -
 698 -        s = BITOOR(freetemp(szty(p->n_type)));
 699 -        q = mklnode(OREG, s, FPREG, p->n_type);
 700 -        r = mklnode(OREG, s, FPREG, p->n_type);
 701 -        ip = ipnode(mkbinode(ASSIGN, q, p, p->n_type));
 702 -
 703 -        storesave = ip;
 704 -        return r;
 705 -}
 706 -
707682 #ifdef PCC_DEBUG
 708683 #define CDEBUG(x) if (c2debug) printf x
 709684 #else
     
 !
876851         if (i > NRESC)
 877852                 comperr("allo: too many allocs");
 878853         if (q->needs & NTMASK) {
<> 854+#ifdef  MYALLOTEMP
  855+                MYALLOTEMP(resc[i], stktemp);
  856+#else
879857                 resc[i].n_op = OREG;
 880858                 resc[i].n_lval = stktemp;
 881859                 resc[i].n_rval = FPREG;
 882860                 resc[i].n_su = p->n_su; /* ??? */
 883861                 resc[i].n_name = "";
<> 862+#endif
884863         }
 885864 }
 886865 
     
 !
11341113 void
 11351114 deltemp(NODE *p, void *arg)
 11361115 {
<>1137 -        int (*aor)[2] = arg;
 1138 -        NODE *l, *r;
  1116+        int *aor = arg;
  1117+        NODE *l;
11391118 
 11401119         if (p->n_op == TEMP) {
<>1141 -                if (aor[regno(p)][0] == 0) {
  1120+                if (aor[regno(p)] == 0) {
11421121                         if (xtemps)
 11431122                                 return;
<>1144 -                        aor[regno(p)][0] = FPREG;
 1145 -                        aor[regno(p)][1] = BITOOR(freetemp(szty(p->n_type)));
  1123+                        aor[regno(p)] = freetemp(szty(p->n_type));
11461124                 }
<>1147 -                l = mklnode(REG, 0, aor[regno(p)][0], INCREF(p->n_type));
 1148 -                r = mklnode(ICON, aor[regno(p)][1], 0, INT);
 1149 -                p->n_left = mkbinode(PLUS, l, r, INCREF(p->n_type));
 1150 -                p->n_op = UMUL;
  1125+                storemod(p, aor[regno(p)]);
11511126         } else if (p->n_op == ADDROF && p->n_left->n_op == OREG) {
 11521127                 p->n_op = PLUS;
 11531128                 l = p->n_left;
     
 !
13301305  * allocate k integers worth of temp space
 13311306  * we also make the convention that, if the number of words is
 13321307  * more than 1, it must be aligned for storing doubles...
<>1333 - * Returns bits offset from base register.
 1334 - * XXX - redo this.
  1308+ * Returns bytes offset from base register.
13351309  */
 13361310 int
 13371311 freetemp(int k)
 13381312 {
<>1339 -#ifndef BACKTEMP
 1340 -        int t;
  1313+        int t, al, sz;
13411314 
<>1342 -        if (k > 1) {
 1343 -                SETOFF(p2autooff, ALDOUBLE/ALCHAR);
 1344 -        } else {
 1345 -                SETOFF(p2autooff, ALINT/ALCHAR);
 1346 -        }
  1315+        al = (k > 1 ? ALDOUBLE/ALCHAR : ALINT/ALCHAR);
  1316+        sz = k * (SZINT/SZCHAR);
13471317 
<> 1318+#ifndef BACKTEMP
  1319+        SETOFF(p2autooff, al);
13481320         t = p2autooff;
<>1349 -        p2autooff += k*(SZINT/SZCHAR);
  1321+        p2autooff += sz;
  1322+#else
  1323+        p2autooff += sz;
  1324+        SETOFF(p2autooff, al);
  1325+        t = ( -p2autooff );
  1326+#endif
13501327         if (p2autooff > p2maxautooff)
 13511328                 p2maxautooff = p2autooff;
 13521329         return (t);
<> 1330+}
13531331 
<>1354 -#else
 1355 -        p2autooff += k*(SZINT/SZCHAR);
 1356 -        if (k > 1) {
 1357 -                SETOFF(p2autooff, ALDOUBLE/ALCHAR);
 1358 -        } else {
 1359 -                SETOFF(p2autooff, ALINT/ALCHAR);
 1360 -        }
  1332+NODE *
  1333+storenode(TWORD t, int off)
  1334+{
  1335+        NODE *p;
13611336 
<>1362 -        if (p2autooff > p2maxautooff)
 1363 -                p2maxautooff = p2autooff;
 1364 -        return( -p2autooff );
 1365 -#endif
  1337+        p = talloc();
  1338+        p->n_type = t;
  1339+        storemod(p, off);
  1340+        return p;
13661341 }
 13671342 
<> 1343+#ifndef MYSTOREMOD
  1344+void
  1345+storemod(NODE *q, int off)
  1346+{
  1347+        NODE *l, *r, *p;
  1348+
  1349+        l = mklnode(REG, 0, FPREG, INCREF(q->n_type));
  1350+        r = mklnode(ICON, off, 0, INT);
  1351+        p = mkbinode(PLUS, l, r, INCREF(q->n_type));
  1352+        q->n_op = UMUL;
  1353+        q->n_left = p;
  1354+        q->n_rval = q->n_su = 0;
  1355+}
  1356+#endif
  1357+
13681358 NODE *
 13691359 mklnode(int op, CONSZ lval, int rval, TWORD type)
 13701360 {
     
 !
15541544                 q = p->n_left;
 15551545                 if (optype(q->n_op) == LTYPE) {
 15561546                         if (q->n_op == TEMP) {
<>1557 -                                ooff = BITOOR(freetemp(szty(t)));
  1547+                                ooff = freetemp(szty(t));
15581548                                 cvtemps(ip, q->n_rval, ooff);
 15591549                         } else if (q->n_op == REG)
 15601550                                 comperr("xasm m and reg");
     
 !
16531643 {
 16541644         if (p->n_op != TEMP || p->n_rval != xasnum)
 16551645                 return;
<>1656 -        p->n_op = OREG;
 1657 -        p->n_rval = FPREG;
 1658 -        p->n_lval = xoffnum;
  1646+        storemod(p, xoffnum);
<_16591647 }
 16601648 
 16611649 /*
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-31 15:59 +0100