OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <assert.h> | 5 #include <assert.h> |
6 #include <stdarg.h> | 6 #include <stdarg.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #if V8_TARGET_ARCH_ARM64 | 10 #if V8_TARGET_ARCH_ARM64 |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 907 |
908 switch (instr->Mask(LoadStorePairOffsetMask)) { | 908 switch (instr->Mask(LoadStorePairOffsetMask)) { |
909 #define LSP_OFFSET(A, B, C, D) \ | 909 #define LSP_OFFSET(A, B, C, D) \ |
910 case A##_off: mnemonic = B; form = C ", ['Xns'ILP" D "]"; break; | 910 case A##_off: mnemonic = B; form = C ", ['Xns'ILP" D "]"; break; |
911 LOAD_STORE_PAIR_LIST(LSP_OFFSET) | 911 LOAD_STORE_PAIR_LIST(LSP_OFFSET) |
912 #undef LSP_OFFSET | 912 #undef LSP_OFFSET |
913 } | 913 } |
914 Format(instr, mnemonic, form); | 914 Format(instr, mnemonic, form); |
915 } | 915 } |
916 | 916 |
| 917 void DisassemblingDecoder::VisitLoadStoreAcquireRelease(Instruction *instr) { |
| 918 const char *mnemonic = "unimplemented"; |
| 919 const char *form = "'Wt, ['Xn]"; |
| 920 const char *form_x = "'Xt, ['Xn]"; |
| 921 const char *form_stlx = "'Ws, 'Wt, ['Xn]"; |
| 922 const char *form_stlx_x = "'Ws, 'Xt, ['Xn]"; |
| 923 |
| 924 switch (instr->Mask(LoadStoreAcquireReleaseMask)) { |
| 925 case LDAXR_b: mnemonic = "ldaxrb"; break; |
| 926 case STLR_b: mnemonic = "stlrb"; break; |
| 927 case LDAR_b: mnemonic = "ldarb"; break; |
| 928 case LDAXR_h: mnemonic = "ldaxrh"; break; |
| 929 case STLR_h: mnemonic = "stlrh"; break; |
| 930 case LDAR_h: mnemonic = "ldarh"; break; |
| 931 case LDAXR_w: mnemonic = "ldaxr"; break; |
| 932 case STLR_w: mnemonic = "stlr"; break; |
| 933 case LDAR_w: mnemonic = "ldar"; break; |
| 934 case LDAXR_x: mnemonic = "ldaxr"; form = form_x; break; |
| 935 case STLR_x: mnemonic = "stlr"; form = form_x; break; |
| 936 case LDAR_x: mnemonic = "ldar"; form = form_x; break; |
| 937 case STLXR_h: mnemonic = "stlxrh"; form = form_stlx; break; |
| 938 case STLXR_b: mnemonic = "stlxrb"; form = form_stlx; break; |
| 939 case STLXR_w: mnemonic = "stlxr"; form = form_stlx; break; |
| 940 case STLXR_x: mnemonic = "stlxr"; form = form_stlx_x; break; |
| 941 default: form = "(LoadStoreAcquireReleaseMask)"; |
| 942 } |
| 943 Format(instr, mnemonic, form); |
| 944 } |
917 | 945 |
918 void DisassemblingDecoder::VisitFPCompare(Instruction* instr) { | 946 void DisassemblingDecoder::VisitFPCompare(Instruction* instr) { |
919 const char *mnemonic = "unimplemented"; | 947 const char *mnemonic = "unimplemented"; |
920 const char *form = "'Fn, 'Fm"; | 948 const char *form = "'Fn, 'Fm"; |
921 const char *form_zero = "'Fn, #0.0"; | 949 const char *form_zero = "'Fn, #0.0"; |
922 | 950 |
923 switch (instr->Mask(FPCompareMask)) { | 951 switch (instr->Mask(FPCompareMask)) { |
924 case FCMP_s_zero: | 952 case FCMP_s_zero: |
925 case FCMP_d_zero: form = form_zero; // Fall through. | 953 case FCMP_d_zero: form = form_zero; // Fall through. |
926 case FCMP_s: | 954 case FCMP_s: |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 case 'a': reg_num = instr->Ra(); break; | 1316 case 'a': reg_num = instr->Ra(); break; |
1289 case 't': { | 1317 case 't': { |
1290 if (format[2] == '2') { | 1318 if (format[2] == '2') { |
1291 reg_num = instr->Rt2(); | 1319 reg_num = instr->Rt2(); |
1292 field_len = 3; | 1320 field_len = 3; |
1293 } else { | 1321 } else { |
1294 reg_num = instr->Rt(); | 1322 reg_num = instr->Rt(); |
1295 } | 1323 } |
1296 break; | 1324 break; |
1297 } | 1325 } |
| 1326 case 's': |
| 1327 reg_num = instr->Rs(); |
| 1328 break; |
1298 default: UNREACHABLE(); | 1329 default: UNREACHABLE(); |
1299 } | 1330 } |
1300 | 1331 |
1301 // Increase field length for registers tagged as stack. | 1332 // Increase field length for registers tagged as stack. |
1302 if (format[2] == 's') { | 1333 if (format[2] == 's') { |
1303 field_len = 3; | 1334 field_len = 3; |
1304 } | 1335 } |
1305 | 1336 |
1306 char reg_type; | 1337 char reg_type; |
1307 if (format[0] == 'R') { | 1338 if (format[0] == 'R') { |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1808 decoder.AppendVisitor(&disasm); | 1839 decoder.AppendVisitor(&disasm); |
1809 | 1840 |
1810 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { | 1841 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { |
1811 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); | 1842 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); |
1812 } | 1843 } |
1813 } | 1844 } |
1814 | 1845 |
1815 } // namespace disasm | 1846 } // namespace disasm |
1816 | 1847 |
1817 #endif // V8_TARGET_ARCH_ARM64 | 1848 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |