Lines Matching refs:format
124 void Format(Instruction* instr, const char* format);
317 int Decoder::FormatRegister(Instruction* instr, const char* format) {
318 ASSERT(format[0] == 'r');
319 if (format[1] == 's') { // 'rs: Rs register.
323 } else if (format[1] == 't') { // 'rt: rt register.
327 } else if (format[1] == 'd') { // 'rd: rd register.
339 int Decoder::FormatFPURegister(Instruction* instr, const char* format) {
340 ASSERT(format[0] == 'f');
341 if (format[1] == 's') { // 'fs: fs register.
345 } else if (format[1] == 't') { // 'ft: ft register.
349 } else if (format[1] == 'd') { // 'fd: fd register.
360 // the current instructions. The format string points to the first
364 int Decoder::FormatOption(Instruction* instr, const char* format) {
365 switch (format[0]) {
367 ASSERT(STRING_STARTS_WITH(format, "code"));
372 if (format[3] == '1') {
373 ASSERT(STRING_STARTS_WITH(format, "imm16"));
374 if (format[5] == 's') {
375 ASSERT(STRING_STARTS_WITH(format, "imm16s"));
377 } else if (format[5] == 'u') {
378 ASSERT(STRING_STARTS_WITH(format, "imm16u"));
381 ASSERT(STRING_STARTS_WITH(format, "imm16x"));
386 ASSERT(STRING_STARTS_WITH(format, "imm26x"));
392 return FormatRegister(instr, format);
395 return FormatFPURegister(instr, format);
398 switch (format[1]) {
400 ASSERT(STRING_STARTS_WITH(format, "sa"));
405 ASSERT(STRING_STARTS_WITH(format, "sd"));
410 if (format[2] == '1') {
411 ASSERT(STRING_STARTS_WITH(format, "ss1")); /* ext size */
415 ASSERT(STRING_STARTS_WITH(format, "ss2")); /* ins size */
423 ASSERT(STRING_STARTS_WITH(format, "bc"));
428 ASSERT(STRING_STARTS_WITH(format, "Cc"));
438 // Format takes a formatting string for a whole instruction and prints it into
441 void Decoder::Format(Instruction* instr, const char* format) {
442 char cur = *format++;
445 format += FormatOption(instr, format);
449 cur = *format++;
458 Format(instr, "unknown");
470 Format(instr, "mfc1 'rt, 'fs");
473 Format(instr, "mfhc1 'rt, 'fs");
476 Format(instr, "mtc1 'rt, 'fs");
480 Format(instr, "ctc1 'rt, 'fs");
483 Format(instr, "cfc1 'rt, 'fs");
486 Format(instr, "mthc1 'rt, 'fs");
491 Format(instr, "add.d 'fd, 'fs, 'ft");
494 Format(instr, "sub.d 'fd, 'fs, 'ft");
497 Format(instr, "mul.d 'fd, 'fs, 'ft");
500 Format(instr, "div.d 'fd, 'fs, 'ft");
503 Format(instr, "abs.d 'fd, 'fs");
506 Format(instr, "mov.d 'fd, 'fs");
509 Format(instr, "neg.d 'fd, 'fs");
512 Format(instr, "sqrt.d 'fd, 'fs");
515 Format(instr, "cvt.w.d 'fd, 'fs");
519 Format(instr, "cvt.l.d 'fd, 'fs");
526 Format(instr, "trunc.w.d 'fd, 'fs");
530 Format(instr, "trunc.l.d 'fd, 'fs");
537 Format(instr, "round.w.d 'fd, 'fs");
540 Format(instr, "floor.w.d 'fd, 'fs");
543 Format(instr, "ceil.w.d 'fd, 'fs");
546 Format(instr, "cvt.s.d 'fd, 'fs");
549 Format(instr, "c.f.d 'fs, 'ft, 'Cc");
552 Format(instr, "c.un.d 'fs, 'ft, 'Cc");
555 Format(instr, "c.eq.d 'fs, 'ft, 'Cc");
558 Format(instr, "c.ueq.d 'fs, 'ft, 'Cc");
561 Format(instr, "c.olt.d 'fs, 'ft, 'Cc");
564 Format(instr, "c.ult.d 'fs, 'ft, 'Cc");
567 Format(instr, "c.ole.d 'fs, 'ft, 'Cc");
570 Format(instr, "c.ule.d 'fs, 'ft, 'Cc");
573 Format(instr, "unknown.cop1.d");
583 Format(instr, "cvt.s.w 'fd, 'fs");
586 Format(instr, "cvt.d.w 'fd, 'fs");
596 Format(instr, "cvt.d.l 'fd, 'fs");
604 Format(instr, "cvt.s.l 'fd, 'fs");
624 Format(instr, "jr 'rs");
627 Format(instr, "jalr 'rs");
631 Format(instr, "nop");
633 Format(instr, "sll 'rd, 'rt, 'sa");
637 Format(instr, "srl 'rd, 'rt, 'sa");
640 Format(instr, "rotr 'rd, 'rt, 'sa");
647 Format(instr, "sra 'rd, 'rt, 'sa");
650 Format(instr, "sllv 'rd, 'rt, 'rs");
654 Format(instr, "srlv 'rd, 'rt, 'rs");
657 Format(instr, "rotrv 'rd, 'rt, 'rs");
664 Format(instr, "srav 'rd, 'rt, 'rs");
667 Format(instr, "mfhi 'rd");
670 Format(instr, "mflo 'rd");
673 Format(instr, "mult 'rs, 'rt");
676 Format(instr, "multu 'rs, 'rt");
679 Format(instr, "div 'rs, 'rt");
682 Format(instr, "divu 'rs, 'rt");
685 Format(instr, "add 'rd, 'rs, 'rt");
688 Format(instr, "addu 'rd, 'rs, 'rt");
691 Format(instr, "sub 'rd, 'rs, 'rt");
694 Format(instr, "subu 'rd, 'rs, 'rt");
697 Format(instr, "and 'rd, 'rs, 'rt");
701 Format(instr, "mov 'rd, 'rt");
703 Format(instr, "mov 'rd, 'rs");
705 Format(instr, "or 'rd, 'rs, 'rt");
709 Format(instr, "xor 'rd, 'rs, 'rt");
712 Format(instr, "nor 'rd, 'rs, 'rt");
715 Format(instr, "slt 'rd, 'rs, 'rt");
718 Format(instr, "sltu 'rd, 'rs, 'rt");
721 Format(instr, "break, code: 'code");
724 Format(instr, "tge 'rs, 'rt, code: 'code");
727 Format(instr, "tgeu 'rs, 'rt, code: 'code");
730 Format(instr, "tlt 'rs, 'rt, code: 'code");
733 Format(instr, "tltu 'rs, 'rt, code: 'code");
736 Format(instr, "teq 'rs, 'rt, code: 'code");
739 Format(instr, "tne 'rs, 'rt, code: 'code");
742 Format(instr, "movz 'rd, 'rs, 'rt");
745 Format(instr, "movn 'rd, 'rs, 'rt");
749 Format(instr, "movt 'rd, 'rs, 'bc");
751 Format(instr, "movf 'rd, 'rs, 'bc");
761 Format(instr, "mul 'rd, 'rs, 'rt");
764 Format(instr, "clz 'rd, 'rs");
774 Format(instr, "ins 'rt, 'rs, 'sa, 'ss2");
782 Format(instr, "ext 'rt, 'rs, 'sa, 'ss1");
805 Format(instr, "bc1t 'bc, 'imm16u");
807 Format(instr, "bc1f 'bc, 'imm16u");
817 Format(instr, "bltz 'rs, 'imm16u");
820 Format(instr, "bltzal 'rs, 'imm16u");
823 Format(instr, "bgez 'rs, 'imm16u");
826 Format(instr, "bgezal 'rs, 'imm16u");
834 Format(instr, "beq 'rs, 'rt, 'imm16u");
837 Format(instr, "bne 'rs, 'rt, 'imm16u");
840 Format(instr, "blez 'rs, 'imm16u");
843 Format(instr, "bgtz 'rs, 'imm16u");
847 Format(instr, "addi 'rt, 'rs, 'imm16s");
850 Format(instr, "addiu 'rt, 'rs, 'imm16s");
853 Format(instr, "slti 'rt, 'rs, 'imm16s");
856 Format(instr, "sltiu 'rt, 'rs, 'imm16u");
859 Format(instr, "andi 'rt, 'rs, 'imm16x");
862 Format(instr, "ori 'rt, 'rs, 'imm16x");
865 Format(instr, "xori 'rt, 'rs, 'imm16x");
868 Format(instr, "lui 'rt, 'imm16x");
872 Format(instr, "lb 'rt, 'imm16s('rs)");
875 Format(instr, "lh 'rt, 'imm16s('rs)");
878 Format(instr, "lwl 'rt, 'imm16s('rs)");
881 Format(instr, "lw 'rt, 'imm16s('rs)");
884 Format(instr, "lbu 'rt, 'imm16s('rs)");
887 Format(instr, "lhu 'rt, 'imm16s('rs)");
890 Format(instr, "lwr 'rt, 'imm16s('rs)");
893 Format(instr, "sb 'rt, 'imm16s('rs)");
896 Format(instr, "sh 'rt, 'imm16s('rs)");
899 Format(instr, "swl 'rt, 'imm16s('rs)");
902 Format(instr, "sw 'rt, 'imm16s('rs)");
905 Format(instr, "swr 'rt, 'imm16s('rs)");
908 Format(instr, "lwc1 'ft, 'imm16s('rs)");
911 Format(instr, "ldc1 'ft, 'imm16s('rs)");
914 Format(instr, "swc1 'ft, 'imm16s('rs)");
917 Format(instr, "sdc1 'ft, 'imm16s('rs)");
929 Format(instr, "j 'imm26x");
932 Format(instr, "jal 'imm26x");
961 Format(instr, "UNSUPPORTED");