Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.64
 
1.65
 
MAIN:ragge:20030912133056
 
reader.c
_>5959 void deltemp(NODE *p);
 6060 void optdump(struct interpass *ip);
 6161 void cvtemps(struct interpass *epil);
<>62 -static int findops(NODE *p);
 63 -static int relops(NODE *p);
 64 -static int asgops(NODE *p, int);
  62+int findops(NODE *p);
  63+int relops(NODE *p);
  64+int asgops(NODE *p, int);
6565 
<>66 -#define LTMP    1
 67 -#define RTMP    2
  66+#define LREG    001
  67+#define RREG    002
  68+#define LOREG   004
  69+#define ROREG   010
  70+#define LTEMP   020
  71+#define RTEMP   040
6872 
 6973 #define DELAYS 20
 7074 NODE *deltrees[DELAYS];
     
 !
331335 
 332336         switch (m = p->n_op) {
 333337 
<> 338+#if 0
334339         case ASSIGN:
 335340                 /*
 336341                  * For ASSIGN the left node must be directly addressable,
     
 !
361366 //printf("foo6 : %x\n", rv);
 362367                 if (rv < 0)
 363368                         goto nomat;
<>364 -                if (rv & RTMP)
  369+                if (rv & RREG)
365370                         order(p->n_right, INTAREG|INTBREG);
 366371                 q = &table[rv >> 2];
 367372 //printf("foo7\n");
     
 !
373378 //printf("foo4\n");
 374379 //fwalk(p, e2print, 0);
 375380                 goto cleanup;
<>376 -                
  381+#endif
  382+
377383         case PLUS:
 378384         case MINUS:
 379385         case AND:
     
 !
416422                                 goto again;
 417423                         goto nomat;
 418424                 }
<>419 -                if (rv & LTMP)
  425+                if (rv & LREG) {
  426+                        if (p->n_left->n_op == UNARY MUL) {
  427+                                offstar(p->n_left->n_left);
  428+                                goto again;
  429+                        }
420430                         order(p->n_left, INTAREG|INTBREG);
<> 431+                }
421432 //printf("newstyle ltmp %p\n", p);
<>422 -                if (rv & RTMP)
  433+                if (rv & RREG) {
  434+                        if (p->n_right->n_op == UNARY MUL) {
  435+                                offstar(p->n_right->n_left);
  436+                                goto again;
  437+                        }
423438                         order(p->n_right, INTAREG|INTBREG);
<> 439+                }
424440 //printf("newstyle rtmp %p\n", p);
 425441                 
 426442 
     
 !
432448                          * Be careful to avoid loops.
 433449                          * XXX - this is bad code!
 434450                          */
<>435 -                        if ((rv & LTMP) == 0 && istnode(p->n_left)) {
  451+                        if ((rv & LREG) == 0 && istnode(p->n_left)) {
436452                                 order(p->n_left, INTEMP);
 437453                                 goto again;
<>438 -                        } else if (!(rv & RTMP) &&istnode(p->n_right)) {
  454+                        } else if (!(rv & RREG) &&istnode(p->n_right)) {
439455                                 order(p->n_right, INTEMP);
 440456                                 goto again;
 441457                         }
     
 !
12621278                                 /* put left in temp, add to right */
 12631279                                 if (4 < mtchno) {
 12641280                                         mtchno = 4;
<>1265 -                                        rv = (ixp[i] << 2) | LTMP;
  1281+                                        rv = (ixp[i] << 2) | LREG;
12661282                                 }
 12671283                         } else if (q->needs & NDLEFT) {
 12681284                                 if (4 < mtchno) {
 12691285                                         mtchno = 4;
<>1270 -                                        rv = (ixp[i] << 2) | LTMP;
  1286+                                        rv = (ixp[i] << 2) | LREG;
12711287                                 }
 12721288                                 continue; /* Can't do anything else */
 12731289                         } else if (is3) {
 12741290                                 if (5 < mtchno) {
 12751291                                         mtchno = 5;
<>1276 -                                        rv = (ixp[i] << 2) | LTMP;
  1292+                                        rv = (ixp[i] << 2) | LREG;
12771293                                 }
 12781294                                 continue; /* Can't do anything else */
 12791295                         }
     
 !
12891305                                 /* put right in temp, add to left */
 12901306                                 if (4 < mtchno) {
 12911307                                         mtchno = 4;
<>1292 -                                        rv = (ixp[i] << 2) | RTMP;
  1308+                                        rv = (ixp[i] << 2) | RREG;
12931309                                 }
 12941310                         } else if (q->needs & NDRIGHT) {
 12951311                                 if (4 < mtchno) {
 12961312                                         mtchno = 4;
<>1297 -                                        rv = (ixp[i] << 2) | RTMP;
  1313+                                        rv = (ixp[i] << 2) | RREG;
12981314                                 }
 12991315                                 continue; /* Can't do anything */
 13001316                         } else if (is3) {
 13011317                                 if (5 < mtchno) {
 13021318                                         mtchno = 5;
<>1303 -                                        rv = (ixp[i] << 2) | RTMP;
  1319+                                        rv = (ixp[i] << 2) | RREG;
13041320                                 }
 13051321                                 continue; /* Can't do anything */
 13061322                         }
     
 !
