Home | History | Annotate | Download | only in mips

Lines Matching defs:Format

98   void Format(Instruction* instr, const char* format);
291 int Decoder::FormatRegister(Instruction* instr, const char* format) {
292 ASSERT(format[0] == 'r');
293 if (format[1] == 's') { // 'rs: Rs register.
297 } else if (format[1] == 't') { // 'rt: rt register.
301 } else if (format[1] == 'd') { // 'rd: rd register.
313 int Decoder::FormatFPURegister(Instruction* instr, const char* format) {
314 ASSERT(format[0] == 'f');
315 if (format[1] == 's') { // 'fs: fs register.
319 } else if (format[1] == 't') { // 'ft: ft register.
323 } else if (format[1] == 'd') { // 'fd: fd register.
327 } else if (format[1] == 'r') { // 'fr: fr register.
338 // the current instructions. The format string points to the first
342 int Decoder::FormatOption(Instruction* instr, const char* format) {
343 switch (format[0]) {
345 ASSERT(STRING_STARTS_WITH(format, "code"));
350 if (format[3] == '1') {
351 ASSERT(STRING_STARTS_WITH(format, "imm16"));
352 if (format[5] == 's') {
353 ASSERT(STRING_STARTS_WITH(format, "imm16s"));
355 } else if (format[5] == 'u') {
356 ASSERT(STRING_STARTS_WITH(format, "imm16u"));
359 ASSERT(STRING_STARTS_WITH(format, "imm16x"));
364 ASSERT(STRING_STARTS_WITH(format, "imm26x"));
370 return FormatRegister(instr, format);
373 return FormatFPURegister(instr, format);
376 switch (format[1]) {
378 ASSERT(STRING_STARTS_WITH(format, "sa"));
383 ASSERT(STRING_STARTS_WITH(format, "sd"));
388 if (format[2] == '1') {
389 ASSERT(STRING_STARTS_WITH(format, "ss1")); /* ext size */
393 ASSERT(STRING_STARTS_WITH(format, "ss2")); /* ins size */
401 ASSERT(STRING_STARTS_WITH(format, "bc"));
406 ASSERT(STRING_STARTS_WITH(format, "Cc"));
416 // Format takes a formatting string for a whole instruction and prints it into
419 void Decoder::Format(Instruction* instr, const char* format) {
420 char cur = *format++;
423 format += FormatOption(instr, format);
427 cur = *format++;
436 Format(instr, "unknown");
448 Format(instr, "mfc1 'rt, 'fs");
451 Format(instr, "mfhc1 'rt, 'fs");
454 Format(instr, "mtc1 'rt, 'fs");
458 Format(instr, "ctc1 'rt, 'fs");
461 Format(instr, "cfc1 'rt, 'fs");
464 Format(instr, "mthc1 'rt, 'fs");
469 Format(instr, "add.d 'fd, 'fs, 'ft");
472 Format(instr, "sub.d 'fd, 'fs, 'ft");
475 Format(instr, "mul.d 'fd, 'fs, 'ft");
478 Format(instr, "div.d 'fd, 'fs, 'ft");
481 Format(instr, "abs.d 'fd, 'fs");
484 Format(instr, "mov.d 'fd, 'fs");
487 Format(instr, "neg.d 'fd, 'fs");
490 Format(instr, "sqrt.d 'fd, 'fs");
493 Format(instr, "cvt.w.d 'fd, 'fs");
497 Format(instr, "cvt.l.d 'fd, 'fs");
504 Format(instr, "trunc.w.d 'fd, 'fs");
508 Format(instr, "trunc.l.d 'fd, 'fs");
515 Format(instr, "round.w.d 'fd, 'fs");
518 Format(instr, "floor.w.d 'fd, 'fs");
521 Format(instr, "ceil.w.d 'fd, 'fs");
524 Format(instr, "cvt.s.d 'fd, 'fs");
527 Format(instr, "c.f.d 'fs, 'ft, 'Cc");
530 Format(instr, "c.un.d 'fs, 'ft, 'Cc");
533 Format(instr, "c.eq.d 'fs, 'ft, 'Cc");
536 Format(instr, "c.ueq.d 'fs, 'ft, 'Cc");
539 Format(instr, "c.olt.d 'fs, 'ft, 'Cc");
542 Format(instr, "c.ult.d 'fs, 'ft, 'Cc");
545 Format(instr, "c.ole.d 'fs, 'ft, 'Cc");
548 Format(instr, "c.ule.d 'fs, 'ft, 'Cc");
551 Format(instr, "unknown.cop1.d");
561 Format(instr, "cvt.s.w 'fd, 'fs");
564 Format(instr, "cvt.d.w 'fd, 'fs");
574 Format(instr, "cvt.d.l 'fd, 'fs");
582 Format(instr, "cvt.s.l 'fd, 'fs");
602 Format(instr, "madd.d 'fd, 'fr, 'fs, 'ft");
611 Format(instr, "jr 'rs");
614 Format(instr, "jalr 'rs");
618 Format(instr, "nop");
620 Format(instr, "sll 'rd, 'rt, 'sa");
624 Format(instr, "srl 'rd, 'rt, 'sa");
627 Format(instr, "rotr 'rd, 'rt, 'sa");
634 Format(instr, "sra 'rd, 'rt, 'sa");
637 Format(instr, "sllv 'rd, 'rt, 'rs");
641 Format(instr, "srlv 'rd, 'rt, 'rs");
644 Format(instr, "rotrv 'rd, 'rt, 'rs");
651 Format(instr, "srav 'rd, 'rt, 'rs");
654 Format(instr, "mfhi 'rd");
657 Format(instr, "mflo 'rd");
660 Format(instr, "mult 'rs, 'rt");
663 Format(instr, "multu 'rs, 'rt");
666 Format(instr, "div 'rs, 'rt");
669 Format(instr, "divu 'rs, 'rt");
672 Format(instr, "add 'rd, 'rs, 'rt");
675 Format(instr, "addu 'rd, 'rs, 'rt");
678 Format(instr, "sub 'rd, 'rs, 'rt");
681 Format(instr, "subu 'rd, 'rs, 'rt");
684 Format(instr, "and 'rd, 'rs, 'rt");
688 Format(instr, "mov 'rd, 'rt");
690 Format(instr, "mov 'rd, 'rs");
692 Format(instr, "or 'rd, 'rs, 'rt");
696 Format(instr, "xor 'rd, 'rs, 'rt");
699 Format(instr, "nor 'rd, 'rs, 'rt");
702 Format(instr, "slt 'rd, 'rs, 'rt");
705 Format(instr, "sltu 'rd, 'rs, 'rt");
708 Format(instr, "break, code: 'code");
711 Format(instr, "tge 'rs, 'rt, code: 'code");
714 Format(instr, "tgeu 'rs, 'rt, code: 'code");
717 Format(instr, "tlt 'rs, 'rt, code: 'code");
720 Format(instr, "tltu 'rs, 'rt, code: 'code");
723 Format(instr, "teq 'rs, 'rt, code: 'code");
726 Format(instr, "tne 'rs, 'rt, code: 'code");
729 Format(instr, "movz 'rd, 'rs, 'rt");
732 Format(instr, "movn 'rd, 'rs, 'rt");
736 Format(instr, "movt 'rd, 'rs, 'bc");
738 Format(instr, "movf 'rd, 'rs, 'bc");
748 Format(instr, "mul 'rd, 'rs, 'rt");
751 Format(instr, "clz 'rd, 'rs");
761 Format(instr, "ins 'rt, 'rs, 'sa, 'ss2");
769 Format(instr, "ext 'rt, 'rs, 'sa, 'ss1");
792 Format(instr, "bc1t 'bc, 'imm16u");
794 Format(instr, "bc1f 'bc, 'imm16u");
804 Format(instr, "bltz 'rs, 'imm16u");
807 Format(instr, "bltzal 'rs, 'imm16u");
810 Format(instr, "bgez 'rs, 'imm16u");
813 Format(instr, "bgezal 'rs, 'imm16u");
821 Format(instr, "beq 'rs, 'rt, 'imm16u");
824 Format(instr, "bne 'rs, 'rt, 'imm16u");
827 Format(instr, "blez 'rs, 'imm16u");
830 Format(instr, "bgtz 'rs, 'imm16u");
834 Format(instr, "addi 'rt, 'rs, 'imm16s");
837 Format(instr, "addiu 'rt, 'rs, 'imm16s");
840 Format(instr, "slti 'rt, 'rs, 'imm16s");
843 Format(instr, "sltiu 'rt, 'rs, 'imm16u");
846 Format(instr, "andi 'rt, 'rs, 'imm16x");
849 Format(instr, "ori 'rt, 'rs, 'imm16x");
852 Format(instr, "xori 'rt, 'rs, 'imm16x");
855 Format(instr, "lui 'rt, 'imm16x");
859 Format(instr, "lb 'rt, 'imm16s('rs)");
862 Format(instr, "lh 'rt, 'imm16s('rs)");
865 Format(instr, "lwl 'rt, 'imm16s('rs)");
868 Format(instr, "lw 'rt, 'imm16s('rs)");
871 Format(instr, "lbu 'rt, 'imm16s('rs)");
874 Format(instr, "lhu 'rt, 'imm16s('rs)");
877 Format(instr, "lwr 'rt, 'imm16s('rs)");
880 Format(instr, "pref 'rt, 'imm16s('rs)");
883 Format(instr, "sb 'rt, 'imm16s('rs)");
886 Format(instr, "sh 'rt, 'imm16s('rs)");
889 Format(instr, "swl 'rt, 'imm16s('rs)");
892 Format(instr, "sw 'rt, 'imm16s('rs)");
895 Format(instr, "swr 'rt, 'imm16s('rs)");
898 Format(instr, "lwc1 'ft, 'imm16s('rs)");
901 Format(instr, "ldc1 'ft, 'imm16s('rs)");
904 Format(instr, "swc1 'ft, 'imm16s('rs)");
907 Format(instr, "sdc1 'ft, 'imm16s('rs)");
919 Format(instr, "j 'imm26x");
922 Format(instr, "jal 'imm26x");
951 Format(instr, "UNSUPPORTED");