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

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

Issue 8888020: Teach the assembler how to generate multi-byte nops. Teach the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/disassembler.h" 8 #include "vm/disassembler.h"
9 9
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 data += CMov(data); 1115 data += CMov(data);
1116 } else if (f0byte == 0x2F) { 1116 } else if (f0byte == 0x2F) {
1117 data += 2; 1117 data += 2;
1118 int mod, regop, rm; 1118 int mod, regop, rm;
1119 GetModRm(*data, &mod, &regop, &rm); 1119 GetModRm(*data, &mod, &regop, &rm);
1120 Print("comiss "); 1120 Print("comiss ");
1121 PrintXmmRegister(regop); 1121 PrintXmmRegister(regop);
1122 Print(","); 1122 Print(",");
1123 PrintXmmRegister(rm); 1123 PrintXmmRegister(rm);
1124 data++; 1124 data++;
1125 } else if (f0byte == 0x1F) {
1126 if (*(data+2) == 0x00) {
1127 Print("nop");
1128 data += 3;
1129 } else if (*(data+2) == 0x40 && *(data+3) == 0x00) {
1130 Print("nop");
1131 data += 4;
1132 } else if (*(data+2) == 0x44 &&
1133 *(data+3) == 0x00 &&
1134 *(data+4) == 0x00) {
1135 Print("nop");
1136 data += 5;
1137 } else if (*(data+2) == 0x80 &&
1138 *(data+3) == 0x00 &&
1139 *(data+3) == 0x00 &&
1140 *(data+3) == 0x00 &&
1141 *(data+4) == 0x00) {
1142 Print("nop");
1143 data += 7;
1144 } else if (*(data+2) == 0x84 &&
1145 *(data+3) == 0x00 &&
1146 *(data+3) == 0x00 &&
1147 *(data+3) == 0x00 &&
1148 *(data+3) == 0x00 &&
1149 *(data+4) == 0x00) {
1150 Print("nop");
1151 data += 8;
1152 } else {
1153 UNIMPLEMENTED();
1154 }
1125 } else { 1155 } else {
1126 data += 2; 1156 data += 2;
1127 if (f0byte == 0xAB || f0byte == 0xA5 || f0byte == 0xAD) { 1157 if (f0byte == 0xAB || f0byte == 0xA5 || f0byte == 0xAD) {
1128 // shrd, shld, bts 1158 // shrd, shld, bts
1129 Print(f0mnem); 1159 Print(f0mnem);
1130 int mod, regop, rm; 1160 int mod, regop, rm;
1131 GetModRm(*data, &mod, &regop, &rm); 1161 GetModRm(*data, &mod, &regop, &rm);
1132 data += PrintRightOperand(data); 1162 data += PrintRightOperand(data);
1133 if (f0byte == 0xAB) { 1163 if (f0byte == 0xAB) {
1134 Print(","); 1164 Print(",");
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 } else if (*data == 0x57 || *data == 0x54) { 1289 } else if (*data == 0x57 || *data == 0x54) {
1260 const char* mnem = (*data == 0x57) ? "xorpd" : "andpd"; 1290 const char* mnem = (*data == 0x57) ? "xorpd" : "andpd";
1261 data++; 1291 data++;
1262 int mod, regop, rm; 1292 int mod, regop, rm;
1263 GetModRm(*data, &mod, &regop, &rm); 1293 GetModRm(*data, &mod, &regop, &rm);
1264 Print(mnem); 1294 Print(mnem);
1265 Print(" "); 1295 Print(" ");
1266 PrintXmmRegister(regop); 1296 PrintXmmRegister(regop);
1267 Print(","); 1297 Print(",");
1268 data += PrintRightXmmOperand(data); 1298 data += PrintRightXmmOperand(data);
1299 } else if (*data == 0x1F &&
1300 *(data+1) == 0x44 &&
1301 *(data+2) == 0x00 &&
1302 *(data+3) == 0x00) {
1303 data += 4;
1304 Print("nop");
1269 } else { 1305 } else {
1270 UNIMPLEMENTED(); 1306 UNIMPLEMENTED();
1271 } 1307 }
1308 } else if (*data == 0x90) {
1309 data++;
1310 Print("nop");
1272 } else { 1311 } else {
1273 UNIMPLEMENTED(); 1312 UNIMPLEMENTED();
1274 } 1313 }
1275 break; 1314 break;
1276 1315
1277 case 0xFE: 1316 case 0xFE:
1278 { data++; 1317 { data++;
1279 int mod, regop, rm; 1318 int mod, regop, rm;
1280 GetModRm(*data, &mod, &regop, &rm); 1319 GetModRm(*data, &mod, &regop, &rm);
1281 if (mod == 3 && regop == ecx) { 1320 if (mod == 3 && regop == ecx) {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 human_buffer, 1576 human_buffer,
1538 sizeof(human_buffer), 1577 sizeof(human_buffer),
1539 pc); 1578 pc);
1540 pc += instruction_length; 1579 pc += instruction_length;
1541 } 1580 }
1542 } 1581 }
1543 1582
1544 } // namespace dart 1583 } // namespace dart
1545 1584
1546 #endif // defined TARGET_ARCH_IA32 1585 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698