Lines Matching refs:format
122 void Format(Instruction* instr, const char* format);
299 int Decoder::FormatRegister(Instruction* instr, const char* format) {
300 ASSERT(format[0] == 'r');
301 if (format[1] == 's') { // 'rs: Rs register
305 } else if (format[1] == 't') { // 'rt: rt register
309 } else if (format[1] == 'd') { // 'rd: rd register
321 int Decoder::FormatFPURegister(Instruction* instr, const char* format) {
322 ASSERT(format[0] == 'f');
323 if (format[1] == 's') { // 'fs: fs register
327 } else if (format[1] == 't') { // 'ft: ft register
331 } else if (format[1] == 'd') { // 'fd: fd register
342 // the current instructions. The format string points to the first
346 int Decoder::FormatOption(Instruction* instr, const char* format) {
347 switch (format[0]) {
349 ASSERT(STRING_STARTS_WITH(format, "code"));
354 if (format[3] == '1') {
355 ASSERT(STRING_STARTS_WITH(format, "imm16"));
356 if (format[5] == 's') {
357 ASSERT(STRING_STARTS_WITH(format, "imm16s"));
359 } else if (format[5] == 'u') {
360 ASSERT(STRING_STARTS_WITH(format, "imm16u"));
363 ASSERT(STRING_STARTS_WITH(format, "imm16x"));
368 ASSERT(STRING_STARTS_WITH(format, "imm26"));
374 return FormatRegister(instr, format);
377 return FormatFPURegister(instr, format);
380 switch (format[1]) {
382 ASSERT(STRING_STARTS_WITH(format, "sa"));
387 ASSERT(STRING_STARTS_WITH(format, "sd"));
394 ASSERT(STRING_STARTS_WITH(format, "bc"));
399 ASSERT(STRING_STARTS_WITH(format, "Cc"));
409 // Format takes a formatting string for a whole instruction and prints it into
412 void Decoder::Format(Instruction* instr, const char* format) {
413 char cur = *format++;
416 format += FormatOption(instr, format);
420 cur = *format++;
429 Format(instr, "unknown");
441 Format(instr, "mfc1 'rt, 'fs");
444 Format(instr, "mfhc1 'rt, 'fs");
447 Format(instr, "mtc1 'rt, 'fs");
451 Format(instr, "ctc1 'rt, 'fs");
454 Format(instr, "cfc1 'rt, 'fs");
457 Format(instr, "mthc1 'rt, 'fs");
462 Format(instr, "add.d 'fd, 'fs, 'ft");
465 Format(instr, "sub.d 'fd, 'fs, 'ft");
468 Format(instr, "mul.d 'fd, 'fs, 'ft");
471 Format(instr, "div.d 'fd, 'fs, 'ft");
474 Format(instr, "abs.d 'fd, 'fs");
477 Format(instr, "mov.d 'fd, 'fs");
480 Format(instr, "neg.d 'fd, 'fs");
483 Format(instr, "sqrt.d 'fd, 'fs");
486 Format(instr, "cvt.w.d 'fd, 'fs");
490 Format(instr, "cvt.l.d 'fd, 'fs");
497 Format(instr, "trunc.w.d 'fd, 'fs");
501 Format(instr, "trunc.l.d 'fd, 'fs");
508 Format(instr, "round.w.d 'fd, 'fs");
511 Format(instr, "floor.w.d 'fd, 'fs");
514 Format(instr, "ceil.w.d 'fd, 'fs");
517 Format(instr, "cvt.s.d 'fd, 'fs");
520 Format(instr, "c.f.d 'fs, 'ft, 'Cc");
523 Format(instr, "c.un.d 'fs, 'ft, 'Cc");
526 Format(instr, "c.eq.d 'fs, 'ft, 'Cc");
529 Format
532 Format(instr, "c.olt.d 'fs, 'ft, 'Cc");
535 Format(instr, "c.ult.d 'fs, 'ft, 'Cc");
538 Format(instr, "c.ole.d 'fs, 'ft, 'Cc");
541 Format(instr, "c.ule.d 'fs, 'ft, 'Cc");
544 Format(instr, "unknown.cop1.d");
554 Format(instr, "cvt.s.w 'fd, 'fs");
557 Format(instr, "cvt.d.w 'fd, 'fs");
567 Format(instr, "cvt.d.l 'fd, 'fs");
575 Format(instr, "cvt.s.l 'fd, 'fs");
595 Format(instr, "jr 'rs");
598 Format(instr, "jalr 'rs");
602 Format(instr, "nop");
604 Format(instr, "sll 'rd, 'rt, 'sa");
608 Format(instr, "srl 'rd, 'rt, 'sa");
611 Format(instr, "rotr 'rd, 'rt, 'sa");
618 Format(instr, "sra 'rd, 'rt, 'sa");
621 Format(instr, "sllv 'rd, 'rt, 'rs");
625 Format(instr, "srlv 'rd, 'rt, 'rs");
628 Format(instr, "rotrv 'rd, 'rt, 'rs");
635 Format(instr, "srav 'rd, 'rt, 'rs");
638 Format(instr, "mfhi 'rd");
641 Format(instr, "mflo 'rd");
644 Format(instr, "mult 'rs, 'rt");
647 Format(instr, "multu 'rs, 'rt");
650 Format(instr, "div 'rs, 'rt");
653 Format(instr, "divu 'rs, 'rt");
656 Format(instr, "add 'rd, 'rs, 'rt");
659 Format(instr, "addu 'rd, 'rs, 'rt");
662 Format(instr, "sub 'rd, 'rs, 'rt");
665 Format(instr, "sub 'rd, 'rs, 'rt");
668 Format(instr, "and 'rd, 'rs, 'rt");
672 Format(instr, "mov 'rd, 'rt");
674 Format(instr, "mov 'rd, 'rs");
676 Format(instr, "or 'rd, 'rs, 'rt");
680 Format(instr, "xor 'rd, 'rs, 'rt");
683 Format(instr, "nor 'rd, 'rs, 'rt");
686 Format(instr, "slt 'rd, 'rs, 'rt");
689 Format(instr, "sltu 'rd, 'rs, 'rt");
692 Format(instr, "break, code: 'code");
695 Format(instr, "tge 'rs, 'rt, code: 'code");
698 Format(instr, "tgeu 'rs, 'rt, code: 'code");
701 Format(instr, "tlt 'rs, 'rt, code: 'code");
704 Format(instr, "tltu 'rs, 'rt, code: 'code");
707 Format(instr, "teq 'rs, 'rt, code: 'code");
710 Format(instr, "tne 'rs, 'rt, code: 'code");
713 Format(instr, "movz 'rd, 'rs, 'rt");
716 Format(instr, "movn 'rd, 'rs, 'rt");
720 Format(instr, "movt 'rd, 'rs, 'Cc");
722 Format(instr, "movf 'rd, 'rs, 'Cc");
732 Format(instr, "mul 'rd, 'rs, 'rt");
735 Format(instr, "clz 'rd, 'rs");
745 Format(instr, "ins 'rt, 'rs, 'sd, 'sa");
753 Format(instr, "ext 'rt, 'rs, 'sd, 'sa");
776 Format(instr, "bc1t 'bc, 'imm16u");
778 Format(instr, "bc1f 'bc, 'imm16u");
788 Format(instr, "bltz 'rs, 'imm16u");
791 Format(instr, "bltzal 'rs, 'imm16u");
794 Format(instr, "bgez 'rs, 'imm16u");
797 Format(instr, "bgezal 'rs, 'imm16u");
805 Format(instr, "beq 'rs, 'rt, 'imm16u");
808 Format(instr, "bne 'rs, 'rt, 'imm16u");
811 Format(instr, "blez 'rs, 'imm16u");
814 Format(instr, "bgtz 'rs, 'imm16u");
818 Format(instr, "addi 'rt, 'rs, 'imm16s");
821 Format(instr, "addiu 'rt, 'rs, 'imm16s");
824 Format(instr, "slti 'rt, 'rs, 'imm16s");
827 Format(instr, "sltiu 'rt, 'rs, 'imm16u");
830 Format(instr, "andi 'rt, 'rs, 'imm16x");
833 Format(instr, "ori 'rt, 'rs, 'imm16x");
836 Format(instr, "xori 'rt, 'rs, 'imm16x");
839 Format(instr, "lui 'rt, 'imm16x");
843 Format(instr, "lb 'rt, 'imm16s('rs)");
846 Format(instr, "lh 'rt, 'imm16s('rs)");
849 Format(instr, "lwl 'rt, 'imm16s('rs)");
852 Format(instr, "lw 'rt, 'imm16s('rs)");
855 Format(instr, "lbu 'rt, 'imm16s('rs)");
858 Format(instr, "lhu 'rt, 'imm16s('rs)");
861 Format(instr, "lwr 'rt, 'imm16s('rs)");
864 Format(instr, "sb 'rt, 'imm16s('rs)");
867 Format(instr, "sh 'rt, 'imm16s('rs)");
870 Format(instr, "swl 'rt, 'imm16s('rs)");
873 Format(instr, "sw 'rt, 'imm16s('rs)");
876 Format(instr, "swr 'rt, 'imm16s('rs)");
879 Format(instr, "lwc1 'ft, 'imm16s('rs)");
882 Format(instr, "ldc1 'ft, 'imm16s('rs)");
885 Format(instr, "swc1 'ft, 'imm16s('rs)");
888 Format(instr, "sdc1 'ft, 'imm16s('rs)");
900 Format(instr, "j 'imm26");
903 Format(instr, "jal 'imm26");