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

Side by Side Diff: runtime/vm/disassembler_arm.cc

Issue 19290006: Implements ARM SIMD multiplication and subtraction instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ARM. 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
8 #if defined(TARGET_ARCH_ARM) 8 #if defined(TARGET_ARCH_ARM)
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 10
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 return 8; 524 return 8;
525 } 525 }
526 } else if (format[1] == 'v') { // 'svc 526 } else if (format[1] == 'v') { // 'svc
527 ASSERT(STRING_STARTS_WITH(format, "svc")); 527 ASSERT(STRING_STARTS_WITH(format, "svc"));
528 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), 528 buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
529 remaining_size_in_buffer(), 529 remaining_size_in_buffer(),
530 "0x%x", 530 "0x%x",
531 instr->SvcField()); 531 instr->SvcField());
532 return 3; 532 return 3;
533 } else if (format[1] == 'z') { 533 } else if (format[1] == 'z') {
534 // 'sz: Size field of SIMD instruction. 534 // 'sz: Size field of SIMD instructions.
535 int sz = 8 << (instr->Bits(20, 2)); 535 int sz = 8 << (instr->Bits(20, 2));
536 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), 536 buffer_pos_ += OS::SNPrint(current_position_in_buffer(),
537 remaining_size_in_buffer(), 537 remaining_size_in_buffer(),
538 "I%d", 538 "I%d",
539 sz); 539 sz);
540 return 2; 540 return 2;
541 } else if (format[1] == ' ') { 541 } else if (format[1] == ' ') {
542 // 's: S field of data processing instructions. 542 // 's: S field of data processing instructions.
543 if (instr->HasS()) { 543 if (instr->HasS()) {
544 Print("s"); 544 Print("s");
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 } else { 1263 } else {
1264 Unknown(instr); 1264 Unknown(instr);
1265 } 1265 }
1266 } 1266 }
1267 1267
1268 1268
1269 void ARMDecoder::DecodeSIMDDataProcessing(Instr* instr) { 1269 void ARMDecoder::DecodeSIMDDataProcessing(Instr* instr) {
1270 ASSERT(instr->ConditionField() == kSpecialCondition); 1270 ASSERT(instr->ConditionField() == kSpecialCondition);
1271 if (instr->Bit(6) == 1) { 1271 if (instr->Bit(6) == 1) {
1272 if ((instr->Bits(8, 4) == 8) && (instr->Bit(4) == 0) && 1272 if ((instr->Bits(8, 4) == 8) && (instr->Bit(4) == 0) &&
1273 (instr->Bit(24) == 0)) { 1273 (instr->Bits(23, 2) == 0)) {
1274 Format(instr, "vadd.'sz 'qd, 'qn, 'qm"); 1274 Format(instr, "vadd.'sz 'qd, 'qn, 'qm");
regis 2013/07/16 00:23:30 This will print 'vadd.I16' for example. So far, we
zra 2013/07/16 16:11:01 Done.
1275 } else if ((instr->Bits(8, 4) == 13) && (instr->Bit(4) == 0) && 1275 } else if ((instr->Bits(8, 4) == 13) && (instr->Bit(4) == 0) &&
1276 (instr->Bit(24) == 0)) { 1276 (instr->Bits(23, 2) == 0) && (instr->Bit(21) == 0)) {
1277 Format(instr, "vadd.F32 'qd, 'qn, 'qm"); 1277 Format(instr, "vadd.F32 'qd, 'qn, 'qm");
regis 2013/07/16 00:23:30 If we apply the logic above, this would be 'vaddqs
zra 2013/07/16 16:11:01 Done.
1278 } else if ((instr->Bits(8, 4) == 8) && (instr->Bit(4) == 0) &&
1279 (instr->Bits(23, 2) == 2)) {
1280 Format(instr, "vsub.'sz 'qd, 'qn, 'qm");
1281 } else if ((instr->Bits(8, 4) == 13) && (instr->Bit(4) == 0) &&
1282 (instr->Bits(23, 2) == 0) && (instr->Bit(21) == 1)) {
1283 Format(instr, "vsub.F32 'qd, 'qn, 'qm");
1284 } else if ((instr->Bits(8, 4) == 9) && (instr->Bit(4) == 1) &&
1285 (instr->Bits(23, 2) == 0)) {
1286 Format(instr, "vmul.'sz 'qd, 'qn, 'qm");
1287 } else if ((instr->Bits(8, 4) == 13) && (instr->Bit(4) == 1) &&
1288 (instr->Bits(23, 2) == 2) && (instr->Bit(21) == 0)) {
1289 Format(instr, "vmul.F32 'qd, 'qn, 'qm");
1278 } else { 1290 } else {
1279 Unknown(instr); 1291 Unknown(instr);
1280 } 1292 }
1281 } else { 1293 } else {
1282 Unknown(instr); 1294 Unknown(instr);
1283 } 1295 }
1284 } 1296 }
1285 1297
1286 1298
1287 void ARMDecoder::InstructionDecode(uword pc) { 1299 void ARMDecoder::InstructionDecode(uword pc) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 human_buffer, 1391 human_buffer,
1380 sizeof(human_buffer), 1392 sizeof(human_buffer),
1381 pc); 1393 pc);
1382 pc += instruction_length; 1394 pc += instruction_length;
1383 } 1395 }
1384 } 1396 }
1385 1397
1386 } // namespace dart 1398 } // namespace dart
1387 1399
1388 #endif // defined TARGET_ARCH_ARM 1400 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698