Changeset 267
- Timestamp:
- 11/23/09 04:01:38 (15 years ago)
- Files:
-
- branches/dmd-1.x/src/backend/cgelem.c (modified) (1 diff)
- trunk/src/backend/cgelem.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmd-1.x/src/backend/cgelem.c
r266 r267 3386 3386 int sz; 3387 3387 3388 3388 if (e1->Eoper == OPu16_32 && e2->EV.Vulong <= (targ_ulong) SHORTMASK || 3389 3389 e1->Eoper == OPshtlng && 3390 3390 e2->EV.Vlong == (targ_short) e2->EV.Vlong) 3391 3391 { 3392 3392 tym = (uns || e1->Eoper == OPu16_32) ? TYushort : TYshort; 3393 3393 e->E2 = el_una(OPlngsht,tym,e2); 3394 3394 goto L2; 3395 3395 } 3396 3396 3397 3397 /* Try to convert to byte/word comparison for ((x & c)==d) 3398 3398 when mask c essentially casts x to a smaller type 3399 3399 */ 3400 3400 if (OPTIMIZER && 3401 3401 e1->Eoper == OPand && 3402 3402 e1->E2->Eoper == OPconst && 3403 3403 (sz = tysize(e2->Ety)) > CHARSIZE) 3404 3404 { int op; 3405 3405 3406 assert(tyintegral(e2->Ety) );3406 assert(tyintegral(e2->Ety) || typtr(e2->Ety)); 3407 3407 #if TX86 /* ending up with byte ops in A regs */ 3408 3408 if (!(el_tolong(e2) & ~CHARMASK) && 3409 3409 !(el_tolong(e1->E2) & ~CHARMASK) 3410 3410 ) 3411 3411 { 3412 3412 if (sz == LLONGSIZE) 3413 3413 { e1->E1 = el_una(OP64_32,TYulong,e1->E1); 3414 3414 e1->E1 = el_una(OP32_16,TYushort,e1->E1); 3415 3415 } 3416 3416 else if (sz == LONGSIZE) 3417 3417 e1->E1 = el_una(OP32_16,TYushort,e1->E1); 3418 3418 tym = TYuchar; 3419 3419 op = OPint8; 3420 3420 goto L4; 3421 3421 } 3422 3422 #endif 3423 3423 if ( 3424 3424 #if TX86 3425 3425 intsize == SHORTSIZE && /* not a win when regs are long */ 3426 3426 #endif trunk/src/backend/cgelem.c
r266 r267 3386 3386 int sz; 3387 3387 3388 3388 if (e1->Eoper == OPu16_32 && e2->EV.Vulong <= (targ_ulong) SHORTMASK || 3389 3389 e1->Eoper == OPshtlng && 3390 3390 e2->EV.Vlong == (targ_short) e2->EV.Vlong) 3391 3391 { 3392 3392 tym = (uns || e1->Eoper == OPu16_32) ? TYushort : TYshort; 3393 3393 e->E2 = el_una(OPlngsht,tym,e2); 3394 3394 goto L2; 3395 3395 } 3396 3396 3397 3397 /* Try to convert to byte/word comparison for ((x & c)==d) 3398 3398 when mask c essentially casts x to a smaller type 3399 3399 */ 3400 3400 if (OPTIMIZER && 3401 3401 e1->Eoper == OPand && 3402 3402 e1->E2->Eoper == OPconst && 3403 3403 (sz = tysize(e2->Ety)) > CHARSIZE) 3404 3404 { int op; 3405 3405 3406 assert(tyintegral(e2->Ety) );3406 assert(tyintegral(e2->Ety) || typtr(e2->Ety)); 3407 3407 #if TX86 /* ending up with byte ops in A regs */ 3408 3408 if (!(el_tolong(e2) & ~CHARMASK) && 3409 3409 !(el_tolong(e1->E2) & ~CHARMASK) 3410 3410 ) 3411 3411 { 3412 3412 if (sz == LLONGSIZE) 3413 3413 { e1->E1 = el_una(OP64_32,TYulong,e1->E1); 3414 3414 e1->E1 = el_una(OP32_16,TYushort,e1->E1); 3415 3415 } 3416 3416 else if (sz == LONGSIZE) 3417 3417 e1->E1 = el_una(OP32_16,TYushort,e1->E1); 3418 3418 tym = TYuchar; 3419 3419 op = OPint8; 3420 3420 goto L4; 3421 3421 } 3422 3422 #endif 3423 3423 if ( 3424 3424 #if TX86 3425 3425 intsize == SHORTSIZE && /* not a win when regs are long */ 3426 3426 #endif
