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

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

Issue 12837009: Adds MIPS SPECIAL instructions to simulator, assembler, debugger. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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_MIPS. 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
8 #if defined(TARGET_ARCH_MIPS) 8 #if defined(TARGET_ARCH_MIPS)
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 10
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 break; 222 break;
223 } 223 }
224 case DIV: { 224 case DIV: {
225 Format(instr, "div 'rs, 'rt"); 225 Format(instr, "div 'rs, 'rt");
226 break; 226 break;
227 } 227 }
228 case DIVU: { 228 case DIVU: {
229 Format(instr, "divu 'rs, 'rt"); 229 Format(instr, "divu 'rs, 'rt");
230 break; 230 break;
231 } 231 }
232 case JALR: {
233 Format(instr, "jalr'hint 'rd, 'rs");
234 break;
235 }
236 case JR: {
237 Format(instr, "jr'hint 'rs");
238 break;
239 }
232 case MFHI: { 240 case MFHI: {
233 Format(instr, "mfhi 'rd"); 241 Format(instr, "mfhi 'rd");
234 break; 242 break;
235 } 243 }
236 case MFLO: { 244 case MFLO: {
237 Format(instr, "mflo 'rd"); 245 Format(instr, "mflo 'rd");
238 break; 246 break;
239 } 247 }
248 case MOVN: {
249 Format(instr, "movn 'rd, 'rs, 'rt");
250 break;
251 }
252 case MOVZ: {
253 Format(instr, "movz 'rd, 'rs, 'rt");
254 break;
255 }
256 case MULT: {
257 Format(instr, "mult 'rs, 'rt");
258 break;
259 }
260 case MULTU: {
261 Format(instr, "multu 'rs, 'rt");
262 break;
263 }
264 case NOR: {
265 Format(instr, "nor 'rd, 'rs, 'rt");
266 break;
267 }
268 case OR: {
269 if (instr->RsField() == 0 && instr->RtField() == 0) {
270 Format(instr, "mov 'rd 0");
Ivan Posva 2013/03/21 00:08:06 'rd, 0
zra 2013/03/21 15:49:08 Done.
271 } else if (instr->RsField() == R0) {
272 Format(instr, "mov 'rd, 'rt");
273 } else if (instr->RtField() == R0) {
274 Format(instr, "mov 'rd, 'rs");
275 } else {
276 Format(instr, "or 'rd, 'rs, 'rt");
277 }
278 break;
279 }
240 case SLL: { 280 case SLL: {
241 if ((instr->RdField() == R0) && 281 if ((instr->RdField() == R0) &&
242 (instr->RtField() == R0) && 282 (instr->RtField() == R0) &&
243 (instr->SaField() == 0)) { 283 (instr->SaField() == 0)) {
244 Format(instr, "nop"); 284 Format(instr, "nop");
245 } else { 285 } else {
246 Format(instr, "sll 'rd, 'rt, 'sa"); 286 Format(instr, "sll 'rd, 'rt, 'sa");
247 } 287 }
248 break; 288 break;
249 } 289 }
250 case JR: { 290 case SLLV: {
251 Format(instr, "jr'hint 'rs"); 291 Format(instr, "sllv 'rd, 'rt, 'rs");
292 break;
293 }
294 case SLT: {
295 Format(instr, "slt 'rd, 'rs, 'rt");
296 break;
297 }
298 case SLTU: {
299 Format(instr, "sltu 'rd, 'rs, 'rt");
300 break;
301 }
302 case SRA: {
303 Format(instr, "sra 'rd, 'rt, 'sa");
304 break;
305 }
306 case SRAV: {
307 Format(instr, "srav 'rd, 'rt, 'rs");
308 break;
309 }
310 case SRL: {
311 if (instr->RsField() == 0) {
312 Format(instr, "srl 'rd, 'rt, 'sa");
313 } else {
314 Unknown(instr);
315 }
316 break;
317 }
318 case SRLV: {
319 if (instr->SaField() == 0) {
320 Format(instr, "srlv 'rd, 'rt, 'rs");
321 } else {
322 Unknown(instr);
323 }
324 break;
325 }
326 case SUB: {
327 Format(instr, "sub 'rd, 'rs, 'rt");
328 break;
329 }
330 case SUBU: {
331 Format(instr, "subu 'rd, 'rs, 'rt");
332 break;
333 }
334 case XOR: {
335 Format(instr, "xor 'rd, 'rs, 'rt");
252 break; 336 break;
253 } 337 }
254 default: { 338 default: {
255 Unknown(instr); 339 Unknown(instr);
256 break; 340 break;
257 } 341 }
258 } 342 }
259 } 343 }
260 344
261 345
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 pc); 471 pc);
388 pc += instruction_length; 472 pc += instruction_length;
389 } 473 }
390 474
391 return success; 475 return success;
392 } 476 }
393 477
394 } // namespace dart 478 } // namespace dart
395 479
396 #endif // defined TARGET_ARCH_MIPS 480 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698