Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: src/arm64/disasm-arm64.cc

Issue 1990073002: Add {lda,stl}x?r{,b,h} instructions to ARM64 assembler/disassembler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: un-clang-format some of the switch stmts Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
922 switch (instr->Mask(LoadStoreAcquireReleaseMask)) {
923 case LDAXR_b: mnemonic = "ldaxrb"; break;
924 case STLR_b: mnemonic = "stlrb"; break;
925 case LDAR_b: mnemonic = "ldarb"; break;
926 case LDAXR_h: mnemonic = "ldaxrh"; break;
927 case STLR_h: mnemonic = "stlrh"; break;
928 case LDAR_h: mnemonic = "ldarh"; break;
929 case LDAXR_w: mnemonic = "ldaxr"; break;
930 case STLR_w: mnemonic = "stlr"; break;
931 case LDAR_w: mnemonic = "ldar"; break;
932 case LDAXR_x: mnemonic = "ldaxr"; form = form_x; break;
933 case STLR_x: mnemonic = "stlr"; form = form_x; break;
934 case LDAR_x: mnemonic = "ldar"; form = form_x; break;
935 default: form = "(LoadStoreAcquireReleaseMask)";
936 }
937 Format(instr, mnemonic, form);
938 }
939
940 void DisassemblingDecoder::VisitStoreReleaseExclusive(Instruction *instr) {
941 const char *mnemonic = "unimplemented";
942 const char *form = "'Ws, 'Wt, ['Xn]";
943 const char *form_x = "'Ws, 'Xt, ['Xn]";
944
945 switch (instr->Mask(StoreReleaseExclusiveMask)) {
946 case STLXR_h: mnemonic = "stlxrh"; break;
947 case STLXR_b: mnemonic = "stlxrb"; break;
948 case STLXR_w: mnemonic = "stlxr"; break;
949 case STLXR_x: mnemonic = "stlxr"; form = form_x; break;
950 default: form = "(StoreReleaseExclusiveMask)";
951 }
952 Format(instr, mnemonic, form);
953 }
917 954
918 void DisassemblingDecoder::VisitFPCompare(Instruction* instr) { 955 void DisassemblingDecoder::VisitFPCompare(Instruction* instr) {
919 const char *mnemonic = "unimplemented"; 956 const char *mnemonic = "unimplemented";
920 const char *form = "'Fn, 'Fm"; 957 const char *form = "'Fn, 'Fm";
921 const char *form_zero = "'Fn, #0.0"; 958 const char *form_zero = "'Fn, #0.0";
922 959
923 switch (instr->Mask(FPCompareMask)) { 960 switch (instr->Mask(FPCompareMask)) {
924 case FCMP_s_zero: 961 case FCMP_s_zero:
925 case FCMP_d_zero: form = form_zero; // Fall through. 962 case FCMP_d_zero: form = form_zero; // Fall through.
926 case FCMP_s: 963 case FCMP_s:
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 case 'a': reg_num = instr->Ra(); break; 1325 case 'a': reg_num = instr->Ra(); break;
1289 case 't': { 1326 case 't': {
1290 if (format[2] == '2') { 1327 if (format[2] == '2') {
1291 reg_num = instr->Rt2(); 1328 reg_num = instr->Rt2();
1292 field_len = 3; 1329 field_len = 3;
1293 } else { 1330 } else {
1294 reg_num = instr->Rt(); 1331 reg_num = instr->Rt();
1295 } 1332 }
1296 break; 1333 break;
1297 } 1334 }
1335 case 's':
1336 reg_num = instr->Rs();
1337 break;
1298 default: UNREACHABLE(); 1338 default: UNREACHABLE();
1299 } 1339 }
1300 1340
1301 // Increase field length for registers tagged as stack. 1341 // Increase field length for registers tagged as stack.
1302 if (format[2] == 's') { 1342 if (format[2] == 's') {
1303 field_len = 3; 1343 field_len = 3;
1304 } 1344 }
1305 1345
1306 char reg_type; 1346 char reg_type;
1307 if (format[0] == 'R') { 1347 if (format[0] == 'R') {
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 decoder.AppendVisitor(&disasm); 1848 decoder.AppendVisitor(&disasm);
1809 1849
1810 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) { 1850 for (byte* pc = start; pc < end; pc += v8::internal::kInstructionSize) {
1811 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc)); 1851 decoder.Decode(reinterpret_cast<v8::internal::Instruction*>(pc));
1812 } 1852 }
1813 } 1853 }
1814 1854
1815 } // namespace disasm 1855 } // namespace disasm
1816 1856
1817 #endif // V8_TARGET_ARCH_ARM64 1857 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698