Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.9
 
1.10
 
MAIN:gmcgarry:20071222214626
 
local.c
_>260260 
 261261                         if (!ISPTR(m)) /* Pointers don't need to be conv'd */
 262262                             switch (m) {
<> 263+                        case BOOL:
  264+                                l->n_lval = l->n_lval != 0;
  265+                                break;
263266                         case CHAR:
 264267                                 l->n_lval = (char)val;
 265268                                 break;
     
 !
404407 spalloc(NODE *t, NODE *p, OFFSZ off)
 405408 {
 406409         NODE *sp;
<> 410+        int nbytes = off / SZCHAR;
407411 
<>408 -        if ((off % SZINT) == 0)
 409 -                pbuildtree(MUL, p, bcon(off/SZINT));
 410 -        else if ((off % SZSHORT) == 0) {
 411 -                p = buildtree(MUL, p, bcon(off/SZSHORT));
 412 -                p = buildtree(PLUS, p, bcon(1));
 413 -                p = buildtree(RS, p, bcon(1));
 414 -        } else if ((off % SZCHAR) == 0) {
 415 -                p = buildtree(MUL, p, bcon(off/SZCHAR));
 416 -                p = buildtree(PLUS, p, bcon(3));
 417 -                p = buildtree(RS, p, bcon(2));
 418 -        } else
 419 -                cerror("roundsp");
  412+        p = buildtree(MUL, p, bcon(nbytes));
  413+        p = buildtree(PLUS, p, bcon(7));
  414+        p = buildtree(AND, p, bcon(~7));
420415 
<>421 -        /* save the address of sp */
 422 -        sp = block(REG, NIL, NIL, PTR+INT, t->n_df, t->n_sue);
 423 -        sp->n_rval = SP;
 424 -        t->n_type = sp->n_type;
 425 -        ecomp(buildtree(ASSIGN, t, sp)); /* Emit! */
 426 -
427416         /* subtract the size from sp */
 428417         sp = block(REG, NIL, NIL, p->n_type, 0, 0);
 429418         sp->n_lval = 0;
 430419         sp->n_rval = SP;
 431420         ecomp(buildtree(MINUSEQ, sp, p));
<> 421+
  422+        /* save the address of sp */
  423+        sp = block(REG, NIL, NIL, PTR+INT, t->n_df, t->n_sue);
  424+        sp->n_rval = SP;
  425+        t->n_type = sp->n_type;
  426+        ecomp(buildtree(ASSIGN, t, sp)); /* Emit! */
432427 }
 433428 
 434429 /*
     
 !
438433 void
 439434 ninval(CONSZ off, int fsz, NODE *p)
 440435 {
<>441 -        union { float f; double d; long double l; int i[3]; } u;
  436+        union { float f; double d; int i[2]; } u;
442437         struct symtab *q;
 443438         TWORD t;
 444439 #ifndef USE_GAS
     
 !
459454         case LONGLONG:
 460455         case ULONGLONG:
 461456 #ifdef USE_GAS
<>462 -                printf("\t.dword 0x%llx\n", (long long)p->n_lval);
  457+                printf("\t.dword %lld\n", (long long)p->n_lval);
463458 #else
 464459                 i = p->n_lval >> 32;
 465460                 j = p->n_lval & 0xffffffff;
     
 !
483478                 /* FALLTHROUGH */
 484479         case INT:
 485480         case UNSIGNED:
<>486 -                printf("\t.word 0x%x", (int)p->n_lval);
  481+                printf("\t.word " CONFMT, (CONSZ)p->n_lval);
487482                 if ((q = p->n_sp) != NULL) {
 488483                         if ((q->sclass == STATIC && q->slevel > 0) ||
 489484                             q->sclass == ILABEL) {
     
 !
495490                 break;
 496491         case SHORT:
 497492         case USHORT:
<>498 -                printf("\t.half 0x%x\n", (int)p->n_lval & 0xffff);
  493+                printf("\t.half %d\n", (int)p->n_lval & 0xffff);
499494                 break;
 500495         case CHAR:
 501496         case UCHAR:
     
 !
505500         case DOUBLE:
 506501                 u.d = (double)p->n_dcon;
 507502                 if (bigendian) {
<>508 -                        printf("\t.word\t0x%x\n", u.i[0]);
 509 -                        printf("\t.word\t0x%x\n", u.i[1]);
  503+                        printf("\t.word\t%d\n", u.i[0]);
  504+                        printf("\t.word\t%d\n", u.i[1]);
510505                 } else {
<>511 -                        printf("\t.word\t0x%x\n", u.i[1]);
 512 -                        printf("\t.word\t0x%x\n", u.i[0]);
  506+                        printf("\t.word\t%d\n", u.i[1]);
  507+                        printf("\t.word\t%d\n", u.i[0]);
513508                 }
 514509                 break;
 515510         case FLOAT:
     
 !
617612 void
 618613 setloc1(int locc)
 619614 {
<>620 -        if ((locc == lastloc) || (lastloc == DATA && locc == STRNG) ||
 621 -            (locc == STRNG && lastloc == DATA))
  615+        if (locc == lastloc && locc != STRNG)
622616                 return;
<>623 -        lastloc = locc;
 624 -        printf("\t.%s\n", loctbl[locc]);
  617+        if (locc == DATA && lastloc == STRNG)
  618+                return;
  619+
  620+        if (locc != lastloc) {
  621+                lastloc = locc;
  622+                printf("\t.%s\n", loctbl[locc]);
  623+        }
  624+
  625+        if (locc == STRNG)
  626+                printf("\t.align 2\n");
<_625627 }
 626628 
 627629 /*
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-02 13:42 +0200