OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 case 'i': { // 'i: immediate value from adjacent bits. | 456 case 'i': { // 'i: immediate value from adjacent bits. |
457 // Expects tokens in the form imm%02d@%02d, ie. imm05@07, imm10@16 | 457 // Expects tokens in the form imm%02d@%02d, ie. imm05@07, imm10@16 |
458 int width = (format[3] - '0') * 10 + (format[4] - '0'); | 458 int width = (format[3] - '0') * 10 + (format[4] - '0'); |
459 int lsb = (format[6] - '0') * 10 + (format[7] - '0'); | 459 int lsb = (format[6] - '0') * 10 + (format[7] - '0'); |
460 | 460 |
461 ASSERT((width >= 1) && (width <= 32)); | 461 ASSERT((width >= 1) && (width <= 32)); |
462 ASSERT((lsb >= 0) && (lsb <= 31)); | 462 ASSERT((lsb >= 0) && (lsb <= 31)); |
463 ASSERT((width + lsb) <= 32); | 463 ASSERT((width + lsb) <= 32); |
464 | 464 |
465 out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, | 465 out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, |
466 "#%d", | 466 "%d", |
467 instr->Bits(width + lsb - 1, lsb)); | 467 instr->Bits(width + lsb - 1, lsb)); |
468 return 8; | 468 return 8; |
469 } | 469 } |
470 case 'l': { // 'l: branch and link | 470 case 'l': { // 'l: branch and link |
471 if (instr->HasLink()) { | 471 if (instr->HasLink()) { |
472 Print("l"); | 472 Print("l"); |
473 } | 473 } |
474 return 1; | 474 return 1; |
475 } | 475 } |
476 case 'm': { | 476 case 'm': { |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 switch (instr->PUField()) { | 924 switch (instr->PUField()) { |
925 case 0: { | 925 case 0: { |
926 ASSERT(!instr->HasW()); | 926 ASSERT(!instr->HasW()); |
927 Format(instr, "'memop'cond'b 'rd, ['rn], -'shift_rm"); | 927 Format(instr, "'memop'cond'b 'rd, ['rn], -'shift_rm"); |
928 break; | 928 break; |
929 } | 929 } |
930 case 1: { | 930 case 1: { |
931 if (instr->HasW()) { | 931 if (instr->HasW()) { |
932 ASSERT(instr->Bits(5, 4) == 0x1); | 932 ASSERT(instr->Bits(5, 4) == 0x1); |
933 if (instr->Bit(22) == 0x1) { | 933 if (instr->Bit(22) == 0x1) { |
934 Format(instr, "usat 'rd, 'imm05@16, 'rm'shift_sat"); | 934 Format(instr, "usat 'rd, #'imm05@16, 'rm'shift_sat"); |
935 } else { | 935 } else { |
936 UNREACHABLE(); // SSAT. | 936 UNREACHABLE(); // SSAT. |
937 } | 937 } |
938 } else { | 938 } else { |
939 Format(instr, "'memop'cond'b 'rd, ['rn], +'shift_rm"); | 939 Format(instr, "'memop'cond'b 'rd, ['rn], +'shift_rm"); |
940 } | 940 } |
941 break; | 941 break; |
942 } | 942 } |
943 case 2: { | 943 case 2: { |
944 Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w"); | 944 Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w"); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 // Dm = vmov(Rt, Rt2) | 1262 // Dm = vmov(Rt, Rt2) |
1263 // <Rt, Rt2> = vmov(Dm) | 1263 // <Rt, Rt2> = vmov(Dm) |
1264 // Ddst = MEM(Rbase + 4*offset). | 1264 // Ddst = MEM(Rbase + 4*offset). |
1265 // MEM(Rbase + 4*offset) = Dsrc. | 1265 // MEM(Rbase + 4*offset) = Dsrc. |
1266 void Decoder::DecodeType6CoprocessorIns(Instr* instr) { | 1266 void Decoder::DecodeType6CoprocessorIns(Instr* instr) { |
1267 ASSERT((instr->TypeField() == 6)); | 1267 ASSERT((instr->TypeField() == 6)); |
1268 | 1268 |
1269 if (instr->CoprocessorField() == 0xA) { | 1269 if (instr->CoprocessorField() == 0xA) { |
1270 switch (instr->OpcodeField()) { | 1270 switch (instr->OpcodeField()) { |
1271 case 0x8: | 1271 case 0x8: |
| 1272 case 0xA: |
1272 if (instr->HasL()) { | 1273 if (instr->HasL()) { |
1273 Format(instr, "vldr'cond 'Sd, ['rn - 4*'off8]"); | 1274 Format(instr, "vldr'cond 'Sd, ['rn - 4*'imm08@00]"); |
1274 } else { | 1275 } else { |
1275 Format(instr, "vstr'cond 'Sd, ['rn - 4*'off8]"); | 1276 Format(instr, "vstr'cond 'Sd, ['rn - 4*'imm08@00]"); |
1276 } | 1277 } |
1277 break; | 1278 break; |
1278 case 0xC: | 1279 case 0xC: |
| 1280 case 0xE: |
1279 if (instr->HasL()) { | 1281 if (instr->HasL()) { |
1280 Format(instr, "vldr'cond 'Sd, ['rn + 4*'off8]"); | 1282 Format(instr, "vldr'cond 'Sd, ['rn + 4*'imm08@00]"); |
1281 } else { | 1283 } else { |
1282 Format(instr, "vstr'cond 'Sd, ['rn + 4*'off8]"); | 1284 Format(instr, "vstr'cond 'Sd, ['rn + 4*'imm08@00]"); |
1283 } | 1285 } |
1284 break; | 1286 break; |
1285 default: | 1287 default: |
1286 Unknown(instr); // Not used by V8. | 1288 Unknown(instr); // Not used by V8. |
1287 break; | 1289 break; |
1288 } | 1290 } |
1289 } else if (instr->CoprocessorField() == 0xB) { | 1291 } else if (instr->CoprocessorField() == 0xB) { |
1290 switch (instr->OpcodeField()) { | 1292 switch (instr->OpcodeField()) { |
1291 case 0x2: | 1293 case 0x2: |
1292 // Load and store double to two GP registers | 1294 // Load and store double to two GP registers |
1293 if (instr->Bits(7, 4) != 0x1) { | 1295 if (instr->Bits(7, 4) != 0x1) { |
1294 Unknown(instr); // Not used by V8. | 1296 Unknown(instr); // Not used by V8. |
1295 } else if (instr->HasL()) { | 1297 } else if (instr->HasL()) { |
1296 Format(instr, "vmov'cond 'rt, 'rn, 'Dm"); | 1298 Format(instr, "vmov'cond 'rt, 'rn, 'Dm"); |
1297 } else { | 1299 } else { |
1298 Format(instr, "vmov'cond 'Dm, 'rt, 'rn"); | 1300 Format(instr, "vmov'cond 'Dm, 'rt, 'rn"); |
1299 } | 1301 } |
1300 break; | 1302 break; |
1301 case 0x8: | 1303 case 0x8: |
1302 if (instr->HasL()) { | 1304 if (instr->HasL()) { |
1303 Format(instr, "vldr'cond 'Dd, ['rn - 4*'off8]"); | 1305 Format(instr, "vldr'cond 'Dd, ['rn - 4*'imm08@00]"); |
1304 } else { | 1306 } else { |
1305 Format(instr, "vstr'cond 'Dd, ['rn - 4*'off8]"); | 1307 Format(instr, "vstr'cond 'Dd, ['rn - 4*'imm08@00]"); |
1306 } | 1308 } |
1307 break; | 1309 break; |
1308 case 0xC: | 1310 case 0xC: |
1309 if (instr->HasL()) { | 1311 if (instr->HasL()) { |
1310 Format(instr, "vldr'cond 'Dd, ['rn + 4*'off8]"); | 1312 Format(instr, "vldr'cond 'Dd, ['rn + 4*'imm08@00]"); |
1311 } else { | 1313 } else { |
1312 Format(instr, "vstr'cond 'Dd, ['rn + 4*'off8]"); | 1314 Format(instr, "vstr'cond 'Dd, ['rn + 4*'imm08@00]"); |
1313 } | 1315 } |
1314 break; | 1316 break; |
1315 default: | 1317 default: |
1316 Unknown(instr); // Not used by V8. | 1318 Unknown(instr); // Not used by V8. |
1317 break; | 1319 break; |
1318 } | 1320 } |
1319 } else { | 1321 } else { |
1320 UNIMPLEMENTED(); // Not used by V8. | 1322 UNIMPLEMENTED(); // Not used by V8. |
1321 } | 1323 } |
1322 } | 1324 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 pc += d.InstructionDecode(buffer, pc); | 1458 pc += d.InstructionDecode(buffer, pc); |
1457 fprintf(f, "%p %08x %s\n", | 1459 fprintf(f, "%p %08x %s\n", |
1458 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1460 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1459 } | 1461 } |
1460 } | 1462 } |
1461 | 1463 |
1462 | 1464 |
1463 } // namespace disasm | 1465 } // namespace disasm |
1464 | 1466 |
1465 #endif // V8_TARGET_ARCH_ARM | 1467 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |