Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.25
 
1.26
 
MAIN:ragge:20101002094520
 
code.c
_>548548                 cl = nsse < 8 ? SSE : SSEMEM;
 549549         } else if (t == LDOUBLE) {
 550550                 cl = X87; /* XXX */
<>551 -        } else if (t == STRTY) {
  551+        } else if (t == STRTY || t == UNIONTY) {
552552                 /* XXX no SSEOP handling */
 553553                 if ((tsize(t, df, ap) > 2*SZLONG) ||
 554554                     (attr_find(ap, GCC_ATYP_PACKED) != NULL))
     
 !
560560         return cl;
 561561 }
 562562 
<>563 -static void
  563+static NODE *
564564 argput(NODE *p)
 565565 {
 566566         NODE *q;
 567567         int typ, r, ssz;
 568568 
<> 569+        if (p->n_op == CM) {
  570+                p->n_left = argput(p->n_left);
  571+                p->n_right = argput(p->n_right);
  572+                return p;
  573+        }
  574+
569575         /* first arg may be struct return pointer */
 570576         /* XXX - check if varargs; setup al */
 571577         switch (typ = argtyp(p->n_type, p->n_df, p->n_ap)) {
 572578         case INTEGER:
 573579         case SSE:
<>574 -                q = talloc();
 575 -                *q = *p;
576580                 if (typ == SSE)
 577581                         r = XMM0 + nsse++;
 578582                 else
 579583                         r = argregsi[ngpr++];
<>580 -                q = movtoreg(q, r);
 581 -                *p = *q;
 582 -                nfree(q);
  584+                p = movtoreg(p, r);
583585                 break;
<> 586+
584587         case X87:
<>585 -                q = talloc();
 586 -                *q = *p;
587588                 r = nrsp;
 588589                 nrsp += SZLDOUBLE;
<>589 -                q = movtomem(q, r, STKREG);
 590 -                *p = *q;
 591 -                nfree(q);
  590+                p = movtomem(p, r, STKREG);
592591                 break;
 593592 
 594593         case INTMEM:
<>595 -                q = talloc();
 596 -                *q = *p;
597594                 r = nrsp;
 598595                 nrsp += SZLONG;
<>599 -                q = movtomem(q, r, STKREG);
 600 -                *p = *q;
 601 -                nfree(q);
  596+                p = movtomem(p, r, STKREG);
602597                 break;
 603598 
 604599         case STRREG: /* Struct in registers */
     
 !
608603                 if (ssz <= SZLONG) {
 609604                         q = cast(p->n_left, LONG+PTR, 0);
 610605                         q = buildtree(UMUL, q, NIL);
<>611 -                        q = movtoreg(q, argregsi[ngpr++]);
 612 -                        *p = *q;
 613 -                        nfree(q);
  606+                        p = movtoreg(q, argregsi[ngpr++]);
614607                 } else if (ssz <= SZLONG*2) {
 615608                         NODE *qt, *q1, *q2, *ql, *qr;
 616609 
     
 !
623616                         ql = buildtree(COMOP, ql, qr);
 624617                         qr = buildtree(UMUL, buildtree(PLUS, q2, bcon(1)), NIL);
 625618                         qr = movtoreg(qr, argregsi[ngpr++]);
<>626 -                        q = buildtree(COMOP, ql, qr);
 627 -                        *p = *q;
 628 -                        nfree(q);
  619+                        p = buildtree(COMOP, ql, qr);
629620                 } else
 630621                         cerror("STRREG");
 631622                 break;
 632623 
<>633 -        case STRMEM:
 634 -                /* Struct moved to memory */
  624+        case STRMEM: {
  625+                struct symtab s;
  626+                NODE *l, *t;
  627+
  628+                q = buildtree(UMUL, p->n_left, NIL);
  629+
  630+                s.stype = p->n_type;
  631+                s.squal = 0;
  632+                s.sdf = p->n_df;
  633+                s.sap = p->n_ap;
  634+                s.soffset = nrsp;
  635+                s.sclass = AUTO;
  636+
  637+                nrsp += tsize(p->n_type, p->n_df, p->n_ap);
  638+
  639+                l = block(REG, NIL, NIL, PTR+STRTY, 0, 0);
  640+                l->n_lval = 0;
  641+                regno(l) = STKREG;
  642+
  643+                t = block(NAME, NIL, NIL, p->n_type, p->n_df, p->n_ap);
  644+                t->n_sp = &s;
  645+                t = stref(block(STREF, l, t, 0, 0, 0));
  646+
  647+                t = (buildtree(ASSIGN, t, q));
  648+                nfree(p);
  649+                p = t->n_left;
  650+                nfree(t);
  651+                break;
  652+                }
  653+
635654         default:
 636655                 cerror("argument %d", typ);
 637656         }
<> 657+        return p;
638658 }
 639659 
<> 660+/*
  661+ * Sort arglist so that register assignments ends up last.
  662+ */
  663+static int
  664+argsort(NODE *p)
  665+{
  666+        NODE *q;
  667+        int rv = 0;
640668 
<> 669+        if (p->n_op != CM)
  670+                return rv;
  671+        if (p->n_right->n_op == ASSIGN && p->n_right->n_left->n_op == REG) {
  672+                if (p->n_left->n_op == CM &&
  673+                    p->n_left->n_right->n_op == STASG) {
  674+                        q = p->n_left->n_right;
  675+                        p->n_left->n_right = p->n_right;
  676+                        p->n_right = q;
  677+                        rv = 1;
  678+                } else if (p->n_left->n_op == STASG) {
  679+                        q = p->n_left;
  680+                        p->n_left = p->n_right;
  681+                        p->n_right = q;
  682+                        rv = 1;
  683+                }
  684+        }
  685+        return rv | argsort(p->n_left);
  686+}
  687+
641688 /*
 642689  * Called with a function call with arguments as argument.
 643690  * This is done early in buildtree() and only done once.
     
 !
657704                 if (ssz > 2*SZLONG)
 658705                         ngpr++;
 659706         }
<>660 -        listf(p->n_right, argput);
661707 
<> 708+        /* Convert just regs to assign insn's */
  709+        p->n_right = argput(p->n_right);
  710+
  711+        /* Must sort arglist so that STASG ends up first */
  712+        /* This avoids registers being clobbered */
  713+        while (argsort(p->n_right))
  714+                ;
  715+
<_662716         /* Check if there are varargs */
 663717         if (nsse || l->n_df == NULL || l->n_df->dfun == NULL) {
 664718                 ; /* Need RAX */
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-11-01 15:08 +0100