Lines Matching refs:format
122 void Format(Instruction* instr, const char* format);
283 int Decoder::FormatRegister(Instruction* instr, const char* format) {
284 ASSERT(format[0] == 'r');
285 if (format[1] == 's') { // 'rs: Rs register
289 } else if (format[1] == 't') { // 'rt: rt register
293 } else if (format[1] == 'd') { // 'rd: rd register
305 int Decoder::FormatCRegister(Instruction* instr, const char* format) {
306 ASSERT(format[0] == 'f');
307 if (format[1] == 's') { // 'fs: fs register
311 } else if (format[1] == 't') { // 'ft: ft register
315 } else if (format[1] == 'd') { // 'fd: fd register
326 // the current instructions. The format string points to the first
330 int Decoder::FormatOption(Instruction* instr, const char* format) {
331 switch (format[0]) {
333 ASSERT(STRING_STARTS_WITH(format, "code"));
338 if (format[3] == '1') {
339 ASSERT(STRING_STARTS_WITH(format, "imm16"));
340 if (format[5] == 's') {
341 ASSERT(STRING_STARTS_WITH(format, "imm16s"));
343 } else if (format[5] == 'u') {
344 ASSERT(STRING_STARTS_WITH(format, "imm16u"));
347 ASSERT(STRING_STARTS_WITH(format, "imm16x"));
352 ASSERT(STRING_STARTS_WITH(format, "imm26"));
358 return FormatRegister(instr, format);
361 return FormatCRegister(instr, format);
364 ASSERT(STRING_STARTS_WITH(format, "sa"));
374 // Format takes a formatting string for a whole instruction and prints it into
377 void Decoder::Format(Instruction* instr, const char* format) {
378 char cur = *format++;
381 format += FormatOption(instr, format);
385 cur = *format++;
394 Format(instr, "unknown");
406 Format(instr, "mfc1 'rt, 'fs");
409 Format(instr, "mfhc1 rt, 'fs");
412 Format(instr, "mtc1 'rt, 'fs");
415 Format(instr, "mthc1 rt, 'fs");
427 Format(instr, "cvt.d.w 'fd, 'fs");
445 Format(instr, "jr 'rs");
448 Format(instr, "jalr 'rs");
452 Format(instr, "nop");
454 Format(instr, "sll 'rd, 'rt, 'sa");
457 Format(instr, "srl 'rd, 'rt, 'sa");
460 Format(instr, "sra 'rd, 'rt, 'sa");
463 Format(instr, "sllv 'rd, 'rt, 'rs");
466 Format(instr, "srlv 'rd, 'rt, 'rs");
469 Format(instr, "srav 'rd, 'rt, 'rs");
472 Format(instr, "mfhi 'rd");
475 Format(instr, "mflo 'rd");
478 Format(instr, "mult 'rs, 'rt");
481 Format(instr, "multu 'rs, 'rt");
484 Format(instr, "div 'rs, 'rt");
487 Format(instr, "divu 'rs, 'rt");
490 Format(instr, "add 'rd, 'rs, 'rt");
493 Format(instr, "addu 'rd, 'rs, 'rt");
496 Format(instr, "sub 'rd, 'rs, 'rt");
499 Format(instr, "sub 'rd, 'rs, 'rt");
502 Format(instr, "and 'rd, 'rs, 'rt");
506 Format(instr, "mov 'rd, 'rt");
508 Format(instr, "mov 'rd, 'rs");
510 Format(instr, "or 'rd, 'rs, 'rt");
514 Format(instr, "xor 'rd, 'rs, 'rt");
517 Format(instr, "nor 'rd, 'rs, 'rt");
520 Format(instr, "slt 'rd, 'rs, 'rt");
523 Format(instr, "sltu 'rd, 'rs, 'rt");
526 Format(instr, "break, code: 'code");
529 Format(instr, "tge 'rs, 'rt, code: 'code");
532 Format(instr, "tgeu 'rs, 'rt, code: 'code");
535 Format(instr, "tlt 'rs, 'rt, code: 'code");
538 Format(instr, "tltu 'rs, 'rt, code: 'code");
541 Format(instr, "teq 'rs, 'rt, code: 'code");
544 Format(instr, "tne 'rs, 'rt, code: 'code");
570 Format(instr, "bltz 'rs, 'imm16u");
573 Format(instr, "bltzal 'rs, 'imm16u");
576 Format(instr, "bgez 'rs, 'imm16u");
579 Format(instr, "bgezal 'rs, 'imm16u");
587 Format(instr, "beq 'rs, 'rt, 'imm16u");
590 Format(instr, "bne 'rs, 'rt, 'imm16u");
593 Format(instr, "blez 'rs, 'imm16u");
596 Format(instr, "bgtz 'rs, 'imm16u");
600 Format(instr, "addi 'rt, 'rs, 'imm16s");
603 Format(instr, "addiu 'rt, 'rs, 'imm16s");
606 Format(instr, "slti 'rt, 'rs, 'imm16s");
609 Format(instr, "sltiu 'rt, 'rs, 'imm16u");
612 Format(instr, "andi 'rt, 'rs, 'imm16x");
615 Format(instr, "ori 'rt, 'rs, 'imm16x");
618 Format(instr, "xori 'rt, 'rs, 'imm16x");
621 Format(instr, "lui 'rt, 'imm16x");
625 Format(instr, "lb 'rt, 'imm16s('rs)");
628 Format(instr, "lw 'rt, 'imm16s('rs)");
631 Format(instr, "lbu 'rt, 'imm16s('rs)");
634 Format(instr, "sb 'rt, 'imm16s('rs)");
637 Format(instr, "sw 'rt, 'imm16s('rs)");
640 Format(instr, "lwc1 'ft, 'imm16s('rs)");
643 Format(instr, "ldc1 'ft, 'imm16s('rs)");
646 Format(instr, "swc1 'rt, 'imm16s('fs)");
649 Format(instr, "sdc1 'rt, 'imm16s('fs)");
661 Format(instr, "j 'imm26");
664 Format(instr, "jal 'imm26");