Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.3
 
1.4
 
MAIN:gmcgarry:20071116001740
 
code.c
     
 !
_>51 -        printf("        .align %d\n", n);
  51+        printf("\t.align %d\n", n);
     
 !
<>67 -                printf("        .globl %s\n", c);
  67+                printf("\t.globl %s\n", c);
  68+#ifdef USE_GAS
  69+        printf("\t.type %s,@object\n", c);
  70+        printf("\t.size %s," CONFMT "\n", c, tsize(p->stype, p->sdf, p->ssue));
  71+#endif
     
 !
<>71 -
     
 !
<>84 - * helper for bfcode() to put register arguments on stack.
 85 - */
 86 -static void
 87 -argmove(struct symtab *s, int regno)
 88 -{
 89 -        NODE *p, *r;
 90 -
 91 -        s->sclass = PARAM;
 92 -        s->soffset = NOOFFSET;
 93 -
 94 -        oalloc(s, &passedargoff);
 95 -
 96 -        spname = s;
 97 -        p = buildtree(NAME, NIL, NIL);
 98 -        r = bcon(0);
 99 -        r->n_op = REG;
 100 -        r->n_rval = regno;
 101 -        r->n_type = p->n_type;
 102 -        r->n_sue = p->n_sue;
 103 -        r->n_df = p->n_df;
 104 -        ecode(buildtree(ASSIGN, p, r));
 105 -}
 106 -
 107 -/*
     
 !
<>112 -bfcode(struct symtab **a, int n)
  91+bfcode(struct symtab **sp, int cnt)
     
 !
<>114 -        int i, m;
  93+        NODE *p, *q;
  94+        int i, n;
     
 !
<>116 -        /* Passed arguments start 64 bits above the framepointer. */
 117 -        passedargoff = ARGINIT;
 118 -        
     
 !
<>121 -                for (i = 0; i < n; i++)
 122 -                        a[i]->soffset += SZPOINT(INT);
  98+                for (i = 0; i < cnt; i++)
  99+                        sp[i]->soffset += SZPOINT(INT);
     
 !
<>125 -        m = n <= 4 ? n : 4;
 126 -        
 127 -        for(i = 0; i < m; i++) {
 128 -            /*
 129 -            if(a[i]->stype == LONGLONG || a[i]->stype == ULONGLONG) {
 130 -                printf("longlong\n");
 131 -                argmove(a[i], A0+i);
  102+        /* recalculate the arg offset and create TEMP moves */
  103+        for (n = A0, i = 0; i < cnt; i++) {
  104+                if (n + szty(sp[i]->stype) <= A0 + MIPS_NARGREGS) {
  105+                        if (xtemps) {
  106+                                p = tempnode(0, sp[i]->stype,
  107+                                    sp[i]->sdf, sp[i]->ssue);
  108+                                spname = sp[i];
  109+                                q = block(REG, NIL, NIL,
  110+                                    sp[i]->stype, sp[i]->sdf, sp[i]->ssue);
  111+                                q->n_rval = n;
  112+                                p = buildtree(ASSIGN, p, q);
  113+                                sp[i]->soffset = p->n_left->n_lval;
  114+                                sp[i]->sflags |= STNODE;
  115+                        } else {
  116+                                // sp[i]->soffset += ARGINIT;
  117+                                spname = sp[i];
  118+                                q = block(REG, NIL, NIL,
  119+                                    sp[i]->stype, sp[i]->sdf, sp[i]->ssue);
  120+                                q->n_rval = n;
  121+                                p = buildtree(ASSIGN, buildtree(NAME, 0, 0), q);
  122+                        }
  123+                        ecomp(p);
  124+                } else {
  125+                        // sp[i]->soffset += ARGINIT;
  126+                        if (xtemps) {
  127+                                /* put stack args in temps if optimizing */
  128+                                spname = sp[i];
  129+                                p = tempnode(0, sp[i]->stype,
  130+                                    sp[i]->sdf, sp[i]->ssue);
  131+                                p = buildtree(ASSIGN, p, buildtree(NAME, 0, 0));
  132+                                sp[i]->soffset = p->n_left->n_lval;
  133+                                sp[i]->sflags |= STNODE;
  134+                                ecomp(p);
  135+                        }
  136+               
  137+                }
  138+                n += szty(sp[i]->stype);
  139+        }
     
 !
<>133 -                if(i+1 < 4) {
 134 -                    argmove(a[i], A0+i+1);
 135 -                }
 136 -                
 137 -                i++;            
 138 -                } else*/
 139 -            argmove(a[i], A0+i);
 140 -
 141 -        }
     
 !
<>205 - * n integer words of zeros
 206 - */
 207 -void
 208 -zecode(int n)
 209 -{
 210 -        printf("        .zero %d\n", n * (SZINT/SZCHAR));
 211 -//      inoff += n * SZINT;
 212 -}
 213 -
 214 -/*
     
 !
<> 242+
  243+static void
  244+moveargs(NODE **n, int *regp)
  245+{
  246+        NODE *r = *n;
  247+        NODE *t;
  248+        int sz;
  249+        int regnum;
  250+
  251+        if (r->n_op == CM) {
  252+                moveargs(&r->n_left, regp);
  253+                n = &r->n_right;
  254+                r = r->n_right;
  255+        }
  256+
  257+        regnum = *regp;
  258+        sz = szty(r->n_type);
  259+
  260+        if (regnum + sz <= A0 + MIPS_NARGREGS) {
  261+                t = block(REG, NIL, NIL, r->n_type, r->n_df, r->n_sue);
  262+                t->n_rval = regnum;
  263+                t = buildtree(ASSIGN, t, r);
  264+        } else {
  265+                t = block(FUNARG, r, NIL, r->n_type, r->n_df, r->n_sue);
  266+        }
  267+
  268+        *n = t;
  269+        *regp += sz;
  270+}
  271+
     
 !
<_ 279+        int regnum = A0;
  280+        moveargs(&p->n_right, &regnum);
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-09-30 17:53 +0200