Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.12
 
1.13
 
MAIN:ragge:20090620072300
 
code.c
_>272272  *      void *reg_save_area;
 273273  * } __builtin_va_list[1];
 274274  */
<> 275+
275276 static char *gp_offset, *fp_offset, *overflow_arg_area, *reg_save_area;
<> 277+
276278 void
 277279 bjobcode()
 278280 {
     
 !
351353  *      ((long *)(l->gp_offset >= 48 ?
 352354  *          l->overflow_arg_area += 8, l->overflow_arg_area :
 353355  *          l->gp_offset += 8, l->reg_save_area + l->gp_offset))[-1]
<> 356+ * ...or similar for floats.
354357  */
 355358 static NODE *
<>356 -bva(NODE *ap)
  359+bva(NODE *ap, TWORD dt, char *ot, int addto, int max)
357360 {
 358361         NODE *cm1, *cm2, *gpo, *ofa, *l1, *qc;
<> 362+        TWORD nt;
359363 
 360364         ofa = structref(ccopy(ap), STREF, overflow_arg_area);
<>361 -        l1 = buildtree(PLUSEQ, ccopy(ofa), bcon(8));
  365+        l1 = buildtree(PLUSEQ, ccopy(ofa), bcon(addto));
362366         cm1 = buildtree(COMOP, l1, ofa);
 363367 
<>364 -        gpo = structref(ccopy(ap), STREF, gp_offset);
 365 -        l1 = buildtree(PLUSEQ, ccopy(gpo), bcon(8));
  368+        gpo = structref(ccopy(ap), STREF, ot);
  369+        l1 = buildtree(PLUSEQ, ccopy(gpo), bcon(addto));
366370         cm2 = buildtree(COMOP, l1, buildtree(PLUS, ccopy(gpo),
 367371             structref(ccopy(ap), STREF, reg_save_area)));
 368372         qc = buildtree(QUEST,
<>369 -            buildtree(GE, gpo, bcon(48)),
  373+            buildtree(GE, gpo, bcon(max)),
370374             buildtree(COLON, cm1, cm2));
<>371 -        l1 = block(NAME, NIL, NIL, LONG|PTR, 0, MKSUE(LONG));
  375+
  376+        nt = (dt == DOUBLE ? DOUBLE : LONG);
  377+        l1 = block(NAME, NIL, NIL, nt|PTR, 0, MKSUE(nt));
372378         l1 = buildtree(CAST, l1, qc);
<> 379+        qc = l1->n_right;
373380         nfree(l1->n_left);
 374381         nfree(l1);
<>375 -        return buildtree(UMUL, buildtree(PLUS, qc, bcon(-8)), NIL);
  382+
  383+        qc = buildtree(UMUL, buildtree(PLUS, qc, bcon(-addto)), NIL);
  384+
  385+        l1 = block(NAME, NIL, NIL, dt, 0, MKSUE(BTYPE(dt)));
  386+        l1 = buildtree(CAST, l1, qc);
  387+        qc = l1->n_right;
  388+        nfree(l1->n_left);
  389+        nfree(l1);
  390+
  391+        return qc;
376392 }
 377393 
 378394 NODE *
 379395 amd64_builtin_va_arg(NODE *f, NODE *a)
 380396 {
 381397         NODE *ap, *r;
<> 398+        TWORD dt;
382399 
 383400         /* check num args and type */
 384401         if (a == NULL || a->n_op != CM || a->n_left->n_op == CM ||
 385402             !ISPTR(a->n_left->n_type) || a->n_right->n_op != TYPE)
 386403                 goto bad;
 387404 
 388405         ap = a->n_left;
<>389 -        if (ap->n_type <= ULONGLONG || ISPTR(ap->n_type)) {
  406+        dt = a->n_right->n_type;
  407+        if (dt <= ULONGLONG || ISPTR(dt)) {
390408                 /* type might be in general register */
<>391 -                /* we create a ?: construction of it */
 392 -                r = bva(ap);
  409+                r = bva(ap, dt, gp_offset, 8, 48);
  410+        } else if (dt == FLOAT || dt == DOUBLE) {
  411+                /* Float are promoted to double here */
  412+                if (dt == FLOAT)
  413+                        dt = DOUBLE;
  414+                r = bva(ap, dt, fp_offset, 16, RSASZ/SZCHAR);
393415         } else {
<>394 -                cerror("amd64_builtin_va_arg");
 395 -                goto bad; /* XXX */
  416+                uerror("amd64_builtin_va_arg not supported type");
  417+                goto bad;
396418         }
 397419         tfree(a);
 398420         tfree(f);
     
 !
403425 }
 404426 
 405427 NODE *
<>406 -amd64_builtin_va_end(NODE *f, NODE *a) { cerror("amd64_builtin_va_end"); return NULL; }
  428+amd64_builtin_va_end(NODE *f, NODE *a)
  429+{
  430+        tfree(f);
  431+        tfree(a);
  432+        return bcon(0); /* nothing */
  433+}
<_407434 
 408435 NODE *
 409436 amd64_builtin_va_copy(NODE *f, NODE *a) { cerror("amd64_builtin_va_copy"); return NULL; }
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-03 01:52 +0200