13131329                         if (is3) {
 13141330                                 if (7 < mtchno) {
 13151331                                         mtchno = 7;
<>1316 -                                        rv = (ixp[i] << 2) | RTMP|LTMP;
  1332+                                        rv = (ixp[i] << 2) | RREG|LREG;
13171333                                 }
 13181334                         } else {
 13191335                                 if (6 < mtchno) {
 13201336                                         mtchno = 6;
<>1321 -                                        rv = (ixp[i] << 2) | RTMP|LTMP;
  1337+                                        rv = (ixp[i] << 2) | RREG|LREG;
13221338                                 }
 13231339                         }
 13241340                 }
 13251341         }
<>1326 -if (f2debug) { if (rv == -1) printf("findops failed\n"); else printf("findops entry %d, %s %s\n", rv >> 2, rv & RTMP ? "RTMP" : "", rv & LTMP ? "LTMP" : ""); }
  1342+if (f2debug) { if (rv == -1) printf("findops failed\n"); else printf("findops entry %d, %s %s\n", rv >> 2, rv & RREG ? "RREG" : "", rv & LREG ? "LREG" : ""); }
13271343         return rv;
 13281344 }
 13291345 
     
 !
13901406                          */
 13911407                         if (4 < mtchno) {
 13921408                                 mtchno = 4;
<>1393 -                                rv = (ixp[i] << 2) | LTMP;
  1409+                                rv = (ixp[i] << 2) | LREG;
13941410                         }
 13951411                         continue; /* nothing more to do */
 13961412                 }
     
 !
14031419                          */
 14041420                         if (4 < mtchno) {
 14051421                                 mtchno = 4;
<>1406 -                                rv = (ixp[i] << 2) | RTMP;
  1422+                                rv = (ixp[i] << 2) | RREG;
14071423                         }
 14081424                         continue; /* nothing more to do */
 14091425                 }
 14101426                 if (6 < mtchno) {
 14111427                         mtchno = 6;
<>1412 -                        rv = (ixp[i] << 2) | RTMP|LTMP;
  1428+                        rv = (ixp[i] << 2) | RREG|LREG;
14131429                 }
 14141430         }
<>1415 -if (f2debug) { if (rv == -1) printf("relops failed\n"); else printf("relops entry %d, %s %s\n", rv >> 2, rv & RTMP ? "RTMP" : "", rv & LTMP ? "LTMP" : ""); }
  1431+if (f2debug) { if (rv == -1) printf("relops failed\n"); else printf("relops entry %d, %s %s\n", rv >> 2, rv & RREG ? "RREG" : "", rv & LREG ? "LREG" : ""); }
14161432         return rv;
 14171433 }
 14181434 
     
 !
14781494                          * Left shape matched. Right node must be put into
 14791495                          * a temporary register.
 14801496                          */
<>1481 -                        return (ixp[i] << 2) | RTMP;
  1497+                        return (ixp[i] << 2) | RREG;
14821498                 }
 14831499         }
<>1484 -if (f2debug) { if (rv == -1) printf("asgops failed\n"); else printf("asgops entry %d, %s %s\n", rv >> 2, rv & RTMP ? "RTMP" : "", rv & LTMP ? "LTMP" : ""); }
  1500+if (f2debug) { if (rv == -1) printf("asgops failed\n"); else printf("asgops entry %d, %s %s\n", rv >> 2, rv & RREG ? "RREG" : "", rv & LREG ? "LREG" : ""); }
<_14851501         return rv;
 14861502 }
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 20:12 +0100