| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 8 #if defined(TARGET_ARCH_ARM64) | 8 #if defined(TARGET_ARCH_ARM64) |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 | 10 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 int ARM64Decoder::FormatVRegister(Instr* instr, const char* format) { | 305 int ARM64Decoder::FormatVRegister(Instr* instr, const char* format) { |
| 306 ASSERT(format[0] == 'v'); | 306 ASSERT(format[0] == 'v'); |
| 307 if (format[1] == 'd') { | 307 if (format[1] == 'd') { |
| 308 int reg = instr->VdField(); | 308 int reg = instr->VdField(); |
| 309 PrintVRegister(reg); | 309 PrintVRegister(reg); |
| 310 return 2; | 310 return 2; |
| 311 } else if (format[1] == 'n') { | 311 } else if (format[1] == 'n') { |
| 312 int reg = instr->VnField(); | 312 int reg = instr->VnField(); |
| 313 PrintVRegister(reg); | 313 PrintVRegister(reg); |
| 314 return 2; | 314 return 2; |
| 315 } else if (format[1] == 't') { |
| 316 int reg = instr->VtField(); |
| 317 PrintVRegister(reg); |
| 318 return 2; |
| 315 } | 319 } |
| 316 UNREACHABLE(); | 320 UNREACHABLE(); |
| 317 return -1; | 321 return -1; |
| 318 } | 322 } |
| 319 | 323 |
| 320 | 324 |
| 321 // FormatOption takes a formatting string and interprets it based on | 325 // FormatOption takes a formatting string and interprets it based on |
| 322 // the current instructions. The format string points to the first | 326 // the current instructions. The format string points to the first |
| 323 // character of the option string (the option escape has already been | 327 // character of the option string (the option escape has already been |
| 324 // consumed by the caller.) FormatOption returns the number of | 328 // consumed by the caller.) FormatOption returns the number of |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 Format(instr, "movk'sf 'rd, 'imm16 'hw"); | 551 Format(instr, "movk'sf 'rd, 'imm16 'hw"); |
| 548 break; | 552 break; |
| 549 default: | 553 default: |
| 550 Unknown(instr); | 554 Unknown(instr); |
| 551 break; | 555 break; |
| 552 } | 556 } |
| 553 } | 557 } |
| 554 | 558 |
| 555 | 559 |
| 556 void ARM64Decoder::DecodeLoadStoreReg(Instr* instr) { | 560 void ARM64Decoder::DecodeLoadStoreReg(Instr* instr) { |
| 557 if (instr->Bits(25, 2) != 0) { | 561 if (instr->Bit(23) != 0) { |
| 562 // 128-bit ldr/str. |
| 558 Unknown(instr); | 563 Unknown(instr); |
| 559 return; | |
| 560 } | 564 } |
| 561 if (instr->Bit(22) == 1) { | 565 if (instr->Bit(26) == 1) { |
| 562 Format(instr, "ldr'sz 'rt, 'memop"); | 566 if (instr->Bits(30, 2) != 3) { |
| 567 // Only 64-bit double variant supported. |
| 568 Unknown(instr); |
| 569 } |
| 570 // SIMD or FP src/dst. |
| 571 if (instr->Bit(22) == 1) { |
| 572 Format(instr, "fldrd 'vt, 'memop"); |
| 573 } else { |
| 574 Format(instr, "fstrd 'vt, 'memop"); |
| 575 } |
| 563 } else { | 576 } else { |
| 564 Format(instr, "str'sz 'rt, 'memop"); | 577 // Integer src/dst. |
| 578 if (instr->Bit(22) == 1) { |
| 579 Format(instr, "ldr'sz 'rt, 'memop"); |
| 580 } else { |
| 581 Format(instr, "str'sz 'rt, 'memop"); |
| 582 } |
| 565 } | 583 } |
| 566 } | 584 } |
| 567 | 585 |
| 568 | 586 |
| 569 void ARM64Decoder::DecodeLoadRegLiteral(Instr* instr) { | 587 void ARM64Decoder::DecodeLoadRegLiteral(Instr* instr) { |
| 570 if ((instr->Bit(31) != 0) || (instr->Bit(29) != 0) || | 588 if ((instr->Bit(31) != 0) || (instr->Bit(29) != 0) || |
| 571 (instr->Bits(24, 3) != 0)) { | 589 (instr->Bits(24, 3) != 0)) { |
| 572 Unknown(instr); | 590 Unknown(instr); |
| 573 } | 591 } |
| 574 if (instr->Bit(30)) { | 592 if (instr->Bit(30)) { |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 human_buffer, | 1052 human_buffer, |
| 1035 sizeof(human_buffer), | 1053 sizeof(human_buffer), |
| 1036 pc); | 1054 pc); |
| 1037 pc += instruction_length; | 1055 pc += instruction_length; |
| 1038 } | 1056 } |
| 1039 } | 1057 } |
| 1040 | 1058 |
| 1041 } // namespace dart | 1059 } // namespace dart |
| 1042 | 1060 |
| 1043 #endif // defined TARGET_ARCH_ARM | 1061 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |