OLD | NEW |
1 // Inferno utils/5c/peep.c | 1 // Inferno utils/5c/peep.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/5g/peep.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/5g/peep.c |
3 // | 3 // |
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) | 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) |
6 // Portions Copyright © 1997-1999 Vita Nuova Limited | 6 // Portions Copyright © 1997-1999 Vita Nuova Limited |
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) | 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) |
8 // Portions Copyright © 2004,2006 Bruce Ellis | 8 // Portions Copyright © 2004,2006 Bruce Ellis |
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) | 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) |
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others | 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 if(!regtyp(v2)) | 326 if(!regtyp(v2)) |
327 return 0; | 327 return 0; |
328 for(r=uniqp(r0); r!=R; r=uniqp(r)) { | 328 for(r=uniqp(r0); r!=R; r=uniqp(r)) { |
329 if(uniqs(r) == R) | 329 if(uniqs(r) == R) |
330 break; | 330 break; |
331 p = r->prog; | 331 p = r->prog; |
332 switch(p->as) { | 332 switch(p->as) { |
333 case ABL: | 333 case ABL: |
334 return 0; | 334 return 0; |
335 | 335 |
| 336 case AMULLU: |
| 337 case AMULA: |
| 338 |
336 case ACMN: | 339 case ACMN: |
337 case AADD: | 340 case AADD: |
338 case ASUB: | 341 case ASUB: |
339 case ASBC: | 342 case ASBC: |
340 case ARSB: | 343 case ARSB: |
341 case ASLL: | 344 case ASLL: |
342 case ASRL: | 345 case ASRL: |
343 case ASRA: | 346 case ASRA: |
344 case AORR: | 347 case AORR: |
345 case AAND: | 348 case AAND: |
346 case AEOR: | 349 case AEOR: |
| 350 case AMVN: |
347 case AMUL: | 351 case AMUL: |
| 352 case AMULU: |
348 case ADIV: | 353 case ADIV: |
349 case ADIVU: | 354 case ADIVU: |
| 355 case AMOD: |
| 356 case AMODU: |
350 | 357 |
351 case AADDD: | 358 case AADDD: |
352 case AADDF: | 359 case AADDF: |
353 case ASUBD: | 360 case ASUBD: |
354 case ASUBF: | 361 case ASUBF: |
355 case AMULD: | 362 case AMULD: |
356 case AMULF: | 363 case AMULF: |
357 case ADIVD: | 364 case ADIVD: |
358 case ADIVF: | 365 case ADIVF: |
359 if(p->to.type == v1->type) | 366 if(p->to.type == v1->type) |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 if(copyau(&p->from, v)) | 1005 if(copyau(&p->from, v)) |
999 return 4; | 1006 return 4; |
1000 return 3; | 1007 return 3; |
1001 } | 1008 } |
1002 if(copyau(&p->from, v)) | 1009 if(copyau(&p->from, v)) |
1003 return 1; | 1010 return 1; |
1004 if(copyau(&p->to, v)) | 1011 if(copyau(&p->to, v)) |
1005 return 1; | 1012 return 1; |
1006 return 0; | 1013 return 0; |
1007 | 1014 |
| 1015 case AMULLU: /* read, read, write, write */ |
| 1016 case AMULA: |
| 1017 return 2; |
| 1018 |
1008 case AADD: /* read, read, write */ | 1019 case AADD: /* read, read, write */ |
| 1020 case AADC: |
1009 case ASUB: | 1021 case ASUB: |
1010 case ASBC: | 1022 case ASBC: |
1011 case ARSB: | 1023 case ARSB: |
1012 case ASLL: | 1024 case ASLL: |
1013 case ASRL: | 1025 case ASRL: |
1014 case ASRA: | 1026 case ASRA: |
1015 case AORR: | 1027 case AORR: |
1016 case AAND: | 1028 case AAND: |
1017 case AEOR: | 1029 case AEOR: |
| 1030 case AMVN: |
1018 case AMUL: | 1031 case AMUL: |
| 1032 case AMULU: |
1019 case ADIV: | 1033 case ADIV: |
1020 case ADIVU: | 1034 case ADIVU: |
| 1035 case AMOD: |
| 1036 case AMODU: |
1021 case AADDF: | 1037 case AADDF: |
1022 case AADDD: | 1038 case AADDD: |
1023 case ASUBF: | 1039 case ASUBF: |
1024 case ASUBD: | 1040 case ASUBD: |
1025 case AMULF: | 1041 case AMULF: |
1026 case AMULD: | 1042 case AMULD: |
1027 case ADIVF: | 1043 case ADIVF: |
1028 case ADIVD: | 1044 case ADIVD: |
1029 | 1045 |
1030 case ACMPF: | 1046 case ACMPF: |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 int | 1153 int |
1138 a2type(Prog *p) | 1154 a2type(Prog *p) |
1139 { | 1155 { |
1140 | 1156 |
1141 switch(p->as) { | 1157 switch(p->as) { |
1142 | 1158 |
1143 case ATST: | 1159 case ATST: |
1144 case ACMP: | 1160 case ACMP: |
1145 case ACMN: | 1161 case ACMN: |
1146 | 1162 |
| 1163 case AMULLU: |
| 1164 case AMULA: |
| 1165 |
1147 case AADD: | 1166 case AADD: |
1148 case ASUB: | 1167 case ASUB: |
1149 case ARSB: | 1168 case ARSB: |
1150 case ASLL: | 1169 case ASLL: |
1151 case ASRL: | 1170 case ASRL: |
1152 case ASRA: | 1171 case ASRA: |
1153 case AORR: | 1172 case AORR: |
1154 case AAND: | 1173 case AAND: |
1155 case AEOR: | 1174 case AEOR: |
| 1175 case AMVN: |
1156 case AMUL: | 1176 case AMUL: |
| 1177 case AMULU: |
1157 case ADIV: | 1178 case ADIV: |
1158 case ADIVU: | 1179 case ADIVU: |
| 1180 case AMOD: |
| 1181 case AMODU: |
1159 return D_REG; | 1182 return D_REG; |
1160 | 1183 |
1161 case ACMPF: | 1184 case ACMPF: |
1162 case ACMPD: | 1185 case ACMPD: |
1163 | 1186 |
1164 case AADDF: | 1187 case AADDF: |
1165 case AADDD: | 1188 case AADDD: |
1166 case ASUBF: | 1189 case ASUBF: |
1167 case ASUBD: | 1190 case ASUBD: |
1168 case AMULF: | 1191 case AMULF: |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 * Depends on an analysis of the encodings performed by 5l. | 1388 * Depends on an analysis of the encodings performed by 5l. |
1366 * These seem to be all of the opcodes that lead to the "S" bit | 1389 * These seem to be all of the opcodes that lead to the "S" bit |
1367 * being set in the instruction encodings. | 1390 * being set in the instruction encodings. |
1368 * | 1391 * |
1369 * C_SBIT may also have been set explicitly in p->scond. | 1392 * C_SBIT may also have been set explicitly in p->scond. |
1370 */ | 1393 */ |
1371 int | 1394 int |
1372 modifiescpsr(Prog *p) | 1395 modifiescpsr(Prog *p) |
1373 { | 1396 { |
1374 switch(p->as) { | 1397 switch(p->as) { |
| 1398 case AMULLU: |
| 1399 case AMULA: |
| 1400 case AMULU: |
| 1401 case ADIVU: |
| 1402 |
1375 case ATEQ: | 1403 case ATEQ: |
1376 case ACMN: | 1404 case ACMN: |
1377 case ATST: | 1405 case ATST: |
1378 case ACMP: | 1406 case ACMP: |
1379 case AMULU: | |
1380 case ADIVU: | |
1381 case AMUL: | 1407 case AMUL: |
1382 case ADIV: | 1408 case ADIV: |
1383 case AMOD: | 1409 case AMOD: |
1384 case AMODU: | 1410 case AMODU: |
1385 case ABL: | 1411 case ABL: |
1386 return 1; | 1412 return 1; |
1387 } | 1413 } |
1388 if(p->scond & C_SBIT) | 1414 if(p->scond & C_SBIT) |
1389 return 1; | 1415 return 1; |
1390 return 0; | 1416 return 0; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 } | 1531 } |
1506 } | 1532 } |
1507 | 1533 |
1508 int | 1534 int |
1509 isdconst(Addr *a) | 1535 isdconst(Addr *a) |
1510 { | 1536 { |
1511 if(a->type == D_CONST && a->reg == NREG) | 1537 if(a->type == D_CONST && a->reg == NREG) |
1512 return 1; | 1538 return 1; |
1513 return 0; | 1539 return 0; |
1514 } | 1540 } |
OLD | NEW |