Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.8
 
1.9
 
MAIN:ragge:20090524192052
 
code.c
_>3030 
 3131 # include "pass1.h"
 3232 
<>33 -static int nsse, ngpr;
  33+static int nsse, ngpr, nrsp;
3434 enum { INTEGER = 1, INTMEM, SSE, SSEMEM, X87, STRREG, STRMEM };
 3535 static const int argregsi[] = { RDI, RSI, RDX, RCX, R09, R08 };
 3636 
     
 !
146146 
 147147         /* recalculate the arg offset and create TEMP moves */
 148148         /* Always do this for reg, even if not optimizing, to free arg regs */
<> 149+        nsse = ngpr = 0;
  150+        nrsp = ARGINIT;
149151         for (i = 0; i < cnt; i++) {
 150152                 sp = s[i];
 151153 
     
 !
166168                         sp->sflags |= STNODE;
 167169                         ecomp(buildtree(ASSIGN, p, r));
 168170                         break;
<> 171+
  172+                case INTMEM:
  173+                        sp->soffset = nrsp;
  174+                        nrsp += SZLONG;
  175+                        if (xtemps) {
  176+                                p = tempnode(0, sp->stype, sp->sdf, sp->ssue);
  177+                                p = buildtree(ASSIGN, p, nametree(sp));
  178+                                sp->soffset = regno(p->n_left);
  179+                                sp->sflags |= STNODE;
  180+                                ecomp(p);
  181+                        }
  182+                        break;
  183+
169184                 default:
<>170 -                        cerror("bfcode");
  185+                        cerror("bfcode: %d", typ);
171186                 }
 172187         }
 173188 }
     
 !
203218 {
 204219         NODE *r;
 205220 
<>206 -        r = block(REG, NIL, NIL, p->n_type, 0, 0);
  221+        r = block(REG, NIL, NIL, p->n_type, p->n_df, p->n_sue);
207222         regno(r) = rno;
 208223         return clocal(buildtree(ASSIGN, r, p));
 209224 
 210225 
<> 226+static NODE *
  227+movtomem(NODE *p, int off)
  228+{
  229+        struct symtab s;
  230+        NODE *r, *l;
211231 
<> 232+        s.stype = p->n_type;
  233+        s.sdf = p->n_df;
  234+        s.ssue = p->n_sue;
  235+        s.soffset = off;
  236+
  237+        l = block(REG, NIL, NIL, PTR+STRTY, 0, 0);
  238+        l->n_lval = 0;
  239+        regno(l) = STKREG;
  240+
  241+        r = block(NAME, NIL, NIL, p->n_type, p->n_df, p->n_sue);
  242+        r->n_sp = &s;
  243+        r = stref(block(STREF, l, r, 0, 0, 0));
  244+
  245+        return clocal(buildtree(ASSIGN, r, p));
  246+
  247+
  248+
212249 /*
 213250  * AMD64 parameter classification.
 214251  */
     
 !
217254 {
 218255         int cl = 0;
 219256 
<>220 -        if (t <= ULONG) {
  257+        if (t <= ULONG || ISPTR(t)) {
221258                 cl = ngpr < 6 ? INTEGER : INTMEM;
 222259         } else if (t == FLOAT || t == DOUBLE) {
 223260                 cl = nsse < 8 ? SSE : SSEMEM;
     
 !
257294         case X87:
 258295                 cerror("no long double yet");
 259296                 break;
<> 297+
  298+        case INTMEM:
  299+                q = talloc();
  300+                *q = *p;
  301+                r = nrsp;
  302+                nrsp += SZLONG;
  303+                q = movtomem(q, r);
  304+                *p = *q;
  305+                nfree(q);
  306+                break;
  307+
260308         case STRMEM:
 261309                 /* Struct moved to memory */
 262310         case STRREG:
 263311                 /* Struct in registers */
 264312         default:
<>265 -                cerror("struct argument");
  313+                cerror("argument %d", typ);
266314         }
 267315 }
 268316 
     
 !
277325 {
 278326         NODE *l, *r;
 279327 
<>280 -        nsse = ngpr = 0;
  328+        nsse = ngpr = nrsp = 0;
<_281329         listf(p->n_right, argput);
 282330 
 283331         /* Always emit number of SSE regs used */
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-07-10 20:19 +0200