Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.4
 
1.5
 
MAIN:gmcgarry:20071126044436
 
local.c
_>3535 
 3636 static int inbits, inval;
 3737 
<>38 -#ifdef MIPS_BIGENDIAN
 39 -/*
 40 - * If we're big endian, then all OREG loads of a type
 41 - * larger than the destination, must have the
 42 - * offset changed to point to the correct bytes in memory.
 43 - */
 44 -static NODE *
 45 -offchg(NODE *p)
 46 -{
 47 -        NODE *l = p->n_left;
 48 -
 49 -        if (p->n_op != SCONV)
 50 -                return;
 51 -
 52 -        switch (l->n_type) {
 53 -        case SHORT:
 54 -        case USHORT:
 55 -                if (DEUNSIGN(p->n_type) == CHAR)
 56 -                        l->n_lval += 1;
 57 -                break;
 58 -        case LONG:
 59 -        case ULONG:
 60 -        case INT:
 61 -        case UNSIGNED:
 62 -                if (DEUNSIGN(p->n_type) == CHAR)
 63 -                        l->n_lval += 3;
 64 -                else if (DEUNSIGNED(p->n_type) == SHORT)
 65 -                        l->n_lval += 2;
 66 -                break;
 67 -        case LONGLONG:
 68 -        case ULONGLONG:
 69 -                if (DEUNSIGN(p->n_type) == CHAR)
 70 -                        l->n_lval += 7;
 71 -                else if (DEUNSIGNED(p->n_type) == SHORT)
 72 -                        l->n_lval += 6;
 73 -                else if (DEUNSIGN(p->n_type) == INT ||
 74 -                    DEUNSIGN(p->n_type) == LONG)
 75 -                        p->n_lval += 4;
 76 -        default:
 77 -                comperr("offchg: unknown type");
 78 -                break;
 79 -        }
 80 -
 81 -        return p;
 82 -}
 83 -#endif
 84 -
8538 /* this is called to do local transformations on
 8639  * an expression tree preparitory to its being
 8740  * written out in intermediate code.
     
 !
198151                         return l;
 199152                 }
 200153 
<>201 -#ifdef MIPS_BIGENDIAN
 202 -                /*
 203 -                 * If we're big endian, then all OREG loads of a type
 204 -                 * larger than the destination, must have the
 205 -                 * offset changed to point to the correct bytes in memory.
 206 -                 */
 207 -                if (l->n_type == OREG)
 208 -                        p = offchg(p);
 209 -#endif
 210 -
211154                 if ((p->n_type & TMASK) == 0 && (l->n_type & TMASK) == 0 &&
 212155                     btdims[p->n_type].suesize == btdims[l->n_type].suesize) {
 213156                         if (p->n_type != FLOAT && p->n_type != DOUBLE &&
     
 !
418361         struct symtab *q;
 419362         TWORD t;
 420363 #ifndef USE_GAS
<>421 -        int i;
  364+        int i, j;
422365 #endif
 423366 
 424367         t = p->n_type;
     
 !
437380 #ifdef USE_GAS
 438381                 printf("\t.dword 0x%llx\n", (long long)p->n_lval);
 439382 #else
<>440 -                i = (p->n_lval >> 32);
 441 -                p->n_lval &= 0xffffffff;
  383+                i = p->n_lval >> 32;
  384+                j = p->n_lval & 0xffffffff;
442385                 p->n_type = INT;
<>443 -                ninval(off, 32, p);
 444 -                p->n_lval = i;
 445 -                ninval(off+32, 32, p);
  386+                if (bigendian) {
  387+                        p->n_lval = j;
  388+                        ninval(off, 32, p);
  389+                        p->n_lval = i;
  390+                        ninval(off+32, 32, p);
  391+                } else {
  392+                        p->n_lval = i;
  393+                        ninval(off, 32, p);
  394+                        p->n_lval = j;
  395+                        ninval(off+32, 32, p);
  396+                }
<_446397 #endif
 447398                 break;
 448399         case BOOL:
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-25 01:06 +0100