Home | History | Annotate | Download | only in mips

Lines Matching refs:Format

102   void PrintFormat(Instruction* instr);  // For floating format postfix.
110 void Format(Instruction* instr, const char* format);
475 int Decoder::FormatRegister(Instruction* instr, const char* format) {
476 DCHECK(format[0] == 'r');
477 if (format[1] == 's') { // 'rs: Rs register.
481 } else if (format[1] == 't') { // 'rt: rt register.
485 } else if (format[1] == 'd') { // 'rd: rd register.
497 int Decoder::FormatFPURegister(Instruction* instr, const char* format) {
498 DCHECK(format[0] == 'f');
500 if (format[1] == 's') { // 'fs: fs register.
504 } else if (format[1] == 't') { // 'ft: ft register.
508 } else if (format[1] == 'd') { // 'fd: fd register.
512 } else if (format[1] == 'r') { // 'fr: fr register.
518 if (format[1] == 's') { // 'fs: fs register.
522 } else if (format[1] == 't') { // 'ft: ft register.
526 } else if (format[1] == 'd') { // 'fd: fd register.
530 format[1] == 'r') { // 'fr: fr register.
542 // the current instructions. The format string points to the first
546 int Decoder::FormatOption(Instruction* instr, const char* format) {
547 switch (format[0]) {
549 DCHECK(STRING_STARTS_WITH(format, "code"));
554 if (format[3] == '1') {
555 if (format[4] == '6') {
556 DCHECK(STRING_STARTS_WITH(format, "imm16"));
557 switch (format[5]) {
559 DCHECK(STRING_STARTS_WITH(format, "imm16s"));
563 DCHECK(STRING_STARTS_WITH(format, "imm16u"));
567 DCHECK(STRING_STARTS_WITH(format, "imm16x"));
571 DCHECK(STRING_STARTS_WITH(format, "imm16p"));
574 switch (format[6]) {
576 DCHECK(STRING_STARTS_WITH(format, "imm16p4"));
578 switch (format[8]) {
580 DCHECK(STRING_STARTS_WITH(format, "imm16p4s2"));
590 } else if (format[4] == '8') {
591 DCHECK(STRING_STARTS_WITH(format, "imm18"));
592 switch (format[5]) {
594 DCHECK(STRING_STARTS_WITH(format, "imm18s"));
598 DCHECK(STRING_STARTS_WITH(format, "imm18x"));
603 } else if (format[4] == '9') {
604 DCHECK(STRING_STARTS_WITH(format, "imm19"));
605 switch (format[5]) {
607 DCHECK(STRING_STARTS_WITH(format, "imm19s"));
611 DCHECK(STRING_STARTS_WITH(format, "imm19x"));
617 } else if (format[3] == '2' && format[4] == '1') {
618 DCHECK(STRING_STARTS_WITH(format, "imm21"));
619 switch (format[5]) {
621 DCHECK(STRING_STARTS_WITH(format, "imm21s"));
625 DCHECK(STRING_STARTS_WITH(format, "imm21x"));
629 DCHECK(STRING_STARTS_WITH(format, "imm21p"));
632 switch (format[6]) {
634 DCHECK(STRING_STARTS_WITH(format, "imm21p4"));
636 switch (format[8]) {
638 DCHECK(STRING_STARTS_WITH(format, "imm21p4s2"));
648 } else if (format[3] == '2' && format[4] == '6') {
649 DCHECK(STRING_STARTS_WITH(format, "imm26"));
650 switch (format[5]) {
652 DCHECK(STRING_STARTS_WITH(format, "imm26s"));
656 DCHECK(STRING_STARTS_WITH(format, "imm26x"));
660 DCHECK(STRING_STARTS_WITH(format, "imm26p"));
663 switch (format[6]) {
665 DCHECK(STRING_STARTS_WITH(format, "imm26p4"));
667 switch (format[8]) {
669 DCHECK(STRING_STARTS_WITH(format, "imm26p4s2"));
678 DCHECK(STRING_STARTS_WITH(format, "imm26j"));
687 return FormatRegister(instr, format);
690 return FormatFPURegister(instr, format);
693 switch (format[1]) {
695 if (format[2] == '2') {
696 DCHECK(STRING_STARTS_WITH(format, "sa2")); // 'sa2
700 DCHECK(STRING_STARTS_WITH(format, "sa"));
706 DCHECK(STRING_STARTS_WITH(format, "sd"));
711 if (format[2] == '1') {
712 DCHECK(STRING_STARTS_WITH(format, "ss1")); /* ext size */
716 DCHECK(STRING_STARTS_WITH(format, "ss2")); /* ins size */
724 switch (format[1]) {
726 DCHECK(STRING_STARTS_WITH(format, "bc"));
731 switch (format[2]) {
733 DCHECK(STRING_STARTS_WITH(format, "bp2"));
742 DCHECK(STRING_STARTS_WITH(format, "Cc"));
755 // Format takes a formatting string for a whole instruction and prints it into
758 void Decoder::Format(Instruction* instr, const char* format) {
759 char cur = *format++;
762 format += FormatOption(instr, format);
766 cur = *format++;
775 Format(instr, "unknown");
782 Format(instr, "rint.'t 'fd, 'fs");
785 Format(instr, "min.'t 'fd, 'fs, 'ft");
788 Format(instr, "max.'t 'fd, 'fs, 'ft");
791 Format(instr, "mina.'t 'fd, 'fs, 'ft");
794 Format(instr, "maxa.'t 'fd, 'fs, 'ft");
797 Format(instr, "sel.'t 'fd, 'fs, 'ft");
800 Format(instr, "seleqz.'t 'fd, 'fs, 'ft");
803 Format(instr, "selnez.'t 'fd, 'fs, 'ft");
806 Format(instr, "movz.'t 'fd, 'fs, 'rt");
809 Format(instr, "movn.'t 'fd, 'fs, 'rt");
813 Format(instr, "movt.'t 'fd, 'fs, 'Cc");
815 Format(instr, "movf.'t 'fd, 'fs, 'Cc");
819 Format(instr, "add.'t 'fd, 'fs, 'ft");
822 Format(instr, "sub.'t 'fd, 'fs, 'ft");
825 Format(instr, "mul.'t 'fd, 'fs, 'ft");
828 Format(instr, "div.'t 'fd, 'fs, 'ft");
831 Format(instr, "abs.'t 'fd, 'fs");
834 Format(instr, "mov.'t 'fd, 'fs");
837 Format(instr, "neg.'t 'fd, 'fs");
840 Format(instr, "sqrt.'t 'fd, 'fs");
843 Format(instr, "recip.'t 'fd, 'fs");
846 Format(instr, "rsqrt.'t 'fd, 'fs");
849 Format(instr, "cvt.w.'t 'fd, 'fs");
852 Format(instr, "cvt.l.'t 'fd, 'fs");
855 Format(instr, "trunc.w.'t 'fd, 'fs");
858 Format(instr, "trunc.l.'t 'fd, 'fs");
861 Format(instr, "round.w.'t 'fd, 'fs");
864 Format(instr, "round.l.'t 'fd, 'fs");
867 Format(instr, "floor.w.'t 'fd, 'fs");
870 Format(instr, "floor.l.'t 'fd, 'fs");
873 Format(instr, "ceil.w.'t 'fd, 'fs");
876 Format(instr, "class.'t 'fd, 'fs");
879 Format(instr, "ceil.l.'t 'fd, 'fs");
882 Format(instr, "cvt.s.'t 'fd, 'fs");
885 Format(instr, "c.f.'t 'fs, 'ft, 'Cc");
888 Format(instr, "c.un.'t 'fs, 'ft, 'Cc");
891 Format(instr, "c.eq.'t 'fs, 'ft, 'Cc");
894 Format(instr, "c.ueq.'t 'fs, 'ft, 'Cc");
897 Format(instr, "c.olt.'t 'fs, 'ft, 'Cc");
900 Format(instr, "c.ult.'t 'fs, 'ft, 'Cc");
903 Format(instr, "c.ole.'t 'fs, 'ft, 'Cc");
906 Format(instr, "c.ule.'t 'fs, 'ft, 'Cc");
919 Format(instr, "cvt.d.'t 'fd, 'fs");
922 Format(instr, "maddf.s 'fd, 'fs, 'ft");
925 Format(instr, "msubf.s 'fd, 'fs, 'ft");
928 Format(instr, "unknown.cop1.'t");
939 Format(instr, "maddf.d 'fd, 'fs, 'ft");
942 Format(instr, "msubf.d 'fd, 'fs, 'ft");
945 Format(instr, "unknown.cop1.'t");
955 Format(instr, "cvt.d.l 'fd, 'fs");
958 Format(instr, "cvt.s.l 'fd, 'fs");
961 Format(instr, "cmp.af.d 'fd, 'fs, 'ft");
964 Format(instr, "cmp.un.d 'fd, 'fs, 'ft");
967 Format(instr, "cmp.eq.d 'fd, 'fs, 'ft");
970 Format(instr, "cmp.ueq.d 'fd, 'fs, 'ft");
973 Format(instr, "cmp.lt.d 'fd, 'fs, 'ft");
976 Format(instr, "cmp.ult.d 'fd, 'fs, 'ft");
979 Format(instr, "cmp.le.d 'fd, 'fs, 'ft");
982 Format(instr, "cmp.ule.d 'fd, 'fs, 'ft");
985 Format(instr, "cmp.or.d 'fd, 'fs, 'ft");
988 Format(instr, "cmp.une.d 'fd, 'fs, 'ft");
991 Format(instr, "cmp.ne.d 'fd, 'fs, 'ft");
1002 Format(instr, "cvt.s.w 'fd, 'fs");
1005 Format(instr, "cvt.d.w 'fd, 'fs");
1008 Format(instr, "cmp.af.s 'fd, 'fs, 'ft");
1011 Format(instr, "cmp.un.s 'fd, 'fs, 'ft");
1014 Format(instr, "cmp.eq.s 'fd, 'fs, 'ft");
1017 Format(instr, "cmp.ueq.s 'fd, 'fs, 'ft");
1020 Format(instr, "cmp.lt.s 'fd, 'fs, 'ft");
1023 Format(instr, "cmp.ult.s 'fd, 'fs, 'ft");
1026 Format(instr, "cmp.le.s 'fd, 'fs, 'ft");
1029 Format(instr, "cmp.ule.s 'fd, 'fs, 'ft");
1032 Format(instr, "cmp.or.s 'fd, 'fs, 'ft");
1035 Format(instr, "cmp.une.s 'fd, 'fs, 'ft");
1038 Format(instr, "cmp.ne.s 'fd, 'fs, 'ft");
1049 Format(instr, "jr 'rs");
1052 Format(instr, "jalr 'rs, 'rd");
1056 Format(instr, "nop");
1058 Format(instr, "sll 'rd, 'rt, 'sa");
1062 Format(instr, "srl 'rd, 'rt, 'sa");
1065 Format(instr, "rotr 'rd, 'rt, 'sa");
1072 Format(instr, "sra 'rd, 'rt, 'sa");
1075 Format(instr, "sllv 'rd, 'rt, 'rs");
1079 Format(instr, "srlv 'rd, 'rt, 'rs");
1082 Format(instr, "rotrv 'rd, 'rt, 'rs");
1089 Format(instr, "srav 'rd, 'rt, 'rs");
1092 Format(instr, "lsa 'rd, 'rt, 'rs, 'sa2");
1096 Format(instr, "mfhi 'rd");
1099 Format(instr, "clz 'rd, 'rs");
1102 Format(instr, "clo 'rd, 'rs");
1107 Format(instr, "mflo 'rd");
1111 Format(instr, "mult 'rs, 'rt");
1114 Format
1116 Format(instr, "muh 'rd, 'rs, 'rt");
1122 Format(instr, "multu 'rs, 'rt");
1125 Format(instr, "mulu 'rd, 'rs, 'rt");
1127 Format(instr, "muhu 'rd, 'rs, 'rt");
1133 Format(instr, "div 'rs, 'rt");
1136 Format(instr, "div 'rd, 'rs, 'rt");
1138 Format(instr, "mod 'rd, 'rs, 'rt");
1144 Format(instr, "divu 'rs, 'rt");
1147 Format(instr, "divu 'rd, 'rs, 'rt");
1149 Format(instr, "modu 'rd, 'rs, 'rt");
1154 Format(instr, "add 'rd, 'rs, 'rt");
1157 Format(instr, "addu 'rd, 'rs, 'rt");
1160 Format(instr, "sub 'rd, 'rs, 'rt");
1163 Format(instr, "subu 'rd, 'rs, 'rt");
1166 Format(instr, "and 'rd, 'rs, 'rt");
1170 Format(instr, "mov 'rd, 'rt");
1172 Format(instr, "mov 'rd, 'rs");
1174 Format(instr, "or 'rd, 'rs, 'rt");
1178 Format(instr, "xor 'rd, 'rs, 'rt");
1181 Format(instr, "nor 'rd, 'rs, 'rt");
1184 Format(instr, "slt 'rd, 'rs, 'rt");
1187 Format(instr, "sltu 'rd, 'rs, 'rt");
1190 Format(instr, "break, code: 'code");
1193 Format(instr, "tge 'rs, 'rt, code: 'code");
1196 Format(instr, "tgeu 'rs, 'rt, code: 'code");
1199 Format(instr, "tlt 'rs, 'rt, code: 'code");
1202 Format(instr, "tltu 'rs, 'rt, code: 'code");
1205 Format(instr, "teq 'rs, 'rt, code: 'code");
1208 Format(instr, "tne 'rs, 'rt, code: 'code");
1211 Format(instr, "sync");
1214 Format(instr, "movz 'rd, 'rs, 'rt");
1217 Format(instr, "movn 'rd, 'rs, 'rt");
1221 Format(instr, "movt 'rd, 'rs, 'bc");
1223 Format(instr, "movf 'rd, 'rs, 'bc");
1227 Format(instr, "seleqz 'rd, 'rs, 'rt");
1230 Format(instr, "selnez 'rd, 'rs, 'rt");
1241 Format(instr, "mul 'rd, 'rs, 'rt");
1245 Format(instr, "clz 'rd, 'rs");
1258 Format(instr, "ins 'rt, 'rs, 'sa, 'ss2");
1266 Format(instr, "ext 'rt, 'rs, 'sa, 'ss1");
1277 Format(instr, "bitswap 'rd, 'rt");
1285 Format(instr, "seb 'rd, 'rt");
1293 Format(instr, "seh 'rd, 'rt");
1301 Format(instr, "wsbh 'rd, 'rt");
1312 Format(instr, "align 'rd, 'rs, 'rt, 'bp2");
1340 Format(instr, "mfc1 'rt, 'fs");
1343 Format(instr, "mfhc1 'rt, 'fs");
1346 Format(instr, "mtc1 'rt, 'fs");
1350 Format(instr, "ctc1 'rt, 'fs");
1353 Format(instr, "cfc1 'rt, 'fs");
1356 Format(instr, "mthc1 'rt, 'fs");
1380 Format(instr, "madd.s 'fd, 'fr, 'fs, 'ft");
1383 Format(instr, "madd.d 'fd, 'fr, 'fs, 'ft");
1386 Format(instr, "msub.s 'fd, 'fr, 'fs, 'ft");
1389 Format(instr, "msub.d 'fd, 'fr, 'fs, 'ft");
1416 Format(instr, "bc1t 'bc, 'imm16u -> 'imm16p4s2");
1418 Format(instr, "bc1f 'bc, 'imm16u -> 'imm16p4s2");
1422 Format(instr, "bc1eqz 'ft, 'imm16u -> 'imm16p4s2");
1425 Format(instr, "bc1nez 'ft, 'imm16u -> 'imm16p4s2");
1436 Format(instr, "bltz 'rs, 'imm16u -> 'imm16p4s2");
1439 Format(instr, "bltzal 'rs, 'imm16u -> 'imm16p4s2");
1442 Format(instr, "bgez 'rs, 'imm16u -> 'imm16p4s2");
1446 Format(instr, "bal 'imm16s -> 'imm16p4s2");
1448 Format(instr, "bgezal 'rs, 'imm16u -> 'imm16p4s2");
1452 Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2");
1460 Format(instr, "beq 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1463 Format(instr, "bc 'imm26s -> 'imm26p4s2");
1466 Format(instr, "balc 'imm26s -> 'imm26p4s2");
1469 Format(instr, "bne 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1473 Format(instr, "blez 'rs, 'imm16u -> 'imm16p4s2");
1476 Format(instr, "bgeuc 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1479 Format(instr, "bgezalc 'rs, 'imm16u -> 'imm16p4s2");
1481 Format(instr, "blezalc 'rt, 'imm16u -> 'imm16p4s2");
1488 Format(instr, "bgtz 'rs, 'imm16u -> 'imm16p4s2");
1491 Format(instr, "bltuc 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1494 Format(instr, "bltzalc 'rt, 'imm16u -> 'imm16p4s2");
1496 Format(instr, "bgtzalc 'rt, 'imm16u -> 'imm16p4s2");
1503 Format(instr, "bgezc 'rt, 'imm16u -> 'imm16p4s2");
1506 Format(instr, "bgec 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1508 Format(instr, "blezc 'rt, 'imm16u -> 'imm16p4s2");
1515 Format(instr, "bltzc 'rt, 'imm16u -> 'imm16p4s2");
1518 Format(instr, "bltc 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1520 Format(instr, "bgtzc 'rt, 'imm16u -> 'imm16p4s2");
1527 Format(instr, "jic 'rt, 'imm16s");
1529 Format(instr, "beqzc 'rs, 'imm21s -> 'imm21p4s2");
1534 Format(instr, "jialc 'rt, 'imm16s");
1536 Format(instr, "bnezc 'rs, 'imm21s -> 'imm21p4s2");
1542 Format(instr, "addi 'rt, 'rs, 'imm16s");
1548 Format(instr, "bovc 'rs, 'rt, 'imm16s -> 'imm16p4s2");
1552 Format(instr, "beqzalc 'rt, 'imm16s -> 'imm16p4s2");
1554 Format(instr, "beqc 'rs, 'rt, 'imm16s -> 'imm16p4s2");
1565 Format(instr, "bnvc 'rs, 'rt, 'imm16s -> 'imm16p4s2");
1569 Format(instr, "bnezalc 'rt, 'imm16s -> 'imm16p4s2");
1571 Format(instr, "bnec 'rs, 'rt, 'imm16s -> 'imm16p4s2");
1577 Format(instr, "addiu 'rt, 'rs, 'imm16s");
1580 Format(instr, "slti 'rt, 'rs, 'imm16s");
1583 Format(instr, "sltiu 'rt, 'rs, 'imm16u");
1586 Format(instr, "andi 'rt, 'rs, 'imm16x");
1589 Format(instr, "ori 'rt, 'rs, 'imm16x");
1592 Format(instr, "xori 'rt, 'rs, 'imm16x");
1596 Format(instr, "lui 'rt, 'imm16x");
1599 Format(instr, "aui 'rt, 'rs, 'imm16x");
1601 Format(instr, "lui 'rt, 'imm16x");
1607 Format(instr, "lb 'rt, 'imm16s('rs)");
1610 Format(instr, "lh 'rt, 'imm16s('rs)");
1613 Format(instr, "lwl 'rt, 'imm16s('rs)");
1616 Format(instr, "lw 'rt, 'imm16s('rs)");
1619 Format(instr, "lbu 'rt, 'imm16s('rs)");
1622 Format(instr, "lhu 'rt, 'imm16s('rs)");
1625 Format(instr, "lwr 'rt, 'imm16s('rs)");
1628 Format(instr, "pref 'rt, 'imm16s('rs)");
1631 Format(instr, "sb 'rt, 'imm16s('rs)");
1634 Format(instr, "sh 'rt, 'imm16s('rs)");
1637 Format(instr, "swl 'rt, 'imm16s('rs)");
1640 Format(instr, "sw 'rt, 'imm16s('rs)");
1643 Format(instr, "swr 'rt, 'imm16s('rs)");
1646 Format(instr, "lwc1 'ft, 'imm16s('rs)");
1649 Format(instr, "ldc1 'ft, 'imm16s('rs)");
1652 Format(instr, "swc1 'ft, 'imm16s('rs)");
1655 Format(instr, "sdc1 'ft, 'imm16s('rs)");
1663 Format(instr, "aluipc 'rs, 'imm16s");
1666 Format(instr, "auipc 'rs, 'imm16s");
1673 Format(instr, "lwpc 'rs, 'imm19s");
1676 Format(instr, "addiupc 'rs, 'imm19s");
1697 Format(instr, "j 'imm26x -> 'imm26j");
1700 Format(instr, "jal 'imm26x -> 'imm26j");
1729 Format(instr, "UNSUPPORTED");