Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 267

Show
Ignore:
Timestamp:
11/23/09 04:01:38 (15 years ago)
Author:
walter
Message:

bugzilla 3496

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/backend/cgelem.c

    r266 r267  
    33863386    int sz; 
    33873387 
    33883388    if (e1->Eoper == OPu16_32 && e2->EV.Vulong <= (targ_ulong) SHORTMASK || 
    33893389         e1->Eoper == OPshtlng && 
    33903390         e2->EV.Vlong == (targ_short) e2->EV.Vlong) 
    33913391    { 
    33923392        tym = (uns || e1->Eoper == OPu16_32) ? TYushort : TYshort; 
    33933393        e->E2 = el_una(OPlngsht,tym,e2); 
    33943394        goto L2; 
    33953395    } 
    33963396 
    33973397    /* Try to convert to byte/word comparison for ((x & c)==d) 
    33983398       when mask c essentially casts x to a smaller type 
    33993399     */ 
    34003400    if (OPTIMIZER && 
    34013401        e1->Eoper == OPand && 
    34023402        e1->E2->Eoper == OPconst && 
    34033403        (sz = tysize(e2->Ety)) > CHARSIZE) 
    34043404    {   int op; 
    34053405 
    3406         assert(tyintegral(e2->Ety)); 
     3406        assert(tyintegral(e2->Ety) || typtr(e2->Ety)); 
    34073407#if TX86        /* ending up with byte ops in A regs */ 
    34083408        if (!(el_tolong(e2) & ~CHARMASK) && 
    34093409        !(el_tolong(e1->E2) & ~CHARMASK) 
    34103410           ) 
    34113411        { 
    34123412        if (sz == LLONGSIZE) 
    34133413        {   e1->E1 = el_una(OP64_32,TYulong,e1->E1); 
    34143414            e1->E1 = el_una(OP32_16,TYushort,e1->E1); 
    34153415        } 
    34163416        else if (sz == LONGSIZE) 
    34173417            e1->E1 = el_una(OP32_16,TYushort,e1->E1); 
    34183418        tym = TYuchar; 
    34193419        op = OPint8; 
    34203420        goto L4; 
    34213421        } 
    34223422#endif 
    34233423        if ( 
    34243424#if TX86 
    34253425        intsize == SHORTSIZE && /* not a win when regs are long */ 
    34263426#endif 
  • trunk/src/backend/cgelem.c

    r266 r267  
    33863386    int sz; 
    33873387 
    33883388    if (e1->Eoper == OPu16_32 && e2->EV.Vulong <= (targ_ulong) SHORTMASK || 
    33893389         e1->Eoper == OPshtlng && 
    33903390         e2->EV.Vlong == (targ_short) e2->EV.Vlong) 
    33913391    { 
    33923392        tym = (uns || e1->Eoper == OPu16_32) ? TYushort : TYshort; 
    33933393        e->E2 = el_una(OPlngsht,tym,e2); 
    33943394        goto L2; 
    33953395    } 
    33963396 
    33973397    /* Try to convert to byte/word comparison for ((x & c)==d) 
    33983398       when mask c essentially casts x to a smaller type 
    33993399     */ 
    34003400    if (OPTIMIZER && 
    34013401        e1->Eoper == OPand && 
    34023402        e1->E2->Eoper == OPconst && 
    34033403        (sz = tysize(e2->Ety)) > CHARSIZE) 
    34043404    {   int op; 
    34053405 
    3406         assert(tyintegral(e2->Ety)); 
     3406        assert(tyintegral(e2->Ety) || typtr(e2->Ety)); 
    34073407#if TX86        /* ending up with byte ops in A regs */ 
    34083408        if (!(el_tolong(e2) & ~CHARMASK) && 
    34093409        !(el_tolong(e1->E2) & ~CHARMASK) 
    34103410           ) 
    34113411        { 
    34123412        if (sz == LLONGSIZE) 
    34133413        {   e1->E1 = el_una(OP64_32,TYulong,e1->E1); 
    34143414            e1->E1 = el_una(OP32_16,TYushort,e1->E1); 
    34153415        } 
    34163416        else if (sz == LONGSIZE) 
    34173417            e1->E1 = el_una(OP32_16,TYushort,e1->E1); 
    34183418        tym = TYuchar; 
    34193419        op = OPint8; 
    34203420        goto L4; 
    34213421        } 
    34223422#endif 
    34233423        if ( 
    34243424#if TX86 
    34253425        intsize == SHORTSIZE && /* not a win when regs are long */ 
    34263426#endif