view test/const.c @ 427:0c256ea2a97e

Bitfield left value for ia32
author kono
date Sat, 30 Oct 2004 18:49:25 +0900
parents 33a09aa401ba
children 32737bad7489
line wrap: on
line source

main()
{
    int i;
    i = 0x0f0f0ff;
    printf("#0004:0:\t%x\n",i);
    i = 0x0f0f0ff<<1;
    printf("#0006:1:\t%x\n",i);

i = 1; printf("#0008:2:\t%x\n",i);
i = -1; printf("#0009:3:\t%x\n",i);
   if (i==1) printf("#0010:i==1\n",i);
   if (i==-1) printf("#0011:i==-1\n",i);

i = 0x555<<0; printf("#0013:4:\t%x\n",i);
i = 0x555<<1; printf("#0014:5:\t%x\n",i);
i = 0x555<<2; printf("#0015:6:\t%x\n",i);
i = 0x555<<3; printf("#0016:7:\t%x\n",i);
i = 0x555<<4; printf("#0017:8:\t%x\n",i);
i = 0x555<<5; printf("#0018:9:\t%x\n",i);
i = 0x555<<6; printf("#0019:10:\t%x\n",i);
i = 0x555<<7; printf("#0020:11:\t%x\n",i);
i = 0x555<<8; printf("#0021:12:\t%x\n",i);
i = 0x555<<9; printf("#0022:13:\t%x\n",i);
i = 0x555<<10; printf("#0023:14:\t%x\n",i);
i = 0x555<<11; printf("#0024:15:\t%x\n",i);
i = 0x555<<12; printf("#0025:16:\t%x\n",i);
i = 0x555<<13; printf("#0026:17:\t%x\n",i);
i = 0x555<<14; printf("#0027:18:\t%x\n",i);
i = 0x555<<15; printf("#0028:19:\t%x\n",i);
i = 0x555<<16; printf("#0029:20:\t%x\n",i);
i = 0x555<<17; printf("#0030:21:\t%x\n",i);
i = 0x555<<18; printf("#0031:22:\t%x\n",i);
i = 0x555<<19; printf("#0032:23:\t%x\n",i);
i = 0x555<<20; printf("#0033:24:\t%x\n",i);
i = 0x555<<21; printf("#0034:25:\t%x\n",i);
i = 0x555<<22; printf("#0035:26:\t%x\n",i);
i = 0x555<<23; printf("#0036:27:\t%x\n",i);
i = 0x555<<24; printf("#0037:28:\t%x\n",i);
i = 0x555<<25; printf("#0038:29:\t%x\n",i);
i = 0x555<<26; printf("#0039:30:\t%x\n",i);
i = 0x555<<27; printf("#0040:31:\t%x\n",i);
i = 0x555<<28; printf("#0041:32:\t%x\n",i);
i = 0x555<<29; printf("#0042:33:\t%x\n",i);
i = 0x555<<30; printf("#0043:34:\t%x\n",i);
i = 0x555<<31; printf("#0044:35:\t%x\n",i);

i = 1; printf("#0046:36:\t%x\n",i);
i = 3; printf("#0047:37:\t%x\n",i);
i = 7; printf("#0048:38:\t%x\n",i);
i = 15; printf("#0049:39:\t%x\n",i);
i = 31; printf("#0050:40:\t%x\n",i);
i = 63; printf("#0051:41:\t%x\n",i);
i = 127; printf("#0052:42:\t%x\n",i);
i = 255; printf("#0053:43:\t%x\n",i);
i = 511; printf("#0054:44:\t%x\n",i);
i = 1023; printf("#0055:45:\t%x\n",i);
i = 2047; printf("#0056:46:\t%x\n",i);
i = 4095; printf("#0057:47:\t%x\n",i);
i = 8191; printf("#0058:48:\t%x\n",i);
i = 16383; printf("#0059:49:\t%x\n",i);
i = 32767; printf("#0060:50:\t%x\n",i);
i = 65535; printf("#0061:51:\t%x\n",i);
i = 131071; printf("#0062:52:\t%x\n",i);
i = 262143; printf("#0063:53:\t%x\n",i);
i = 524287; printf("#0064:54:\t%x\n",i);
i = 1048575; printf("#0065:55:\t%x\n",i);
i = 2097151; printf("#0066:56:\t%x\n",i);
i = 4194303; printf("#0067:57:\t%x\n",i);
i = 8388607; printf("#0068:58:\t%x\n",i);
i = 16777215; printf("#0069:59:\t%x\n",i);
i = 33554431; printf("#0070:60:\t%x\n",i);
i = 67108863; printf("#0071:61:\t%x\n",i);
i = 134217727; printf("#0072:62:\t%x\n",i);
i = 268435455; printf("#0073:63:\t%x\n",i);
i = 536870911; printf("#0074:64:\t%x\n",i);
i = 1073741823; printf("#0075:65:\t%x\n",i);
i = 2147483647; printf("#0076:66:\t%x\n",i);
i = 4294967295; printf("#0077:67:\t%x\n",i);

i = -( 0x555<<0 ); printf("#0079:68:\t%x\n",i);
i = -( 0x555<<1 ); printf("#0080:69:\t%x\n",i);
i = -( 0x555<<2 ); printf("#0081:70:\t%x\n",i);
i = -( 0x555<<3 ); printf("#0082:71:\t%x\n",i);
i = -( 0x555<<4 ); printf("#0083:72:\t%x\n",i);
i = -( 0x555<<5 ); printf("#0084:73:\t%x\n",i);
i = -( 0x555<<6 ); printf("#0085:74:\t%x\n",i);
i = -( 0x555<<7 ); printf("#0086:75:\t%x\n",i);
i = -( 0x555<<8 ); printf("#0087:76:\t%x\n",i);
i = -( 0x555<<9 ); printf("#0088:77:\t%x\n",i);
i = -( 0x555<<10 ); printf("#0089:78:\t%x\n",i);
i = -( 0x555<<11 ); printf("#0090:79:\t%x\n",i);
i = -( 0x555<<12 ); printf("#0091:80:\t%x\n",i);
i = -( 0x555<<13 ); printf("#0092:81:\t%x\n",i);
i = -( 0x555<<14 ); printf("#0093:82:\t%x\n",i);
i = -( 0x555<<15 ); printf("#0094:83:\t%x\n",i);
i = -( 0x555<<16 ); printf("#0095:84:\t%x\n",i);
i = -( 0x555<<17 ); printf("#0096:85:\t%x\n",i);
i = -( 0x555<<18 ); printf("#0097:86:\t%x\n",i);
i = -( 0x555<<19 ); printf("#0098:87:\t%x\n",i);
i = -( 0x555<<20 ); printf("#0099:88:\t%x\n",i);
i = -( 0x555<<21 ); printf("#0100:89:\t%x\n",i);
i = -( 0x555<<22 ); printf("#0101:90:\t%x\n",i);
i = -( 0x555<<23 ); printf("#0102:91:\t%x\n",i);
i = -( 0x555<<24 ); printf("#0103:92:\t%x\n",i);
i = -( 0x555<<25 ); printf("#0104:93:\t%x\n",i);
i = -( 0x555<<26 ); printf("#0105:94:\t%x\n",i);
i = -( 0x555<<27 ); printf("#0106:95:\t%x\n",i);
i = -( 0x555<<28 ); printf("#0107:96:\t%x\n",i);
i = -( 0x555<<29 ); printf("#0108:97:\t%x\n",i);
i = -( 0x555<<30 ); printf("#0109:98:\t%x\n",i);
i = -( 0x555<<31 ); printf("#0110:99:\t%x\n",i);

i = -( 1 ); printf("#0112:100:\t%x\n",i);
i = -( 3 ); printf("#0113:101:\t%x\n",i);
i = -( 7 ); printf("#0114:102:\t%x\n",i);
i = -( 15 ); printf("#0115:103:\t%x\n",i);
i = -( 31 ); printf("#0116:104:\t%x\n",i);
i = -( 63 ); printf("#0117:105:\t%x\n",i);
i = -( 127 ); printf("#0118:106:\t%x\n",i);
i = -( 255 ); printf("#0119:107:\t%x\n",i);
i = -( 511 ); printf("#0120:108:\t%x\n",i);
i = -( 1023 ); printf("#0121:109:\t%x\n",i);
i = -( 2047 ); printf("#0122:110:\t%x\n",i);
i = -( 4095 ); printf("#0123:111:\t%x\n",i);
i = -( 8191 ); printf("#0124:112:\t%x\n",i);
i = -( 16383 ); printf("#0125:113:\t%x\n",i);
i = -( 32767 ); printf("#0126:114:\t%x\n",i);
i = -( 65535 ); printf("#0127:115:\t%x\n",i);
i = -( 131071 ); printf("#0128:116:\t%x\n",i);
i = -( 262143 ); printf("#0129:117:\t%x\n",i);
i = -( 524287 ); printf("#0130:118:\t%x\n",i);
i = -( 1048575 ); printf("#0131:119:\t%x\n",i);
i = -( 2097151 ); printf("#0132:120:\t%x\n",i);
i = -( 4194303 ); printf("#0133:121:\t%x\n",i);
i = -( 8388607 ); printf("#0134:122:\t%x\n",i);
i = -( 16777215 ); printf("#0135:123:\t%x\n",i);
i = -( 33554431 ); printf("#0136:124:\t%x\n",i);
i = -( 67108863 ); printf("#0137:125:\t%x\n",i);
i = -( 134217727 ); printf("#0138:126:\t%x\n",i);
i = -( 268435455 ); printf("#0139:127:\t%x\n",i);
i = -( 536870911 ); printf("#0140:128:\t%x\n",i);
i = -( 1073741823 ); printf("#0141:129:\t%x\n",i);
i = -( 2147483647 ); printf("#0142:130:\t%x\n",i);
i = -( 4294967295 ); printf("#0143:131:\t%x\n",i);

i += 0x555<<0; printf("#0145:132:\t%x\n",i);
i += 0x555<<1; printf("#0146:133:\t%x\n",i);
i += 0x555<<2; printf("#0147:134:\t%x\n",i);
i += 0x555<<3; printf("#0148:135:\t%x\n",i);
i += 0x555<<4; printf("#0149:136:\t%x\n",i);
i += 0x555<<5; printf("#0150:137:\t%x\n",i);
i += 0x555<<6; printf("#0151:138:\t%x\n",i);
i += 0x555<<7; printf("#0152:139:\t%x\n",i);
i += 0x555<<8; printf("#0153:140:\t%x\n",i);
i += 0x555<<9; printf("#0154:141:\t%x\n",i);
i += 0x555<<10; printf("#0155:142:\t%x\n",i);
i += 0x555<<11; printf("#0156:143:\t%x\n",i);
i += 0x555<<12; printf("#0157:144:\t%x\n",i);
i += 0x555<<13; printf("#0158:145:\t%x\n",i);
i += 0x555<<14; printf("#0159:146:\t%x\n",i);
i += 0x555<<15; printf("#0160:147:\t%x\n",i);
i += 0x555<<16; printf("#0161:148:\t%x\n",i);
i += 0x555<<17; printf("#0162:149:\t%x\n",i);
i += 0x555<<18; printf("#0163:150:\t%x\n",i);
i += 0x555<<19; printf("#0164:151:\t%x\n",i);
i += 0x555<<20; printf("#0165:152:\t%x\n",i);
i += 0x555<<21; printf("#0166:153:\t%x\n",i);
i += 0x555<<22; printf("#0167:154:\t%x\n",i);
i += 0x555<<23; printf("#0168:155:\t%x\n",i);
i += 0x555<<24; printf("#0169:156:\t%x\n",i);
i += 0x555<<25; printf("#0170:157:\t%x\n",i);
i += 0x555<<26; printf("#0171:158:\t%x\n",i);
i += 0x555<<27; printf("#0172:159:\t%x\n",i);
i += 0x555<<28; printf("#0173:160:\t%x\n",i);
i += 0x555<<29; printf("#0174:161:\t%x\n",i);
i += 0x555<<30; printf("#0175:162:\t%x\n",i);
i += 0x555<<31; printf("#0176:163:\t%x\n",i);

i += 1; printf("#0178:164:\t%x\n",i);
i += 3; printf("#0179:165:\t%x\n",i);
i += 7; printf("#0180:166:\t%x\n",i);
i += 15; printf("#0181:167:\t%x\n",i);
i += 31; printf("#0182:168:\t%x\n",i);
i += 63; printf("#0183:169:\t%x\n",i);
i += 127; printf("#0184:170:\t%x\n",i);
i += 255; printf("#0185:171:\t%x\n",i);
i += 511; printf("#0186:172:\t%x\n",i);
i += 1023; printf("#0187:173:\t%x\n",i);
i += 2047; printf("#0188:174:\t%x\n",i);
i += 4095; printf("#0189:175:\t%x\n",i);
i += 8191; printf("#0190:176:\t%x\n",i);
i += 16383; printf("#0191:177:\t%x\n",i);
i += 32767; printf("#0192:178:\t%x\n",i);
i += 65535; printf("#0193:179:\t%x\n",i);
i += 131071; printf("#0194:180:\t%x\n",i);
i += 262143; printf("#0195:181:\t%x\n",i);
i += 524287; printf("#0196:182:\t%x\n",i);
i += 1048575; printf("#0197:183:\t%x\n",i);
i += 2097151; printf("#0198:184:\t%x\n",i);
i += 4194303; printf("#0199:185:\t%x\n",i);
i += 8388607; printf("#0200:186:\t%x\n",i);
i += 16777215; printf("#0201:187:\t%x\n",i);
i += 33554431; printf("#0202:188:\t%x\n",i);
i += 67108863; printf("#0203:189:\t%x\n",i);
i += 134217727; printf("#0204:190:\t%x\n",i);
i += 268435455; printf("#0205:191:\t%x\n",i);
i += 536870911; printf("#0206:192:\t%x\n",i);
i += 1073741823; printf("#0207:193:\t%x\n",i);
i += 2147483647; printf("#0208:194:\t%x\n",i);
i += 4294967295; printf("#0209:195:\t%x\n",i);

i += -( 0x555<<0 ); printf("#0211:196:\t%x\n",i);
i += -( 0x555<<1 ); printf("#0212:197:\t%x\n",i);
i += -( 0x555<<2 ); printf("#0213:198:\t%x\n",i);
i += -( 0x555<<3 ); printf("#0214:199:\t%x\n",i);
i += -( 0x555<<4 ); printf("#0215:200:\t%x\n",i);
i += -( 0x555<<5 ); printf("#0216:201:\t%x\n",i);
i += -( 0x555<<6 ); printf("#0217:202:\t%x\n",i);
i += -( 0x555<<7 ); printf("#0218:203:\t%x\n",i);
i += -( 0x555<<8 ); printf("#0219:204:\t%x\n",i);
i += -( 0x555<<9 ); printf("#0220:205:\t%x\n",i);
i += -( 0x555<<10 ); printf("#0221:206:\t%x\n",i);
i += -( 0x555<<11 ); printf("#0222:207:\t%x\n",i);
i += -( 0x555<<12 ); printf("#0223:208:\t%x\n",i);
i += -( 0x555<<13 ); printf("#0224:209:\t%x\n",i);
i += -( 0x555<<14 ); printf("#0225:210:\t%x\n",i);
i += -( 0x555<<15 ); printf("#0226:211:\t%x\n",i);
i += -( 0x555<<16 ); printf("#0227:212:\t%x\n",i);
i += -( 0x555<<17 ); printf("#0228:213:\t%x\n",i);
i += -( 0x555<<18 ); printf("#0229:214:\t%x\n",i);
i += -( 0x555<<19 ); printf("#0230:215:\t%x\n",i);
i += -( 0x555<<20 ); printf("#0231:216:\t%x\n",i);
i += -( 0x555<<21 ); printf("#0232:217:\t%x\n",i);
i += -( 0x555<<22 ); printf("#0233:218:\t%x\n",i);
i += -( 0x555<<23 ); printf("#0234:219:\t%x\n",i);
i += -( 0x555<<24 ); printf("#0235:220:\t%x\n",i);
i += -( 0x555<<25 ); printf("#0236:221:\t%x\n",i);
i += -( 0x555<<26 ); printf("#0237:222:\t%x\n",i);
i += -( 0x555<<27 ); printf("#0238:223:\t%x\n",i);
i += -( 0x555<<28 ); printf("#0239:224:\t%x\n",i);
i += -( 0x555<<29 ); printf("#0240:225:\t%x\n",i);
i += -( 0x555<<30 ); printf("#0241:226:\t%x\n",i);
i += -( 0x555<<31 ); printf("#0242:227:\t%x\n",i);

i += -( 1 ); printf("#0244:228:\t%x\n",i);
i += -( 3 ); printf("#0245:229:\t%x\n",i);
i += -( 7 ); printf("#0246:230:\t%x\n",i);
i += -( 15 ); printf("#0247:231:\t%x\n",i);
i += -( 31 ); printf("#0248:232:\t%x\n",i);
i += -( 63 ); printf("#0249:233:\t%x\n",i);
i += -( 127 ); printf("#0250:234:\t%x\n",i);
i += -( 255 ); printf("#0251:235:\t%x\n",i);
i += -( 511 ); printf("#0252:236:\t%x\n",i);
i += -( 1023 ); printf("#0253:237:\t%x\n",i);
i += -( 2047 ); printf("#0254:238:\t%x\n",i);
i += -( 4095 ); printf("#0255:239:\t%x\n",i);
i += -( 8191 ); printf("#0256:240:\t%x\n",i);
i += -( 16383 ); printf("#0257:241:\t%x\n",i);
i += -( 32767 ); printf("#0258:242:\t%x\n",i);
i += -( 65535 ); printf("#0259:243:\t%x\n",i);
i += -( 131071 ); printf("#0260:244:\t%x\n",i);
i += -( 262143 ); printf("#0261:245:\t%x\n",i);
i += -( 524287 ); printf("#0262:246:\t%x\n",i);
i += -( 1048575 ); printf("#0263:247:\t%x\n",i);
i += -( 2097151 ); printf("#0264:248:\t%x\n",i);
i += -( 4194303 ); printf("#0265:249:\t%x\n",i);
i += -( 8388607 ); printf("#0266:250:\t%x\n",i);
i += -( 16777215 ); printf("#0267:251:\t%x\n",i);
i += -( 33554431 ); printf("#0268:252:\t%x\n",i);
i += -( 67108863 ); printf("#0269:253:\t%x\n",i);
i += -( 134217727 ); printf("#0270:254:\t%x\n",i);
i += -( 268435455 ); printf("#0271:255:\t%x\n",i);
i += -( 536870911 ); printf("#0272:256:\t%x\n",i);
i += -( 1073741823 ); printf("#0273:257:\t%x\n",i);
i += -( 2147483647 ); printf("#0274:258:\t%x\n",i);
i += -( 4294967295 ); printf("#0275:259:\t%x\n",i);
}