Mercurial > hg > CbC > old > device
annotate test/bitfield.c @ 935:7672a37e7545 default tip
Raspbery PI ARM support begin
author | kono |
---|---|
date | Sat, 24 Dec 2016 03:02:57 +0000 |
parents | 5313ed059cee |
children |
rev | line source |
---|---|
467 | 1 int printf(const char *format, ...); |
820
9598ecec0af5
rvalue, RSTRUCT, non parse mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
2 typedef unsigned long long ULL; |
336 | 3 |
4 typedef union { | |
5 struct _PTE { | |
880 | 6 unsigned long v:1; |
7 unsigned long vsid:24; | |
8 unsigned long h:1; | |
9 unsigned long api:6; | |
10 unsigned long rpn:20; | |
336 | 11 |
880 | 12 unsigned long :3; |
13 unsigned long r:1; | |
14 unsigned long c:1; | |
15 unsigned long w:1; | |
16 unsigned long i:1; | |
17 unsigned long m:1; | |
18 unsigned long g:1; | |
19 unsigned long :1; | |
20 unsigned long pp:2; | |
21 long long lpn:40; | |
336 | 22 } pte; |
23 struct { | |
880 | 24 char v:1; |
25 signed long vsid:24; | |
26 unsigned long h:1; | |
27 signed char api:6; | |
28 signed long rpn:20; | |
336 | 29 |
880 | 30 signed long :3; |
31 unsigned long r:1; | |
32 unsigned long c:1; | |
33 unsigned long w:1; | |
34 unsigned long i:1; | |
35 unsigned long m:1; | |
36 unsigned long g:1; | |
37 unsigned long :1; | |
38 signed long pp:2; | |
336 | 39 } sg; |
40 unsigned long u[2]; | |
41 } PTE; | |
42 | |
43 PTE g; | |
44 | |
545 | 45 static void main2(); |
46 static void main5(); | |
47 static void main5c(); | |
48 static int main3(); | |
49 static int main4(); | |
50 static void main6(); | |
51 static void main7(); | |
52 | |
53 int | |
336 | 54 main() |
55 { | |
56 PTE a,*p; | |
57 int i = 0; | |
58 int j = 0; | |
59 | |
60 a.pte.rpn = 55; | |
61 j = a.pte.rpn; | |
550 | 62 printf("#0061:% 3d: %d\n",i++,j); |
336 | 63 a.pte.c = 1; |
64 j = a.pte.c; | |
550 | 65 printf("#0064:% 3d: %d\n",i++,j); |
336 | 66 a.pte.pp = -1; |
67 j = a.pte.pp; | |
550 | 68 printf("#0067:% 3d: %d\n",i++,j); |
336 | 69 a.sg.pp = -1; |
70 j = a.sg.pp; | |
550 | 71 printf("#0070:% 3d: %d\n",i++,j); |
336 | 72 |
73 p = &g; | |
74 | |
75 g.u[0]=0; | |
76 g.u[1]=0; | |
77 | |
790 | 78 printf("#0077:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 79 g.pte. v = 1; |
790 | 80 printf("#0079:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 81 g.pte. vsid = 0xffffff; |
790 | 82 printf("#0081:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 83 g.pte. h = 1; |
790 | 84 printf("#0083:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 85 g.pte. api = 3; |
790 | 86 printf("#0085:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 87 g.pte. rpn = 3; |
790 | 88 printf("#0087:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 89 |
545 | 90 g.pte. r = 1; |
790 | 91 printf("#0090:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 92 g.pte. c = 1; |
790 | 93 printf("#0092:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 94 g.pte. w = 1; |
790 | 95 printf("#0094:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 96 g.pte. i = 1; |
790 | 97 printf("#0096:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 98 g.pte. m = 1; |
790 | 99 printf("#0098:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 100 g.pte. g = 1; |
790 | 101 printf("#0100:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 102 g.pte. pp = 3; |
790 | 103 printf("#0102:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 104 |
105 g.u[0]=-1; | |
106 g.u[1]=-1; | |
107 | |
790 | 108 printf("#0107:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 109 g.pte. v = 0; |
790 | 110 printf("#0109:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 111 g.pte. vsid = 0; |
790 | 112 printf("#0111:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 113 g.pte. h = 0; |
790 | 114 printf("#0113:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 115 g.pte. api = 0; |
790 | 116 printf("#0115:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 117 g.pte. rpn = 0; |
790 | 118 printf("#0117:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 119 |
120 g.pte. r = 0; | |
790 | 121 printf("#0120:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 122 g.pte. c = 0; |
790 | 123 printf("#0122:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 124 g.pte. w = 0; |
790 | 125 printf("#0124:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 126 g.pte. i = 0; |
790 | 127 printf("#0126:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 128 g.pte. m = 0; |
790 | 129 printf("#0128:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 130 g.pte. g = 0; |
790 | 131 printf("#0130:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 132 g.pte. pp = 0; |
790 | 133 printf("#0132:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 134 |
135 g.u[0]=-1; | |
136 g.u[1]=-1; | |
137 | |
790 | 138 printf("#0137:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 139 g.pte. v = 0; |
790 | 140 printf("#0139:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 141 g.pte. vsid = 0x555555; |
790 | 142 printf("#0141:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 143 g.pte. h = 0; |
790 | 144 printf("#0143:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 145 g.pte. api = 0x15; |
790 | 146 printf("#0145:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 147 g.pte. rpn = 0x55555; |
790 | 148 printf("#0147:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 149 |
545 | 150 g.pte. r = 1; |
790 | 151 printf("#0150:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 152 g.pte. c = 1; |
790 | 153 printf("#0152:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 154 g.pte. w = 1; |
790 | 155 printf("#0154:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 156 g.pte. i = 1; |
790 | 157 printf("#0156:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 158 g.pte. m = 1; |
790 | 159 printf("#0158:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 160 g.pte. g = 1; |
790 | 161 printf("#0160:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 162 g.pte. pp = 3; |
790 | 163 printf("#0162:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 164 |
165 g.u[0]=-1; | |
166 g.u[1]=-1; | |
167 | |
168 for(i=0;i<0x200;i++) { | |
790 | 169 printf("#0168:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 170 g.pte. v = i; |
790 | 171 printf("#0170:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 172 g.pte. vsid = i; |
790 | 173 printf("#0172:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 174 g.pte. h = i; |
790 | 175 printf("#0174:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 176 g.pte. api = i; |
790 | 177 printf("#0176:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 178 g.pte. rpn = i; |
790 | 179 printf("#0178:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 180 |
181 g.pte. r = i; | |
790 | 182 printf("#0181:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 183 g.pte. c = i; |
790 | 184 printf("#0183:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 185 g.pte. w = i; |
790 | 186 printf("#0185:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 187 g.pte. i = i; |
790 | 188 printf("#0187:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 189 g.pte. m = i; |
790 | 190 printf("#0189:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 191 g.pte. g = i; |
790 | 192 printf("#0191:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 193 g.pte. pp = i; |
790 | 194 printf("#0193:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 195 } |
196 | |
197 g = a; | |
198 | |
550 | 199 printf("#0198:%d %d %d\n",a.pte.pp,g.pte.pp,p->pte.pp); |
336 | 200 main2(); |
201 main5(); | |
423 | 202 main5c(); |
338 | 203 main3(); |
204 main4(); | |
365 | 205 main6(); |
206 main7(); | |
336 | 207 return 0; |
208 } | |
545 | 209 void |
336 | 210 main2() |
211 { | |
212 int i = 0; | |
213 | |
214 g.u[0]=0; | |
215 g.u[1]=0; | |
216 | |
790 | 217 printf("#0216:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 218 g.sg. v = 1; |
790 | 219 printf("#0218:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 220 g.sg. vsid = 0xffffff; |
790 | 221 printf("#0220:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 222 g.sg. h = 1; |
790 | 223 printf("#0222:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 224 g.sg. api = 1; |
790 | 225 printf("#0224:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 226 g.sg. rpn = 1; |
790 | 227 printf("#0226:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 228 |
545 | 229 g.sg. r = 1; |
790 | 230 printf("#0229:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 231 g.sg. c = 1; |
790 | 232 printf("#0231:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 233 g.sg. w = 1; |
790 | 234 printf("#0233:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 235 g.sg. i = 1; |
790 | 236 printf("#0235:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 237 g.sg. m = 1; |
790 | 238 printf("#0237:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 239 g.sg. g = 1; |
790 | 240 printf("#0239:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 241 g.sg. pp = 0x3; |
790 | 242 printf("#0241:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 243 |
244 g.u[0]=-1; | |
245 g.u[1]=-1; | |
246 | |
790 | 247 printf("#0246:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 248 g.sg. v = 0; |
790 | 249 printf("#0248:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 250 g.sg. vsid = 0; |
790 | 251 printf("#0250:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 252 g.sg. h = 0; |
790 | 253 printf("#0252:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 254 g.sg. api = 0; |
790 | 255 printf("#0254:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 256 g.sg. rpn = 0; |
790 | 257 printf("#0256:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 258 |
259 g.sg. r = 0; | |
790 | 260 printf("#0259:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 261 g.sg. c = 0; |
790 | 262 printf("#0261:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 263 g.sg. w = 0; |
790 | 264 printf("#0263:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 265 g.sg. i = 0; |
790 | 266 printf("#0265:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 267 g.sg. m = 0; |
790 | 268 printf("#0267:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 269 g.sg. g = 0; |
790 | 270 printf("#0269:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 271 g.sg. pp = 0; |
790 | 272 printf("#0271:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 273 |
274 g.u[0]=-1; | |
275 g.u[1]=-1; | |
276 | |
790 | 277 printf("#0276:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 278 g.sg. v = 0; |
790 | 279 printf("#0278:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 280 g.sg. vsid = 0; |
790 | 281 printf("#0280:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 282 g.sg. h = 0; |
790 | 283 printf("#0282:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 284 g.sg. api = 0; |
790 | 285 printf("#0284:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 286 g.sg. rpn = 0; |
790 | 287 printf("#0286:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 288 |
545 | 289 g.sg. r = 0; |
790 | 290 printf("#0289:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 291 g.sg. c = 0; |
790 | 292 printf("#0291:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 293 g.sg. w = 0; |
790 | 294 printf("#0293:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 295 g.sg. i = 0; |
790 | 296 printf("#0295:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 297 g.sg. m = 0; |
790 | 298 printf("#0297:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 299 g.sg. g = 0; |
790 | 300 printf("#0299:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
545 | 301 g.sg. pp = 3; |
790 | 302 printf("#0301:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 303 |
304 g.u[0]=-1; | |
305 g.u[1]=-1; | |
306 | |
307 for(i=-0x100;i<0x100;i++) { | |
790 | 308 printf("#0307:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 309 g.sg. v = i; |
790 | 310 printf("#0309:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 311 g.sg. vsid = i; |
790 | 312 printf("#0311:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 313 g.sg. h = i; |
790 | 314 printf("#0313:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 315 g.sg. api = i; |
790 | 316 printf("#0315:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 317 g.sg. rpn = i; |
790 | 318 printf("#0317:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 319 |
320 g.sg. r = i; | |
790 | 321 printf("#0320:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 322 g.sg. c = i; |
790 | 323 printf("#0322:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 324 g.sg. w = i; |
790 | 325 printf("#0324:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 326 g.sg. i = i; |
790 | 327 printf("#0326:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 328 g.sg. m = i; |
790 | 329 printf("#0328:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 330 g.sg. g = i; |
790 | 331 printf("#0330:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 332 g.sg. pp = i; |
790 | 333 printf("#0332:% 3d: 0x%16lx%16lx\n",i++,g.u[0],g.u[1]); |
336 | 334 } |
335 | |
550 | 336 // printf("#0335:size of %d\n",sizeof(g.sg.pp)); no size of for bit-field |
336 | 337 |
338 } | |
339 | |
340 // int :12 bit-field cannot be a return value; | |
341 // main3( int a:8 ) bit-field cannot be an argument; | |
545 | 342 int |
336 | 343 main3( int a ) |
344 { | |
345 // int b:9; // nor local variable | |
338 | 346 int b,i; |
347 i = 7; | |
336 | 348 |
349 | |
338 | 350 b = g.pte.rpn = -333; |
550 | 351 printf("#0350:main3-0: %d\n",b); |
338 | 352 b = g.pte.rpn--; |
550 | 353 printf("#0352:main3-1: %d\n",b); |
338 | 354 b = g.pte.rpn++; |
550 | 355 printf("#0354:main3-2: %d\n",b); |
338 | 356 b = --g.pte.rpn; |
550 | 357 printf("#0356:main3-3: %d\n",b); |
338 | 358 b = ++g.pte.rpn; |
550 | 359 printf("#0358:main3-4: %d\n",b); |
338 | 360 b = (g.pte.rpn += 3); |
550 | 361 printf("#0360:main3-5: %d\n",b); |
338 | 362 b = (g.pte.rpn -= 3); |
550 | 363 printf("#0362:main3-6: %d\n",b); |
338 | 364 b = (g.pte.rpn *= 3); |
550 | 365 printf("#0364:main3-7: %d\n",b); |
338 | 366 b = (g.pte.rpn /= 3); |
550 | 367 printf("#0366:main3-8: %d\n",b); |
338 | 368 b = (g.pte.rpn %= 3); |
550 | 369 printf("#0368:main3-9: %d\n",b); |
338 | 370 b = (g.pte.rpn |= 3); |
550 | 371 printf("#0370:main3-10: %d\n",b); |
338 | 372 b = (g.pte.rpn &= 3); |
550 | 373 printf("#0372:main3-12: %d\n",b); |
338 | 374 b = (g.pte.rpn ^= 3); |
550 | 375 printf("#0374:main3-13: %d\n",b); |
338 | 376 b = (g.pte.rpn <<= 3); |
550 | 377 printf("#0376:main3-14: %d\n",b); |
338 | 378 b = (g.pte.rpn >>= 3); |
550 | 379 printf("#0378:main3-15: %d\n",b); |
338 | 380 |
381 g.pte.rpn = -333; | |
550 | 382 printf("#0381:main3-16: %d\n",b); |
338 | 383 b = g.pte.rpn--; |
550 | 384 printf("#0383:main3-17: %d\n",b); |
338 | 385 b = g.pte.rpn++; |
550 | 386 printf("#0385:main3-18: %d\n",b); |
338 | 387 b = --g.pte.rpn; |
550 | 388 printf("#0387:main3-19: %d\n",b); |
338 | 389 b = ++g.pte.rpn; |
550 | 390 printf("#0389:main3-20: %d\n",b); |
338 | 391 b = (g.pte.rpn += i); |
550 | 392 printf("#0391:main3-21: %d\n",b); |
338 | 393 b = (g.pte.rpn -= i); |
550 | 394 printf("#0393:main3-22: %d\n",b); |
338 | 395 b = (g.pte.rpn *= i); |
550 | 396 printf("#0395:main3-23: %d\n",b); |
338 | 397 b = (g.pte.rpn /= i); |
550 | 398 printf("#0397:main3-24: %d\n",b); |
338 | 399 b = (g.pte.rpn %= i); |
550 | 400 printf("#0399:main3-25: %d\n",b); |
338 | 401 b = (g.pte.rpn |= i); |
550 | 402 printf("#0401:main3-26: %d\n",b); |
338 | 403 b = (g.pte.rpn &= i); |
550 | 404 printf("#0403:main3-27: %d\n",b); |
338 | 405 b = (g.pte.rpn ^= i); |
550 | 406 printf("#0405:main3-28: %d\n",b); |
338 | 407 b = (g.pte.rpn <<= i); |
550 | 408 printf("#0407:main3-29: %d\n",b); |
338 | 409 b = (g.pte.rpn >>= i); |
550 | 410 printf("#0409:main3-30: %d\n",b); |
336 | 411 |
412 return --b; | |
413 } | |
545 | 414 int |
338 | 415 main4( int a ) |
416 { | |
417 // int b:9; // nor local variable | |
418 int b,i; | |
419 PTE *pg = &g; | |
420 | |
421 i = 7; | |
422 | |
423 | |
424 pg->pte.rpn = -333; | |
550 | 425 printf("#0424:main4-0: %d\n",b); |
338 | 426 b = pg->pte.rpn--; |
550 | 427 printf("#0426:main4-1: %d\n",b); |
338 | 428 b = pg->pte.rpn++; |
550 | 429 printf("#0428:main4-2: %d\n",b); |
338 | 430 b = --pg->pte.rpn; |
550 | 431 printf("#0430:main4-3: %d\n",b); |
338 | 432 b = ++pg->pte.rpn; |
550 | 433 printf("#0432:main4-4: %d\n",b); |
338 | 434 b = (pg->pte.rpn += 3); |
550 | 435 printf("#0434:main4-5: %d\n",b); |
338 | 436 b = (pg->pte.rpn -= 3); |
550 | 437 printf("#0436:main4-6: %d\n",b); |
338 | 438 b = (pg->pte.rpn *= 3); |
550 | 439 printf("#0438:main4-7: %d\n",b); |
338 | 440 b = (pg->pte.rpn /= 3); |
550 | 441 printf("#0440:main4-8: %d\n",b); |
338 | 442 b = (pg->pte.rpn %= 3); |
550 | 443 printf("#0442:main4-9: %d\n",b); |
338 | 444 b = (pg->pte.rpn |= 3); |
550 | 445 printf("#0444:main4-10: %d\n",b); |
338 | 446 b = (pg->pte.rpn &= 3); |
550 | 447 printf("#0446:main4-12: %d\n",b); |
338 | 448 b = (pg->pte.rpn ^= 3); |
550 | 449 printf("#0448:main4-13: %d\n",b); |
338 | 450 b = (pg->pte.rpn <<= 3); |
550 | 451 printf("#0450:main4-14: %d\n",b); |
338 | 452 b = (pg->pte.rpn >>= 3); |
550 | 453 printf("#0452:main4-15: %d\n",b); |
338 | 454 |
455 pg->pte.rpn = -333; | |
550 | 456 printf("#0455:main4-16: %d\n",b); |
338 | 457 b = pg->pte.rpn--; |
550 | 458 printf("#0457:main4-17: %d\n",b); |
338 | 459 b = pg->pte.rpn++; |
550 | 460 printf("#0459:main4-18: %d\n",b); |
338 | 461 b = --pg->pte.rpn; |
550 | 462 printf("#0461:main4-19: %d\n",b); |
338 | 463 b = ++pg->pte.rpn; |
550 | 464 printf("#0463:main4-20: %d\n",b); |
338 | 465 b = (pg->pte.rpn += i); |
550 | 466 printf("#0465:main4-21: %d\n",b); |
338 | 467 b = (pg->pte.rpn -= i); |
550 | 468 printf("#0467:main4-22: %d\n",b); |
338 | 469 b = (pg->pte.rpn *= i); |
550 | 470 printf("#0469:main4-23: %d\n",b); |
338 | 471 b = (pg->pte.rpn /= i); |
550 | 472 printf("#0471:main4-24: %d\n",b); |
338 | 473 b = (pg->pte.rpn %= i); |
550 | 474 printf("#0473:main4-25: %d\n",b); |
338 | 475 b = (pg->pte.rpn |= i); |
550 | 476 printf("#0475:main4-26: %d\n",b); |
338 | 477 b = (pg->pte.rpn &= i); |
550 | 478 printf("#0477:main4-27: %d\n",b); |
338 | 479 b = (pg->pte.rpn ^= i); |
550 | 480 printf("#0479:main4-28: %d\n",b); |
338 | 481 b = (pg->pte.rpn <<= i); |
550 | 482 printf("#0481:main4-29: %d\n",b); |
338 | 483 b = (pg->pte.rpn >>= i); |
550 | 484 printf("#0483:main4-30: %d\n",b); |
338 | 485 |
486 return --b; | |
487 } | |
488 | |
489 | |
336 | 490 |
491 | |
492 | |
493 union ll1 { | |
494 int a[8]; | |
495 struct { | |
496 char a:4; | |
880 | 497 unsigned long long v:33; |
498 unsigned long long w:33; | |
499 unsigned long long x:33; | |
336 | 500 } b; |
501 } ll1; | |
502 | |
503 union ll0 { | |
504 int a[8]; | |
505 struct { | |
506 char a:4; | |
880 | 507 unsigned long long v:48; |
508 unsigned long long w:48; | |
509 unsigned long long x:48; | |
336 | 510 } b; |
511 } ll0; | |
512 | |
513 | |
514 union ll { | |
515 int a[8]; | |
516 struct { | |
545 | 517 unsigned char a:4; |
880 | 518 unsigned long long v:56; |
519 unsigned long long w:56; | |
520 unsigned long long x:56; | |
336 | 521 } b; |
522 } ll; | |
523 | |
524 union cc { | |
525 int a; | |
526 struct { | |
880 | 527 char a:1; |
528 char b:4; | |
529 char c:7; | |
530 char d:4; | |
531 char e:4; | |
532 char f:4; | |
336 | 533 } b; |
534 } cc; | |
535 | |
536 union ii { | |
537 int a; | |
538 struct { | |
880 | 539 int a:1; |
540 int b:4; | |
541 int c:4; | |
542 int d:4; | |
543 int e:4; | |
544 int f:4; | |
336 | 545 } b; |
546 } ii; | |
547 | |
424 | 548 long long m1 = 0x123456789abcdefLL; |
336 | 549 int p1 = 1; |
550 int zero = 0; | |
551 | |
545 | 552 void |
423 | 553 main5c() |
554 { | |
555 ii.b.a = -1; | |
550 | 556 printf("#0555:m5c-00:%d\n",ii.b.a); |
423 | 557 |
545 | 558 ll1.b.v = 0x123456defLL; |
820
9598ecec0af5
rvalue, RSTRUCT, non parse mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
559 printf("#0558:m5c-01:%llx\n",(ULL)ll1.b.v); |
790 | 560 printf("#0559:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 561 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], |
562 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] | |
423 | 563 ); |
564 ll1.b.v = 0; | |
550 | 565 printf("#0564:m5c-01:%llx\n", |
880 | 566 (ULL)(ll1.b.w = 0x123456defLL)); |
790 | 567 printf("#0566:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 568 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], |
569 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] | |
423 | 570 ); |
571 ll1.b.w = 0; | |
550 | 572 printf("#0571:m5c-01:%llx\n", |
880 | 573 (ULL)(ll1.b.x = -0x12456defLL)); |
790 | 574 printf("#0573:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 575 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], |
576 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] | |
423 | 577 ); |
578 ll1.b.x = 0; | |
579 | |
550 | 580 printf("#0579:m5c-01:%llx\n", |
880 | 581 (ULL)(ll0.b.v = 0x123457cdefLL)); |
820
9598ecec0af5
rvalue, RSTRUCT, non parse mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
582 printf("#0581:m5c-01:%llx\n",(ULL)ll0.b.v); |
790 | 583 printf("#0582:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 584 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], |
585 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] | |
423 | 586 ); |
587 ll0.b.v = 0; | |
550 | 588 printf("#0587:m5c-01:%llx\n", |
880 | 589 (ULL)(ll0.b.w = 0x1234abcdefLL)); |
790 | 590 printf("#0589:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 591 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], |
592 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] | |
423 | 593 ); |
594 ll0.b.w = 0; | |
550 | 595 printf("#0594:m5c-01:%llx\n", |
880 | 596 (ULL)(ll0.b.x = 0x1234abcdefLL)); |
790 | 597 printf("#0596:m5c-02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 598 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], |
599 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] | |
423 | 600 ); |
601 ll0.b.x = 0; | |
602 | |
550 | 603 printf("#0602:m5c-01:%llx\n", |
880 | 604 (ULL)(ll.b.v = 0x12389abcdefLL)); |
820
9598ecec0af5
rvalue, RSTRUCT, non parse mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
605 printf("#0604:m5c-1:%llx\n",(ULL)ll.b.v); |
790 | 606 printf("#0605:m5c-2:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 607 ll.a[0],ll.a[1],ll.a[2],ll.a[3], |
608 ll.a[4],ll.a[5],ll.a[6],ll.a[7] | |
423 | 609 ); |
610 ll.b.v = 0; | |
550 | 611 printf("#0610:m5c-01:%llx\n", |
880 | 612 (ULL)(ll.b.w = 0x12389abcdefLL)); |
790 | 613 printf("#0612:m5c-2:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 614 ll.a[0],ll.a[1],ll.a[2],ll.a[3], |
615 ll.a[4],ll.a[5],ll.a[6],ll.a[7] | |
423 | 616 ); |
617 ll.b.w = 0; | |
550 | 618 printf("#0617:m5c-01:%llx\n", |
880 | 619 (ULL)(ll.b.x = 0x12389abcdefLL)); |
790 | 620 printf("#0619:m5c-2:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 621 ll.a[0],ll.a[1],ll.a[2],ll.a[3], |
622 ll.a[4],ll.a[5],ll.a[6],ll.a[7] | |
423 | 623 ); |
624 ll.b.x = 0; | |
625 | |
550 | 626 printf("#0625:m5c-char a:1; char b:4; char c:7; char d:4; char e:4; char f:4;\n"); |
424 | 627 cc.a = 0; |
423 | 628 cc.b.a = -1; |
790 | 629 printf("#0628:m5c-a:%16x\n",cc.a); |
423 | 630 cc.b.b = -1; |
790 | 631 printf("#0630:m5c-b:%16x\n",cc.a); |
423 | 632 cc.b.c = -1; |
790 | 633 printf("#0632:m5c-c:%16x\n",cc.a); |
423 | 634 cc.b.d = -1; |
790 | 635 printf("#0634:m5c-d:%16x\n",cc.a); |
423 | 636 cc.b.e = -1; |
790 | 637 printf("#0636:m5c-e:%16x\n",cc.a); |
423 | 638 cc.b.f = -1; |
790 | 639 printf("#0638:m5c-f:%16x\n",cc.a); |
550 | 640 printf("#0639:m5c-3:%d %d\n",cc.b.c,cc.b.d); |
423 | 641 cc.a = -1; |
790 | 642 printf("#0641:m5c-f:%16x\n",cc.a); |
423 | 643 cc.b.a = 0; |
790 | 644 printf("#0643:m5c-a:%16x\n",cc.a); |
423 | 645 cc.b.b = 0; |
790 | 646 printf("#0645:m5c-b:%16x\n",cc.a); |
423 | 647 cc.b.c = 0; |
790 | 648 printf("#0647:m5c-c:%16x\n",cc.a); |
423 | 649 cc.b.d = 0; |
790 | 650 printf("#0649:m5c-d:%16x\n",cc.a); |
423 | 651 cc.b.e = 0; |
790 | 652 printf("#0651:m5c-e:%16x\n",cc.a); |
423 | 653 cc.b.f = 0; |
790 | 654 printf("#0653:m5c-f:%16x\n",cc.a); |
550 | 655 printf("#0654:m5c-3:%d %d\n",cc.b.c,cc.b.d); |
423 | 656 cc.a = 0; |
790 | 657 printf("#0656:m5c-f:%16x\n",cc.a); |
423 | 658 cc.b.a = 1; |
790 | 659 printf("#0658:m5c-a:%16x\n",cc.a); |
423 | 660 cc.b.b = 1; |
790 | 661 printf("#0660:m5c-b:%16x\n",cc.a); |
423 | 662 cc.b.c = 1; |
790 | 663 printf("#0662:m5c-c:%16x\n",cc.a); |
423 | 664 cc.b.d = 1; |
790 | 665 printf("#0664:m5c-d:%16x\n",cc.a); |
423 | 666 cc.b.e = 1; |
790 | 667 printf("#0666:m5c-e:%16x\n",cc.a); |
423 | 668 cc.b.f = 1; |
790 | 669 printf("#0668:m5c-f:%16x\n",cc.a); |
550 | 670 printf("#0669:m5c-3:%d %d\n",cc.b.c,cc.b.d); |
423 | 671 cc.a = -1; |
790 | 672 printf("#0671:m5c-f:%16x\n",cc.a); |
423 | 673 cc.b.a = 1; |
790 | 674 printf("#0673:m5c-a:%16x\n",cc.a); |
423 | 675 cc.b.b = 1; |
790 | 676 printf("#0675:m5c-b:%16x\n",cc.a); |
423 | 677 cc.b.c = 1; |
790 | 678 printf("#0677:m5c-c:%16x\n",cc.a); |
423 | 679 cc.b.d = 1; |
790 | 680 printf("#0679:m5c-d:%16x\n",cc.a); |
423 | 681 cc.b.e = 1; |
790 | 682 printf("#0681:m5c-e:%16x\n",cc.a); |
423 | 683 cc.b.f = 1; |
790 | 684 printf("#0683:m5c-f:%16x\n",cc.a); |
550 | 685 printf("#0684:m5c-3:%d %d\n",cc.b.c,cc.b.d); |
423 | 686 |
687 ii.b.a = -1; | |
790 | 688 printf("#0687:m5c-6:%16x\n",ii.a); |
423 | 689 ii.b.d = -1; |
790 | 690 printf("#0689:m5c-6:%16x\n",ii.a); |
550 | 691 printf("#0690:m5c-5:%d %d\n",ii.b.a,ii.b.d); |
423 | 692 } |
693 | |
545 | 694 void |
336 | 695 main5() |
696 { | |
697 ii.b.a = -1; | |
550 | 698 printf("#0697:00:%d\n",ii.b.a); |
336 | 699 |
700 ll1.b.v = m1; | |
820
9598ecec0af5
rvalue, RSTRUCT, non parse mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
701 printf("#0700:01:%llx\n",(ULL)ll1.b.v); |
790 | 702 printf("#0701:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 703 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], |
704 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] | |
336 | 705 ); |
706 ll1.b.v = zero; | |
707 ll1.b.w = m1; | |
790 | 708 printf("#0707:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 709 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], |
710 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] | |
336 | 711 ); |
712 ll1.b.w = zero; | |
713 ll1.b.x = m1; | |
790 | 714 printf("#0713:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 715 ll1.a[0],ll1.a[1],ll1.a[2],ll1.a[3], |
716 ll1.a[4],ll1.a[5],ll1.a[6],ll1.a[7] | |
336 | 717 ); |
423 | 718 ll1.b.x = zero; |
336 | 719 |
720 ll0.b.v = m1; | |
820
9598ecec0af5
rvalue, RSTRUCT, non parse mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
721 printf("#0720:01:%llx\n",(ULL)ll0.b.v); |
790 | 722 printf("#0721:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 723 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], |
724 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] | |
336 | 725 ); |
726 ll0.b.v = zero; | |
727 ll0.b.w = m1; | |
790 | 728 printf("#0727:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 729 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], |
730 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] | |
336 | 731 ); |
732 ll0.b.w = zero; | |
733 ll0.b.x = m1; | |
790 | 734 printf("#0733:02:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 735 ll0.a[0],ll0.a[1],ll0.a[2],ll0.a[3], |
736 ll0.a[4],ll0.a[5],ll0.a[6],ll0.a[7] | |
336 | 737 ); |
423 | 738 ll0.b.x = zero; |
336 | 739 |
740 ll.b.v = m1; | |
820
9598ecec0af5
rvalue, RSTRUCT, non parse mode
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
790
diff
changeset
|
741 printf("#0740:1:%llx\n",(ULL)ll.b.v); |
790 | 742 printf("#0741:2:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 743 ll.a[0],ll.a[1],ll.a[2],ll.a[3], |
744 ll.a[4],ll.a[5],ll.a[6],ll.a[7] | |
336 | 745 ); |
746 ll.b.v = zero; | |
747 ll.b.w = m1; | |
790 | 748 printf("#0747:2:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 749 ll.a[0],ll.a[1],ll.a[2],ll.a[3], |
750 ll.a[4],ll.a[5],ll.a[6],ll.a[7] | |
336 | 751 ); |
752 ll.b.w = zero; | |
753 ll.b.x = m1; | |
790 | 754 printf("#0753:2:%16x %16x %16x %16x %16x %16x %16x %16x\n", |
880 | 755 ll.a[0],ll.a[1],ll.a[2],ll.a[3], |
756 ll.a[4],ll.a[5],ll.a[6],ll.a[7] | |
336 | 757 ); |
423 | 758 ll.b.x = zero; |
336 | 759 |
424 | 760 cc.a = zero; |
550 | 761 printf("#0760:char a:1; char b:4; char c:7; char d:4; char e:4; char f:4;\n"); |
336 | 762 cc.b.a = m1; |
790 | 763 printf("#0762:a:%16x\n",cc.a); |
336 | 764 cc.b.b = m1; |
790 | 765 printf("#0764:b:%16x\n",cc.a); |
336 | 766 cc.b.c = m1; |
790 | 767 printf("#0766:c:%16x\n",cc.a); |
336 | 768 cc.b.d = m1; |
790 | 769 printf("#0768:d:%16x\n",cc.a); |
336 | 770 cc.b.e = m1; |
790 | 771 printf("#0770:e:%16x\n",cc.a); |
336 | 772 cc.b.f = m1; |
790 | 773 printf("#0772:f:%16x\n",cc.a); |
550 | 774 printf("#0773:3:%d %d\n",cc.b.c,cc.b.d); |
336 | 775 cc.a = m1; |
790 | 776 printf("#0775:f:%16x\n",cc.a); |
336 | 777 cc.b.a = zero; |
790 | 778 printf("#0777:a:%16x\n",cc.a); |
336 | 779 cc.b.b = zero; |
790 | 780 printf("#0779:b:%16x\n",cc.a); |
336 | 781 cc.b.c = zero; |
790 | 782 printf("#0781:c:%16x\n",cc.a); |
336 | 783 cc.b.d = zero; |
790 | 784 printf("#0783:d:%16x\n",cc.a); |
336 | 785 cc.b.e = zero; |
790 | 786 printf("#0785:e:%16x\n",cc.a); |
336 | 787 cc.b.f = zero; |
790 | 788 printf("#0787:f:%16x\n",cc.a); |
550 | 789 printf("#0788:3:%d %d\n",cc.b.c,cc.b.d); |
336 | 790 cc.a = zero; |
790 | 791 printf("#0790:f:%16x\n",cc.a); |
336 | 792 cc.b.a = p1; |
790 | 793 printf("#0792:a:%16x\n",cc.a); |
336 | 794 cc.b.b = p1; |
790 | 795 printf("#0794:b:%16x\n",cc.a); |
336 | 796 cc.b.c = p1; |
790 | 797 printf("#0796:c:%16x\n",cc.a); |
336 | 798 cc.b.d = p1; |
790 | 799 printf("#0798:d:%16x\n",cc.a); |
336 | 800 cc.b.e = p1; |
790 | 801 printf("#0800:e:%16x\n",cc.a); |
336 | 802 cc.b.f = p1; |
790 | 803 printf("#0802:f:%16x\n",cc.a); |
550 | 804 printf("#0803:3:%d %d\n",cc.b.c,cc.b.d); |
336 | 805 cc.a = m1; |
790 | 806 printf("#0805:f:%16x\n",cc.a); |
336 | 807 cc.b.a = p1; |
790 | 808 printf("#0807:a:%16x\n",cc.a); |
336 | 809 cc.b.b = p1; |
790 | 810 printf("#0809:b:%16x\n",cc.a); |
336 | 811 cc.b.c = p1; |
790 | 812 printf("#0811:c:%16x\n",cc.a); |
336 | 813 cc.b.d = p1; |
790 | 814 printf("#0813:d:%16x\n",cc.a); |
336 | 815 cc.b.e = p1; |
790 | 816 printf("#0815:e:%16x\n",cc.a); |
336 | 817 cc.b.f = p1; |
790 | 818 printf("#0817:f:%16x\n",cc.a); |
550 | 819 printf("#0818:3:%d %d\n",cc.b.c,cc.b.d); |
336 | 820 |
821 ii.b.a = m1; | |
790 | 822 printf("#0821:6:%16x\n",ii.a); |
336 | 823 ii.b.d = m1; |
790 | 824 printf("#0823:6:%16x\n",ii.a); |
550 | 825 printf("#0824:5:%d %d\n",ii.b.a,ii.b.d); |
336 | 826 } |
827 | |
545 | 828 int |
338 | 829 main3l( int a ) |
830 { | |
831 // int b:9; // nor local variable | |
832 long long b,i; | |
833 i = 7; | |
834 | |
835 | |
836 g.pte.lpn = -333; | |
773 | 837 printf("#0836:main3l-0: %lld\n",b); |
338 | 838 b = g.pte.lpn--; |
773 | 839 printf("#0838:main3l-1: %lld\n",b); |
338 | 840 b = g.pte.lpn++; |
773 | 841 printf("#0840:main3l-2: %lld\n",b); |
338 | 842 b = --g.pte.lpn; |
773 | 843 printf("#0842:main3l-3: %lld\n",b); |
338 | 844 b = ++g.pte.lpn; |
773 | 845 printf("#0844:main3l-4: %lld\n",b); |
338 | 846 b = (g.pte.lpn += 3); |
773 | 847 printf("#0846:main3l-5: %lld\n",b); |
338 | 848 b = (g.pte.lpn -= 3); |
773 | 849 printf("#0848:main3l-6: %lld\n",b); |
338 | 850 b = (g.pte.lpn *= 3); |
773 | 851 printf("#0850:main3l-7: %lld\n",b); |
338 | 852 b = (g.pte.lpn /= 3); |
773 | 853 printf("#0852:main3l-8: %lld\n",b); |
338 | 854 b = (g.pte.lpn %= 3); |
773 | 855 printf("#0854:main3l-9: %lld\n",b); |
338 | 856 b = (g.pte.lpn |= 3); |
773 | 857 printf("#0856:main3l-10: %lld\n",b); |
338 | 858 b = (g.pte.lpn &= 3); |
773 | 859 printf("#0858:main3l-12: %lld\n",b); |
338 | 860 b = (g.pte.lpn ^= 3); |
773 | 861 printf("#0860:main3l-13: %lld\n",b); |
338 | 862 b = (g.pte.lpn <<= 3); |
773 | 863 printf("#0862:main3l-14: %lld\n",b); |
338 | 864 b = (g.pte.lpn >>= 3); |
773 | 865 printf("#0864:main3l-15: %lld\n",b); |
338 | 866 |
867 g.pte.lpn = -333; | |
773 | 868 printf("#0867:main3l-16: %lld\n",b); |
338 | 869 b = g.pte.lpn--; |
773 | 870 printf("#0869:main3l-17: %lld\n",b); |
338 | 871 b = g.pte.lpn++; |
773 | 872 printf("#0871:main3l-18: %lld\n",b); |
338 | 873 b = --g.pte.lpn; |
773 | 874 printf("#0873:main3l-19: %lld\n",b); |
338 | 875 b = ++g.pte.lpn; |
773 | 876 printf("#0875:main3l-20: %lld\n",b); |
338 | 877 b = (g.pte.lpn += i); |
773 | 878 printf("#0877:main3l-21: %lld\n",b); |
338 | 879 b = (g.pte.lpn -= i); |
773 | 880 printf("#0879:main3l-22: %lld\n",b); |
338 | 881 b = (g.pte.lpn *= i); |
773 | 882 printf("#0881:main3l-23: %lld\n",b); |
338 | 883 b = (g.pte.lpn /= i); |
773 | 884 printf("#0883:main3l-24: %lld\n",b); |
338 | 885 b = (g.pte.lpn %= i); |
773 | 886 printf("#0885:main3l-25: %lld\n",b); |
338 | 887 b = (g.pte.lpn |= i); |
773 | 888 printf("#0887:main3l-26: %lld\n",b); |
338 | 889 b = (g.pte.lpn &= i); |
773 | 890 printf("#0889:main3l-27: %lld\n",b); |
338 | 891 b = (g.pte.lpn ^= i); |
773 | 892 printf("#0891:main3l-28: %lld\n",b); |
338 | 893 b = (g.pte.lpn <<= i); |
773 | 894 printf("#0893:main3l-29: %lld\n",b); |
338 | 895 b = (g.pte.lpn >>= i); |
773 | 896 printf("#0895:main3l-30: %lld\n",b); |
338 | 897 |
898 return --b; | |
899 } | |
900 | |
545 | 901 void |
365 | 902 main6() |
903 { | |
904 int i =0; | |
880 | 905 g.pte.api = 0; |
906 printf("#0905:main5: %d %d\n",i++,g.pte.api); | |
907 g.pte.api = 1; | |
908 printf("#0907:main5: %d %d\n",i++,g.pte.api); | |
909 g.pte.api = 2; | |
910 printf("#0909:main5: %d %d\n",i++,g.pte.api); | |
911 g.pte.api = 3; | |
912 printf("#0911:main5: %d %d\n",i++,g.pte.api); | |
913 g.pte.api = 4; | |
914 printf("#0913:main5: %d %d\n",i++,g.pte.api); | |
915 g.pte.api = 5; | |
916 printf("#0915:main5: %d %d\n",i++,g.pte.api); | |
917 g.pte.api = 6; | |
918 printf("#0917:main5: %d %d\n",i++,g.pte.api); | |
919 g.pte.api = 7; | |
920 printf("#0919:main5: %d %d\n",i++,g.pte.api); | |
921 g.pte.api = 8; | |
922 printf("#0921:main5: %d %d\n",i++,g.pte.api); | |
923 g.pte.api = 9; | |
924 printf("#0923:main5: %d %d\n",i++,g.pte.api); | |
925 g.pte.api = 10; | |
926 printf("#0925:main5: %d %d\n",i++,g.pte.api); | |
927 g.pte.api = 11; | |
928 printf("#0927:main5: %d %d\n",i++,g.pte.api); | |
929 g.pte.api = 12; | |
930 printf("#0929:main5: %d %d\n",i++,g.pte.api); | |
931 g.pte.api = 13; | |
932 printf("#0931:main5: %d %d\n",i++,g.pte.api); | |
933 g.pte.api = 14; | |
934 printf("#0933:main5: %d %d\n",i++,g.pte.api); | |
935 g.pte.api = 15; | |
936 printf("#0935:main5: %d %d\n",i++,g.pte.api); | |
937 g.pte.api = 16; | |
938 printf("#0937:main5: %d %d\n",i++,g.pte.api); | |
939 g.pte.api = 17; | |
940 printf("#0939:main5: %d %d\n",i++,g.pte.api); | |
941 g.pte.api = 18; | |
942 printf("#0941:main5: %d %d\n",i++,g.pte.api); | |
943 g.pte.api = 19; | |
944 printf("#0943:main5: %d %d\n",i++,g.pte.api); | |
945 g.pte.api = 20; | |
946 printf("#0945:main5: %d %d\n",i++,g.pte.api); | |
947 g.pte.api = 21; | |
948 printf("#0947:main5: %d %d\n",i++,g.pte.api); | |
949 g.pte.api = 22; | |
950 printf("#0949:main5: %d %d\n",i++,g.pte.api); | |
951 g.pte.api = 23; | |
952 printf("#0951:main5: %d %d\n",i++,g.pte.api); | |
953 g.pte.api = 24; | |
954 printf("#0953:main5: %d %d\n",i++,g.pte.api); | |
955 g.pte.api = 25; | |
956 printf("#0955:main5: %d %d\n",i++,g.pte.api); | |
957 g.pte.api = 26; | |
958 printf("#0957:main5: %d %d\n",i++,g.pte.api); | |
959 g.pte.api = 27; | |
960 printf("#0959:main5: %d %d\n",i++,g.pte.api); | |
961 g.pte.api = 28; | |
962 printf("#0961:main5: %d %d\n",i++,g.pte.api); | |
963 g.pte.api = 29; | |
964 printf("#0963:main5: %d %d\n",i++,g.pte.api); | |
965 g.pte.api = 30; | |
966 printf("#0965:main5: %d %d\n",i++,g.pte.api); | |
967 g.pte.api = 31; | |
968 printf("#0967:main5: %d %d\n",i++,g.pte.api); | |
969 g.pte.api = 32; | |
970 printf("#0969:main5: %d %d\n",i++,g.pte.api); | |
971 g.pte.api = 33; | |
972 printf("#0971:main5: %d %d\n",i++,g.pte.api); | |
973 g.pte.api = 34; | |
974 printf("#0973:main5: %d %d\n",i++,g.pte.api); | |
975 g.pte.api = 35; | |
976 printf("#0975:main5: %d %d\n",i++,g.pte.api); | |
977 g.pte.api = 36; | |
978 printf("#0977:main5: %d %d\n",i++,g.pte.api); | |
979 g.pte.api = 37; | |
980 printf("#0979:main5: %d %d\n",i++,g.pte.api); | |
981 g.pte.api = 38; | |
982 printf("#0981:main5: %d %d\n",i++,g.pte.api); | |
983 g.pte.api = 39; | |
984 printf("#0983:main5: %d %d\n",i++,g.pte.api); | |
985 g.pte.api = 40; | |
986 printf("#0985:main5: %d %d\n",i++,g.pte.api); | |
987 g.pte.api = 41; | |
988 printf("#0987:main5: %d %d\n",i++,g.pte.api); | |
989 g.pte.api = 42; | |
990 printf("#0989:main5: %d %d\n",i++,g.pte.api); | |
991 g.pte.api = 43; | |
992 printf("#0991:main5: %d %d\n",i++,g.pte.api); | |
993 g.pte.api = 44; | |
994 printf("#0993:main5: %d %d\n",i++,g.pte.api); | |
995 g.pte.api = 45; | |
996 printf("#0995:main5: %d %d\n",i++,g.pte.api); | |
997 g.pte.api = 46; | |
998 printf("#0997:main5: %d %d\n",i++,g.pte.api); | |
999 g.pte.api = 47; | |
1000 printf("#0999:main5: %d %d\n",i++,g.pte.api); | |
1001 g.pte.api = 48; | |
1002 printf("#1001:main5: %d %d\n",i++,g.pte.api); | |
1003 g.pte.api = 49; | |
1004 printf("#1003:main5: %d %d\n",i++,g.pte.api); | |
1005 g.pte.api = 50; | |
1006 printf("#1005:main5: %d %d\n",i++,g.pte.api); | |
1007 g.pte.api = 51; | |
1008 printf("#1007:main5: %d %d\n",i++,g.pte.api); | |
1009 g.pte.api = 52; | |
1010 printf("#1009:main5: %d %d\n",i++,g.pte.api); | |
1011 g.pte.api = 53; | |
1012 printf("#1011:main5: %d %d\n",i++,g.pte.api); | |
1013 g.pte.api = 54; | |
1014 printf("#1013:main5: %d %d\n",i++,g.pte.api); | |
1015 g.pte.api = 55; | |
1016 printf("#1015:main5: %d %d\n",i++,g.pte.api); | |
1017 g.pte.api = 56; | |
1018 printf("#1017:main5: %d %d\n",i++,g.pte.api); | |
1019 g.pte.api = 57; | |
1020 printf("#1019:main5: %d %d\n",i++,g.pte.api); | |
1021 g.pte.api = 58; | |
1022 printf("#1021:main5: %d %d\n",i++,g.pte.api); | |
1023 g.pte.api = 59; | |
1024 printf("#1023:main5: %d %d\n",i++,g.pte.api); | |
1025 g.pte.api = 60; | |
1026 printf("#1025:main5: %d %d\n",i++,g.pte.api); | |
1027 g.pte.api = 61; | |
1028 printf("#1027:main5: %d %d\n",i++,g.pte.api); | |
1029 g.pte.api = 62; | |
1030 printf("#1029:main5: %d %d\n",i++,g.pte.api); | |
1031 g.pte.api = 63; | |
1032 printf("#1031:main5: %d %d\n",i++,g.pte.api); | |
365 | 1033 } |
545 | 1034 void |
365 | 1035 main7() |
1036 { | |
1037 int i; | |
1038 for (i=-2;i<2;i++) { | |
880 | 1039 g.pte.api = i; |
1040 if (g.pte.api) { | |
1041 printf("#1040:main 7:1 %d yes\n",i); | |
1042 } else { | |
1043 printf("#1042:main 7:1 %d no\n",i); | |
1044 } | |
1045 if (g.pte.api==1) { | |
1046 printf("#1045:main 7:2 %d yes\n",i); | |
1047 } else { | |
1048 printf("#1047:main 7:2 %d no\n",i); | |
1049 } | |
1050 if (g.pte.api==-1) { | |
1051 printf("#1050:main 7:3 %d yes\n",i); | |
1052 } else { | |
1053 printf("#1052:main 7:3 %d no\n",i); | |
1054 } | |
365 | 1055 } |
1056 for (i=-2;i<2;i++) { | |
880 | 1057 g.sg.v = i; |
1058 if (g.sg.v) { | |
1059 printf("#1058:main 7:4 %d yes\n",i); | |
1060 } else { | |
1061 printf("#1060:main 7:4 %d no\n",i); | |
1062 } | |
1063 if (g.sg.v==1) { // always false | |
1064 printf("#1063:main 7:5 %d yes\n",i); | |
1065 } else { | |
1066 printf("#1065:main 7:5 %d no\n",i); | |
1067 } | |
1068 if (g.sg.v==-1) { | |
1069 printf("#1068:main 7:6 %d yes\n",i); | |
1070 } else { | |
1071 printf("#1070:main 7:6 %d no\n",i); | |
1072 } | |
365 | 1073 } |
1074 } | |
1075 | |
1076 /* end */ |