Lines Matching refs:instr

75   void PrintRs(Instruction* instr);
76 void PrintRt(Instruction* instr);
77 void PrintRd(Instruction* instr);
78 void PrintFs(Instruction* instr);
79 void PrintFt(Instruction* instr);
80 void PrintFd(Instruction* instr);
81 void PrintSa(Instruction* instr);
82 void PrintLsaSa(Instruction* instr);
83 void PrintSd(Instruction* instr);
84 void PrintSs1(Instruction* instr);
85 void PrintSs2(Instruction* instr);
86 void PrintSs3(Instruction* instr);
87 void PrintSs4(Instruction* instr);
88 void PrintSs5(Instruction* instr);
89 void PrintBc(Instruction* instr);
90 void PrintCc(Instruction* instr);
91 void PrintFunction(Instruction* instr);
92 void PrintSecondaryField(Instruction* instr);
93 void PrintUImm9(Instruction* instr);
94 void PrintSImm9(Instruction* instr);
95 void PrintUImm16(Instruction* instr);
96 void PrintSImm16(Instruction* instr);
97 void PrintXImm16(Instruction* instr);
98 void PrintPCImm16(Instruction* instr, int delta_pc, int n_bits);
99 void PrintXImm18(Instruction* instr);
100 void PrintSImm18(Instruction* instr);
101 void PrintXImm19(Instruction* instr);
102 void PrintSImm19(Instruction* instr);
103 void PrintXImm21(Instruction* instr);
104 void PrintSImm21(Instruction* instr);
105 void PrintPCImm21(Instruction* instr, int delta_pc, int n_bits);
106 void PrintXImm26(Instruction* instr);
107 void PrintSImm26(Instruction* instr);
108 void PrintPCImm26(Instruction* instr, int delta_pc, int n_bits);
109 void PrintPCImm26(Instruction* instr);
110 void PrintCode(Instruction* instr); // For break and trap instructions.
111 void PrintFormat(Instruction* instr); // For floating format postfix.
112 void PrintBp2(Instruction* instr);
113 void PrintBp3(Instruction* instr);
114 void PrintMsaDataFormat(Instruction* instr);
115 void PrintMsaXImm8(Instruction* instr);
116 void PrintMsaImm8(Instruction* instr);
117 void PrintMsaImm5(Instruction* instr);
118 void PrintMsaSImm5(Instruction* instr);
119 void PrintMsaSImm10(Instruction* instr, bool is_mi10 = false);
120 void PrintMsaImmBit(Instruction* instr);
121 void PrintMsaImmElm(Instruction* instr);
122 void PrintMsaCopy(Instruction* instr);
124 void PrintInstructionName(Instruction* instr);
127 int FormatRegister(Instruction* instr, const char* option);
128 int FormatFPURegister(Instruction* instr, const char* option);
129 int FormatMSARegister(Instruction* instr, const char* option);
130 int FormatOption(Instruction* instr, const char* option);
131 void Format(Instruction* instr, const char* format);
132 void Unknown(Instruction* instr);
133 int DecodeBreakInstr(Instruction* instr);
136 bool DecodeTypeRegisterRsType(Instruction* instr);
137 void DecodeTypeRegisterSRsType(Instruction* instr);
138 void DecodeTypeRegisterDRsType(Instruction* instr);
139 void DecodeTypeRegisterLRsType(Instruction* instr);
140 void DecodeTypeRegisterWRsType(Instruction* instr);
141 void DecodeTypeRegisterSPECIAL(Instruction* instr);
142 void DecodeTypeRegisterSPECIAL2(Instruction* instr);
143 void DecodeTypeRegisterSPECIAL3(Instruction* instr);
144 void DecodeTypeRegisterCOP1(Instruction* instr);
145 void DecodeTypeRegisterCOP1X(Instruction* instr);
146 int DecodeTypeRegister(Instruction* instr);
148 void DecodeTypeImmediateCOP1(Instruction* instr);
149 void DecodeTypeImmediateREGIMM(Instruction* instr);
150 void DecodeTypeImmediateSPECIAL3(Instruction* instr);
151 void DecodeTypeImmediate(Instruction* instr);
153 void DecodeTypeJump(Instruction* instr);
155 void DecodeTypeMsaI8(Instruction* instr);
156 void DecodeTypeMsaI5(Instruction* instr);
157 void DecodeTypeMsaI10(Instruction* instr);
158 void DecodeTypeMsaELM(Instruction* instr);
159 void DecodeTypeMsaBIT(Instruction* instr);
160 void DecodeTypeMsaMI10(Instruction* instr);
161 void DecodeTypeMsa3R(Instruction* instr);
162 void DecodeTypeMsa3RF(Instruction* instr);
163 void DecodeTypeMsaVec(Instruction* instr);
164 void DecodeTypeMsa2R(Instruction* instr);
165 void DecodeTypeMsa2RF(Instruction* instr);
194 void Decoder::PrintRs(Instruction* instr) {
195 int reg = instr->RsValue();
199 void Decoder::PrintRt(Instruction* instr) {
200 int reg = instr->RtValue();
204 void Decoder::PrintRd(Instruction* instr) {
205 int reg = instr->RdValue();
239 void Decoder::PrintFs(Instruction* instr) {
240 int freg = instr->RsValue();
244 void Decoder::PrintFt(Instruction* instr) {
245 int freg = instr->RtValue();
249 void Decoder::PrintFd(Instruction* instr) {
250 int freg = instr->RdValue();
255 void Decoder::PrintSa(Instruction* instr) {
256 int sa = instr->SaValue();
261 void Decoder::PrintLsaSa(Instruction* instr) {
262 int sa = instr->LsaSaValue() + 1;
267 void Decoder::PrintSd(Instruction* instr) {
268 int sd = instr->RdValue();
273 void Decoder::PrintSs1(Instruction* instr) {
274 int msbd = instr->RdValue();
281 void Decoder::PrintSs2(Instruction* instr) {
282 int msb = instr->RdValue();
283 int lsb = instr->SaValue();
289 void Decoder::PrintSs3(Instruction* instr) {
290 int msbdminus32 = instr->RdValue();
296 void Decoder::PrintSs4(Instruction* instr) {
297 int msbminus32 = instr->RdValue();
298 int lsb = instr->SaValue();
304 void Decoder::PrintSs5(Instruction* instr) {
305 int lsbminus32 = instr->SaValue();
311 void Decoder::PrintBc(Instruction* instr) {
312 int cc = instr->FBccValue();
317 void Decoder::PrintCc(Instruction* instr) {
318 int cc = instr->FCccValue();
324 void Decoder::PrintUImm9(Instruction* instr) {
325 int32_t imm = instr->Imm9Value();
330 void Decoder::PrintSImm9(Instruction* instr) {
331 int32_t imm = ((instr->Imm9Value()) << 23) >> 23;
336 void Decoder::PrintUImm16(Instruction* instr) {
337 int32_t imm = instr->Imm16Value();
342 void Decoder::PrintSImm16(Instruction* instr) {
344 ((instr->Imm16Value()) << (32 - kImm16Bits)) >> (32 - kImm16Bits);
349 void Decoder::PrintXImm16(Instruction* instr) {
350 int32_t imm = instr->Imm16Value();
357 void Decoder::PrintPCImm16(Instruction* instr, int delta_pc, int n_bits) {
358 int16_t offset = instr->Imm16Value();
361 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
366 void Decoder::PrintSImm18(Instruction* instr) {
368 ((instr->Imm18Value()) << (32 - kImm18Bits)) >> (32 - kImm18Bits);
373 void Decoder::PrintXImm18(Instruction* instr) {
374 int32_t imm = instr->Imm18Value();
379 void Decoder::PrintXImm19(Instruction* instr) {
380 int32_t imm = instr->Imm19Value();
385 void Decoder::PrintSImm19(Instruction* instr) {
386 int32_t imm19 = instr->Imm19Value();
394 void Decoder::PrintXImm21(Instruction* instr) {
395 uint32_t imm = instr->Imm21Value();
400 void Decoder::PrintSImm21(Instruction* instr) {
401 int32_t imm21 = instr->Imm21Value();
411 void Decoder::PrintPCImm21(Instruction* instr, int delta_pc, int n_bits) {
412 int32_t imm21 = instr->Imm21Value();
418 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
423 void Decoder::PrintXImm26(Instruction* instr) {
424 uint64_t target = static_cast<uint64_t>(instr->Imm26Value())
426 target = (reinterpret_cast<uint64_t>(instr) & ~0xFFFFFFF) | target;
432 void Decoder::PrintSImm26(Instruction* instr) {
433 int32_t imm26 = instr->Imm26Value();
443 void Decoder::PrintPCImm26(Instruction* instr, int delta_pc, int n_bits) {
444 int32_t imm26 = instr->Imm26Value();
450 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) +
457 void Decoder::PrintPCImm26(Instruction* instr) {
458 int32_t imm26 = instr->Imm26Value();
460 uint64_t pc = ((uint64_t)(instr + 1) & pc_mask) | (imm26 << 2);
466 void Decoder::PrintBp2(Instruction* instr) {
467 int bp2 = instr->Bp2Value();
471 void Decoder::PrintBp3(Instruction* instr) {
472 int bp3 = instr->Bp3Value();
477 void Decoder::PrintCode(Instruction* instr) {
478 if (instr->OpcodeFieldRaw() != SPECIAL)
480 switch (instr->FunctionFieldRaw()) {
482 int32_t code = instr->Bits(25, 6);
493 int32_t code = instr->Bits(15, 6);
503 void Decoder::PrintMsaXImm8(Instruction* instr) {
504 int32_t imm = instr->MsaImm8Value();
508 void Decoder::PrintMsaImm8(Instruction* instr) {
509 int32_t imm = instr->MsaImm8Value();
513 void Decoder::PrintMsaImm5(Instruction* instr) {
514 int32_t imm = instr->MsaImm5Value();
518 void Decoder::PrintMsaSImm5(Instruction* instr) {
519 int32_t imm = instr->MsaImm5Value();
525 void Decoder::PrintMsaSImm10(Instruction* instr, bool is_mi10) {
526 int32_t imm = is_mi10 ? instr->MsaImmMI10Value() : instr->MsaImm10Value();
532 void Decoder::PrintMsaImmBit(Instruction* instr) {
533 int32_t m = instr->MsaBitMValue();
537 void Decoder::PrintMsaImmElm(Instruction* instr) {
538 int32_t n = instr->MsaElmNValue();
542 void Decoder::PrintMsaCopy(Instruction* instr) {
543 int32_t rd = instr->WdValue();
544 int32_t ws = instr->WsValue();
545 int32_t n = instr->MsaElmNValue();
551 void Decoder::PrintFormat(Instruction* instr) {
553 switch (instr->RsFieldRaw()) {
572 void Decoder::PrintMsaDataFormat(Instruction* instr) {
573 DCHECK(instr->IsMSAInstr());
575 if (instr->IsMSABranchInstr()) {
576 switch (instr->RsFieldRaw()) {
602 switch (instr->MSAMinorOpcodeField()) {
606 df = DF[instr->Bits(22, 21)];
609 df = DF[instr->Bits(1, 0)];
612 df = DF[instr->MsaBitDf()];
615 df = DF[instr->MsaElmDf()];
618 uint32_t opcode = instr->InstructionBits() & kMsa3RFMask;
628 df = DF[1 + instr->Bit(21)];
631 df = DF[2 + instr->Bit(21)];
636 df = DF[instr->Bits(17, 16)];
639 df = DF[2 + instr->Bit(16)];
650 void Decoder::PrintInstructionName(Instruction* instr) {}
654 int Decoder::FormatRegister(Instruction* instr, const char* format) {
657 int reg = instr->RsValue();
661 int reg = instr->RtValue();
665 int reg = instr->RdValue();
674 int Decoder::FormatFPURegister(Instruction* instr, const char* format) {
676 if ((CTC1 == instr->RsFieldRaw()) || (CFC1 == instr->RsFieldRaw())) {
678 int reg = instr->FsValue();
682 int reg = instr->FtValue();
686 int reg = instr->FdValue();
690 int reg = instr->FrValue();
696 int reg = instr->FsValue();
700 int reg = instr->FtValue();
704 int reg = instr->FdValue();
708 int reg = instr->FrValue();
718 int Decoder::FormatMSARegister(Instruction* instr, const char* format) {
721 int reg = instr->WsValue();
725 int reg = instr->WtValue();
729 int reg = instr->WdValue();
742 int Decoder::FormatOption(Instruction* instr, const char* format) {
746 PrintCode(instr);
756 PrintSImm16(instr);
760 PrintSImm16(instr);
764 PrintXImm16(instr);
778 PrintPCImm16(instr, delta_pc, n_bits);
791 PrintSImm18(instr);
795 PrintXImm18(instr);
804 PrintSImm19(instr);
808 PrintXImm19(instr);
816 PrintMsaSImm10(instr, false);
819 PrintMsaSImm10(instr, true);
828 PrintSImm21(instr);
832 PrintXImm21(instr);
846 PrintPCImm21(instr, delta_pc, n_bits);
859 PrintSImm26(instr);
863 PrintXImm26(instr);
877 PrintPCImm26(instr, delta_pc, n_bits);
885 PrintPCImm26(instr);
894 PrintMsaImm5(instr);
897 PrintMsaSImm5(instr);
902 PrintMsaImm8(instr);
908 PrintUImm9(instr);
911 PrintSImm9(instr);
916 PrintMsaImmBit(instr);
920 PrintMsaImmElm(instr);
926 return FormatRegister(instr, format);
929 return FormatFPURegister(instr, format);
932 return FormatMSARegister(instr, format);
939 PrintLsaSa(instr);
943 PrintSa(instr);
948 PrintSd(instr);
954 PrintSs1(instr);
957 PrintSs2(instr);
960 PrintSs3(instr);
963 PrintSs4(instr);
966 PrintSs5(instr);
976 PrintBc(instr);
983 PrintBp2(instr);
988 PrintBp3(instr);
997 PrintCc(instr);
1001 if (instr->IsMSAInstr()) {
1002 PrintMsaDataFormat(instr);
1004 PrintFormat(instr);
1014 void Decoder::Format(Instruction* instr, const char* format) {
1018 format += FormatOption(instr, format);
1027 // For currently unimplemented decodings the disassembler calls Unknown(instr)
1029 void Decoder::Unknown(Instruction* instr) { Format(instr, "unknown"); }
1031 int Decoder::DecodeBreakInstr(Instruction* instr) {
1032 // This is already known to be BREAK instr, just extract the code.
1033 if (instr->Bits(25, 6) == static_cast<int>(kMaxStopCode)) {
1035 Format(instr, "break, code: 'code");
1038 static_cast<void*>(reinterpret_cast<int32_t*>(instr + kInstrSize)),
1040 *reinterpret_cast<char**>(instr + kInstrSize)));
1041 // Size 3: the break_ instr, plus embedded 64-bit char pointer.
1044 Format(instr, "break, code: 'code");
1049 bool Decoder::DecodeTypeRegisterRsType(Instruction* instr) {
1050 switch (instr->FunctionFieldRaw()) {
1052 Format(instr, "rint.'t 'fd, 'fs");
1055 Format(instr, "sel.'t 'fd, 'fs, 'ft");
1058 Format(instr, "seleqz.'t 'fd, 'fs, 'ft");
1061 Format(instr, "selnez.'t 'fd, 'fs, 'ft");
1064 Format(instr, "movz.'t 'fd, 'fs, 'rt");
1067 Format(instr, "movn.'t 'fd, 'fs, 'rt");
1070 if (instr->Bit(16)) {
1071 Format(instr, "movt.'t 'fd, 'fs, 'Cc");
1073 Format(instr, "movf.'t 'fd, 'fs, 'Cc");
1077 Format(instr, "min.'t 'fd, 'fs, 'ft");
1080 Format(instr, "max.'t 'fd, 'fs, 'ft");
1083 Format(instr, "mina.'t 'fd, 'fs, 'ft");
1086 Format(instr, "maxa.'t 'fd, 'fs, 'ft");
1089 Format(instr, "add.'t 'fd, 'fs, 'ft");
1092 Format(instr, "sub.'t 'fd, 'fs, 'ft");
1095 Format(instr, "mul.'t 'fd, 'fs, 'ft");
1098 Format(instr, "div.'t 'fd, 'fs, 'ft");
1101 Format(instr, "abs.'t 'fd, 'fs");
1104 Format(instr, "mov.'t 'fd, 'fs");
1107 Format(instr, "neg.'t 'fd, 'fs");
1110 Format(instr, "sqrt.'t 'fd, 'fs");
1113 Format(instr, "recip.'t 'fd, 'fs");
1116 Format(instr, "rsqrt.'t 'fd, 'fs");
1119 Format(instr, "cvt.w.'t 'fd, 'fs");
1122 Format(instr, "cvt.l.'t 'fd, 'fs");
1125 Format(instr, "trunc.w.'t 'fd, 'fs");
1128 Format(instr, "trunc.l.'t 'fd, 'fs");
1131 Format(instr, "round.w.'t 'fd, 'fs");
1134 Format(instr, "round.l.'t 'fd, 'fs");
1137 Format(instr, "floor.w.'t 'fd, 'fs");
1140 Format(instr, "floor.l.'t 'fd, 'fs");
1143 Format(instr, "ceil.w.'t 'fd, 'fs");
1146 Format(instr, "ceil.l.'t 'fd, 'fs");
1149 Format(instr, "class.'t 'fd, 'fs");
1152 Format(instr, "cvt.s.'t 'fd, 'fs");
1155 Format(instr, "c.f.'t 'fs, 'ft, 'Cc");
1158 Format(instr, "c.un.'t 'fs, 'ft, 'Cc");
1161 Format(instr, "c.eq.'t 'fs, 'ft, 'Cc");
1164 Format(instr, "c.ueq.'t 'fs, 'ft, 'Cc");
1167 Format(instr, "c.olt.'t 'fs, 'ft, 'Cc");
1170 Format(instr, "c.ult.'t 'fs, 'ft, 'Cc");
1173 Format(instr, "c.ole.'t 'fs, 'ft, 'Cc");
1176 Format(instr, "c.ule.'t 'fs, 'ft, 'Cc");
1184 void Decoder::DecodeTypeRegisterSRsType(Instruction* instr) {
1185 if (!DecodeTypeRegisterRsType(instr)) {
1186 switch (instr->FunctionFieldRaw()) {
1188 Format(instr, "cvt.d.'t 'fd, 'fs");
1191 Format(instr, "maddf.s 'fd, 'fs, 'ft");
1194 Format(instr, "msubf.s 'fd, 'fs, 'ft");
1197 Format(instr, "unknown.cop1.'t");
1203 void Decoder::DecodeTypeRegisterDRsType(Instruction* instr) {
1204 if (!DecodeTypeRegisterRsType(instr)) {
1205 switch (instr->FunctionFieldRaw()) {
1207 Format(instr, "maddf.d 'fd, 'fs, 'ft");
1210 Format(instr, "msubf.d 'fd, 'fs, 'ft");
1213 Format(instr, "unknown.cop1.'t");
1219 void Decoder::DecodeTypeRegisterLRsType(Instruction* instr) {
1220 switch (instr->FunctionFieldRaw()) {
1222 Format(instr, "cvt.d.l 'fd, 'fs");
1225 Format(instr, "cvt.s.l 'fd, 'fs");
1228 Format(instr, "cmp.af.d 'fd, 'fs, 'ft");
1231 Format(instr, "cmp.un.d 'fd, 'fs, 'ft");
1234 Format(instr, "cmp.eq.d 'fd, 'fs, 'ft");
1237 Format(instr, "cmp.ueq.d 'fd, 'fs, 'ft");
1240 Format(instr, "cmp.lt.d 'fd, 'fs, 'ft");
1243 Format(instr, "cmp.ult.d 'fd, 'fs, 'ft");
1246 Format(instr, "cmp.le.d 'fd, 'fs, 'ft");
1249 Format(instr, "cmp.ule.d 'fd, 'fs, 'ft");
1252 Format(instr, "cmp.or.d 'fd, 'fs, 'ft");
1255 Format(instr, "cmp.une.d 'fd, 'fs, 'ft");
1258 Format(instr, "cmp.ne.d 'fd, 'fs, 'ft");
1265 void Decoder::DecodeTypeRegisterWRsType(Instruction* instr) {
1266 switch (instr->FunctionValue()) {
1268 Format(instr, "cvt.s.w 'fd, 'fs");
1271 Format(instr, "cvt.d.w 'fd, 'fs");
1274 Format(instr, "cmp.af.s 'fd, 'fs, 'ft");
1277 Format(instr, "cmp.un.s 'fd, 'fs, 'ft");
1280 Format(instr, "cmp.eq.s 'fd, 'fs, 'ft");
1283 Format(instr, "cmp.ueq.s 'fd, 'fs, 'ft");
1286 Format(instr, "cmp.lt.s 'fd, 'fs, 'ft");
1289 Format(instr, "cmp.ult.s 'fd, 'fs, 'ft");
1292 Format(instr, "cmp.le.s 'fd, 'fs, 'ft");
1295 Format(instr, "cmp.ule.s 'fd, 'fs, 'ft");
1298 Format(instr, "cmp.or.s 'fd, 'fs, 'ft");
1301 Format(instr, "cmp.une.s 'fd, 'fs, 'ft");
1304 Format(instr, "cmp.ne.s 'fd, 'fs, 'ft");
1311 void Decoder::DecodeTypeRegisterCOP1(Instruction* instr) {
1312 switch (instr->RsFieldRaw()) {
1314 Format(instr, "mfc1 'rt, 'fs");
1317 Format(instr, "dmfc1 'rt, 'fs");
1320 Format(instr, "mfhc1 'rt, 'fs");
1323 Format(instr, "mtc1 'rt, 'fs");
1326 Format(instr, "dmtc1 'rt, 'fs");
1330 Format(instr, "ctc1 'rt, 'fs");
1333 Format(instr, "cfc1 'rt, 'fs");
1336 Format(instr, "mthc1 'rt, 'fs");
1339 DecodeTypeRegisterSRsType(instr);
1342 DecodeTypeRegisterDRsType(instr);
1345 DecodeTypeRegisterWRsType(instr);
1348 DecodeTypeRegisterLRsType(instr);
1355 void Decoder::DecodeTypeRegisterCOP1X(Instruction* instr) {
1356 switch (instr->FunctionFieldRaw()) {
1358 Format(instr, "madd.s 'fd, 'fr, 'fs, 'ft");
1361 Format(instr, "madd.d 'fd, 'fr, 'fs, 'ft");
1364 Format(instr, "msub.s 'fd, 'fr, 'fs, 'ft");
1367 Format(instr, "msub.d 'fd, 'fr, 'fs, 'ft");
1374 void Decoder::DecodeTypeRegisterSPECIAL(Instruction* instr) {
1375 switch (instr->FunctionFieldRaw()) {
1377 Format(instr, "jr 'rs");
1380 Format(instr, "jalr 'rs, 'rd");
1383 if (0x0 == static_cast<int>(instr->InstructionBits()))
1384 Format(instr, "nop");
1386 Format(instr, "sll 'rd, 'rt, 'sa");
1389 Format(instr, "dsll 'rd, 'rt, 'sa");
1393 Format(instr, "dmult 'rs, 'rt");
1395 if (instr->SaValue() == MUL_OP) {
1396 Format(instr, "dmul 'rd, 'rs, 'rt");
1398 Format(instr, "dmuh 'rd, 'rs, 'rt");
1403 Format(instr, "dsll32 'rd, 'rt, 'sa");
1406 if (instr->RsValue() == 0) {
1407 Format(instr, "srl 'rd, 'rt, 'sa");
1409 Format(instr, "rotr 'rd, 'rt, 'sa");
1413 if (instr->RsValue() == 0) {
1414 Format(instr, "dsrl 'rd, 'rt, 'sa");
1416 Format(instr, "drotr 'rd, 'rt, 'sa");
1420 if (instr->RsValue() == 0) {
1421 Format(instr, "dsrl32 'rd, 'rt, 'sa");
1423 Format(instr, "drotr32 'rd, 'rt, 'sa");
1427 Format(instr, "sra 'rd, 'rt, 'sa");
1430 Format(instr, "dsra 'rd, 'rt, 'sa");
1433 Format(instr, "dsra32 'rd, 'rt, 'sa");
1436 Format(instr, "sllv 'rd, 'rt, 'rs");
1439 Format(instr, "dsllv 'rd, 'rt, 'rs");
1442 if (instr->SaValue() == 0) {
1443 Format(instr, "srlv 'rd, 'rt, 'rs");
1445 Format(instr, "rotrv 'rd, 'rt, 'rs");
1449 if (instr->SaValue() == 0) {
1450 Format(instr, "dsrlv 'rd, 'rt, 'rs");
1452 Format(instr, "drotrv 'rd, 'rt, 'rs");
1456 Format(instr, "srav 'rd, 'rt, 'rs");
1459 Format(instr, "dsrav 'rd, 'rt, 'rs");
1462 Format(instr, "lsa 'rd, 'rt, 'rs, 'sa2");
1465 Format(instr, "dlsa 'rd, 'rt, 'rs, 'sa2");
1468 if (instr->Bits(25, 16) == 0) {
1469 Format(instr, "mfhi 'rd");
1471 if ((instr->FunctionFieldRaw() == CLZ_R6) && (instr->FdValue() == 1)) {
1472 Format(instr, "clz 'rd, 'rs");
1473 } else if ((instr->FunctionFieldRaw() == CLO_R6) &&
1474 (instr->FdValue() == 1)) {
1475 Format(instr, "clo 'rd, 'rs");
1480 if (instr->Bits(25, 16) == 0) {
1481 Format(instr, "mflo 'rd");
1483 if ((instr->FunctionFieldRaw() == DCLZ_R6) && (instr->FdValue() == 1)) {
1484 Format(instr, "dclz 'rd, 'rs");
1485 } else if ((instr->FunctionFieldRaw() == DCLO_R6) &&
1486 (instr->FdValue() == 1)) {
1487 Format(instr, "dclo 'rd, 'rs");
1493 Format(instr, "dmultu 'rs, 'rt");
1495 if (instr->SaValue() == MUL_OP) {
1496 Format(instr, "dmulu 'rd, 'rs, 'rt");
1498 Format(instr, "dmuhu 'rd, 'rs, 'rt");
1504 Format(instr, "mult 'rs, 'rt");
1506 if (instr->SaValue() == MUL_OP) {
1507 Format(instr, "mul 'rd, 'rs, 'rt");
1509 Format(instr, "muh 'rd, 'rs, 'rt");
1515 Format(instr, "multu 'rs, 'rt");
1517 if (instr->SaValue() == MUL_OP) {
1518 Format(instr, "mulu 'rd, 'rs, 'rt");
1520 Format(instr, "muhu 'rd, 'rs, 'rt");
1527 Format(instr, "div 'rs, 'rt");
1529 if (instr->SaValue() == DIV_OP) {
1530 Format(instr, "div 'rd, 'rs, 'rt");
1532 Format(instr, "mod 'rd, 'rs, 'rt");
1538 Format(instr, "ddiv 'rs, 'rt");
1540 if (instr->SaValue() == DIV_OP) {
1541 Format(instr, "ddiv 'rd, 'rs, 'rt");
1543 Format(instr, "dmod 'rd, 'rs, 'rt");
1549 Format(instr, "divu 'rs, 'rt");
1551 if (instr->SaValue() == DIV_OP) {
1552 Format(instr, "divu 'rd, 'rs, 'rt");
1554 Format(instr, "modu 'rd, 'rs, 'rt");
1560 Format(instr, "ddivu 'rs, 'rt");
1562 if (instr->SaValue() == DIV_OP) {
1563 Format(instr, "ddivu 'rd, 'rs, 'rt");
1565 Format(instr, "dmodu 'rd, 'rs, 'rt");
1570 Format(instr, "add 'rd, 'rs, 'rt");
1573 Format(instr, "dadd 'rd, 'rs, 'rt");
1576 Format(instr, "addu 'rd, 'rs, 'rt");
1579 Format(instr, "daddu 'rd, 'rs, 'rt");
1582 Format(instr, "sub 'rd, 'rs, 'rt");
1585 Format(instr, "dsub 'rd, 'rs, 'rt");
1588 Format(instr, "subu 'rd, 'rs, 'rt");
1591 Format(instr, "dsubu 'rd, 'rs, 'rt");
1594 Format(instr, "and 'rd, 'rs, 'rt");
1597 if (0 == instr->RsValue()) {
1598 Format(instr, "mov 'rd, 'rt");
1599 } else if (0 == instr->RtValue()) {
1600 Format(instr, "mov 'rd, 'rs");
1602 Format(instr, "or 'rd, 'rs, 'rt");
1606 Format(instr, "xor 'rd, 'rs, 'rt");
1609 Format(instr, "nor 'rd, 'rs, 'rt");
1612 Format(instr, "slt 'rd, 'rs, 'rt");
1615 Format(instr, "sltu 'rd, 'rs, 'rt");
1618 Format(instr, "tge 'rs, 'rt, code: 'code");
1621 Format(instr, "tgeu 'rs, 'rt, code: 'code");
1624 Format(instr, "tlt 'rs, 'rt, code: 'code");
1627 Format(instr, "tltu 'rs, 'rt, code: 'code");
1630 Format(instr, "teq 'rs, 'rt, code: 'code");
1633 Format(instr, "tne 'rs, 'rt, code: 'code");
1636 Format(instr, "sync");
1639 Format(instr, "movz 'rd, 'rs, 'rt");
1642 Format(instr, "movn 'rd, 'rs, 'rt");
1645 if (instr->Bit(16)) {
1646 Format(instr, "movt 'rd, 'rs, 'bc");
1648 Format(instr, "movf 'rd, 'rs, 'bc");
1652 Format(instr, "seleqz 'rd, 'rs, 'rt");
1655 Format(instr, "selnez 'rd, 'rs, 'rt");
1662 void Decoder::DecodeTypeRegisterSPECIAL2(Instruction* instr) {
1663 switch (instr->FunctionFieldRaw()) {
1665 Format(instr, "mul 'rd, 'rs, 'rt");
1669 Format(instr, "clz 'rd, 'rs");
1674 Format(instr, "dclz 'rd, 'rs");
1682 void Decoder::DecodeTypeRegisterSPECIAL3(Instruction* instr) {
1683 switch (instr->FunctionFieldRaw()) {
1685 Format(instr, "ext 'rt, 'rs, 'sa, 'ss1");
1689 Format(instr, "dext 'rt, 'rs, 'sa, 'ss1");
1693 Format(instr, "dextm 'rt, 'rs, 'sa, 'ss3");
1697 Format(instr, "dextu 'rt, 'rs, 'ss5, 'ss1");
1701 Format(instr, "ins 'rt, 'rs, 'sa, 'ss2");
1705 Format(instr, "dins 'rt, 'rs, 'sa, 'ss2");
1709 Format(instr, "dinsm 'rt, 'rs, 'sa, 'ss4");
1713 Format(instr, "dinsu 'rt, 'rs, 'ss5, 'ss2");
1717 int sa = instr->SaFieldRaw() >> kSaShift;
1720 Format(instr, "bitswap 'rd, 'rt");
1724 Format(instr, "seb 'rd, 'rt");
1728 Format(instr, "seh 'rd, 'rt");
1732 Format(instr, "wsbh 'rd, 'rt");
1739 Format(instr, "align 'rd, 'rs, 'rt, 'bp2");
1751 int sa = instr->SaFieldRaw() >> kSaShift;
1754 switch (instr->SaFieldRaw() >> kSaShift) {
1756 Format(instr, "dbitswap 'rd, 'rt");
1764 Format(instr, "dsbh 'rd, 'rt");
1768 Format(instr, "dshd 'rd, 'rt");
1775 Format(instr, "dalign 'rd, 'rs, 'rt, 'bp3");
1791 int Decoder::DecodeTypeRegister(Instruction* instr) {
1792 switch (instr->OpcodeFieldRaw()) {
1794 DecodeTypeRegisterCOP1(instr);
1797 DecodeTypeRegisterCOP1X(instr);
1800 switch (instr->FunctionFieldRaw()) {
1802 return DecodeBreakInstr(instr);
1804 DecodeTypeRegisterSPECIAL(instr);
1809 DecodeTypeRegisterSPECIAL2(instr);
1812 DecodeTypeRegisterSPECIAL3(instr);
1815 switch (instr->MSAMinorOpcodeField()) {
1817 DecodeTypeMsa3R(instr);
1820 DecodeTypeMsa3RF(instr);
1823 DecodeTypeMsaVec(instr);
1826 DecodeTypeMsa2R(instr);
1829 DecodeTypeMsa2RF(instr);
1832 DecodeTypeMsaELM(instr);
1844 void Decoder::DecodeTypeImmediateCOP1(Instruction* instr) {
1845 switch (instr->RsFieldRaw()) {
1847 if (instr->FBtrueValue()) {
1848 Format(instr, "bc1t 'bc, 'imm16u -> 'imm16p4s2");
1850 Format(instr, "bc1f 'bc, 'imm16u -> 'imm16p4s2");
1854 Format(instr, "bc1eqz 'ft, 'imm16u -> 'imm16p4s2");
1857 Format(instr, "bc1nez 'ft, 'imm16u -> 'imm16p4s2");
1864 Format(instr, "bz.'t 'wt, 'imm16s -> 'imm16p4s2");
1871 Format(instr, "bnz.'t 'wt, 'imm16s -> 'imm16p4s2");
1878 void Decoder::DecodeTypeImmediateREGIMM(Instruction* instr) {
1879 switch (instr->RtFieldRaw()) {
1881 Format(instr, "bltz 'rs, 'imm16u -> 'imm16p4s2");
1884 Format(instr, "bltzal 'rs, 'imm16u -> 'imm16p4s2");
1887 Format(instr, "bgez 'rs, 'imm16u -> 'imm16p4s2");
1890 if (instr->RsValue() == 0)
1891 Format(instr, "bal 'imm16s -> 'imm16p4s2");
1893 Format(instr, "bgezal 'rs, 'imm16u -> 'imm16p4s2");
1897 Format(instr, "bgezall 'rs, 'imm16u -> 'imm16p4s2");
1900 Format(instr, "dahi 'rs, 'imm16x");
1903 Format(instr, "dati 'rs, 'imm16x");
1910 void Decoder::DecodeTypeImmediateSPECIAL3(Instruction* instr) {
1911 switch (instr->FunctionFieldRaw()) {
1914 Format(instr, "ll 'rt, 'imm9s('rs)");
1916 Unknown(instr);
1922 Format(instr, "lld 'rt, 'imm9s('rs)");
1924 Unknown(instr);
1930 Format(instr, "sc 'rt, 'imm9s('rs)");
1932 Unknown(instr);
1938 Format(instr, "scd 'rt, 'imm9s('rs)");
1940 Unknown(instr);
1949 void Decoder::DecodeTypeImmediate(Instruction* instr) {
1950 switch (instr->OpcodeFieldRaw()) {
1952 DecodeTypeImmediateCOP1(instr);
1956 DecodeTypeImmediateREGIMM(instr);
1960 Format(instr, "beq 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1963 Format(instr, "bc 'imm26s -> 'imm26p4s2");
1966 Format(instr, "balc 'imm26s -> 'imm26p4s2");
1969 Format(instr, "bne 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1972 if ((instr->RtValue() == 0) && (instr->RsValue() != 0)) {
1973 Format(instr, "blez 'rs, 'imm16u -> 'imm16p4s2");
1974 } else if ((instr->RtValue() != instr->RsValue()) &&
1975 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
1976 Format(instr, "bgeuc 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1977 } else if ((instr->RtValue() == instr->RsValue()) &&
1978 (instr->RtValue() != 0)) {
1979 Format(instr, "bgezalc 'rs, 'imm16u -> 'imm16p4s2");
1980 } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
1981 Format(instr, "blezalc 'rt, 'imm16u -> 'imm16p4s2");
1987 if ((instr->RtValue() == 0) && (instr->RsValue() != 0)) {
1988 Format(instr, "bgtz 'rs, 'imm16u -> 'imm16p4s2");
1989 } else if ((instr->RtValue() != instr->RsValue()) &&
1990 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
1991 Format(instr, "bltuc 'rs, 'rt, 'imm16u -> 'imm16p4s2");
1992 } else if ((instr->RtValue() == instr->RsValue()) &&
1993 (instr->RtValue() != 0)) {
1994 Format(instr, "bltzalc 'rt, 'imm16u -> 'imm16p4s2");
1995 } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
1996 Format(instr, "bgtzalc 'rt, 'imm16u -> 'imm16p4s2");
2002 if ((instr->RtValue() == instr->RsValue()) && (instr->RtValue() != 0)) {
2003 Format(instr, "bgezc 'rt, 'imm16u -> 'imm16p4s2");
2004 } else if ((instr->RtValue() != instr->RsValue()) &&
2005 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
2006 Format(instr, "bgec 'rs, 'rt, 'imm16u -> 'imm16p4s2");
2007 } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
2008 Format(instr, "blezc 'rt, 'imm16u -> 'imm16p4s2");
2014 if ((instr->RtValue() == instr->RsValue()) && (instr->RtValue() != 0)) {
2015 Format(instr, "bltzc 'rt, 'imm16u -> 'imm16p4s2");
2016 } else if ((instr->RtValue() != instr->RsValue()) &&
2017 (instr->RsValue() != 0) && (instr->RtValue() != 0)) {
2018 Format(instr, "bltc 'rs, 'rt, 'imm16u -> 'imm16p4s2");
2019 } else if ((instr->RsValue() == 0) && (instr->RtValue() != 0)) {
2020 Format(instr, "bgtzc 'rt, 'imm16u -> 'imm16p4s2");
2026 if (instr->RsValue() == JIC) {
2027 Format(instr, "jic 'rt, 'imm16s");
2029 Format(instr, "beqzc 'rs, 'imm21s -> 'imm21p4s2");
2033 if (instr->RsValue() == JIALC) {
2034 Format(instr, "jialc 'rt, 'imm16s");
2036 Format(instr, "bnezc 'rs, 'imm21s -> 'imm21p4s2");
2042 Format(instr, "addi 'rt, 'rs, 'imm16s");
2044 int rs_reg = instr->RsValue();
2045 int rt_reg = instr->RtValue();
2048 Format(instr, "bovc 'rs, 'rt, 'imm16s -> 'imm16p4s2");
2052 Format(instr, "beqzalc 'rt, 'imm16s -> 'imm16p4s2");
2054 Format(instr, "beqc 'rs, 'rt, 'imm16s -> 'imm16p4s2");
2061 Format(instr, "daddi 'rt, 'rs, 'imm16s");
2063 int rs_reg = instr->RsValue();
2064 int rt_reg = instr->RtValue();
2067 Format(instr, "bnvc 'rs, 'rt, 'imm16s -> 'imm16p4s2");
2071 Format(instr, "bnezalc 'rt, 'imm16s -> 'imm16p4s2");
2073 Format(instr, "bnec 'rs, 'rt, 'imm16s -> 'imm16p4s2");
2079 Format(instr, "addiu 'rt, 'rs, 'imm16s");
2082 Format(instr, "daddiu 'rt, 'rs, 'imm16s");
2085 Format(instr, "slti 'rt, 'rs, 'imm16s");
2088 Format(instr, "sltiu 'rt, 'rs, 'imm16u");
2091 Format(instr, "andi 'rt, 'rs, 'imm16x");
2094 Format(instr, "ori 'rt, 'rs, 'imm16x");
2097 Format(instr, "xori 'rt, 'rs, 'imm16x");
2101 Format(instr, "lui 'rt, 'imm16x");
2103 if (instr->RsValue() != 0) {
2104 Format(instr, "aui 'rt, 'rs, 'imm16x");
2106 Format(instr, "lui 'rt, 'imm16x");
2111 Format(instr, "daui 'rt, 'rs, 'imm16x");
2115 Format(instr, "lb 'rt, 'imm16s('rs)");
2118 Format(instr, "lh 'rt, 'imm16s('rs)");
2121 Format(instr, "lwl 'rt, 'imm16s('rs)");
2124 Format(instr, "ldl 'rt, 'imm16s('rs)");
2127 Format(instr, "lw 'rt, 'imm16s('rs)");
2130 Format(instr, "lwu 'rt, 'imm16s('rs)");
2133 Format(instr, "ld 'rt, 'imm16s('rs)");
2136 Format(instr, "lbu 'rt, 'imm16s('rs)");
2139 Format(instr, "lhu 'rt, 'imm16s('rs)");
2142 Format(instr, "lwr 'rt, 'imm16s('rs)");
2145 Format(instr, "ldr 'rt, 'imm16s('rs)");
2148 Format(instr, "pref 'rt, 'imm16s('rs)");
2151 Format(instr, "sb 'rt, 'imm16s('rs)");
2154 Format(instr, "sh 'rt, 'imm16s('rs)");
2157 Format(instr, "swl 'rt, 'imm16s('rs)");
2160 Format(instr, "sw 'rt, 'imm16s('rs)");
2163 Format(instr, "sd 'rt, 'imm16s('rs)");
2166 Format(instr, "swr 'rt, 'imm16s('rs)");
2169 Format(instr, "sdr 'rt, 'imm16s('rs)");
2172 Format(instr, "sdl 'rt, 'imm16s('rs)");
2176 Unknown(instr);
2178 Format(instr, "ll 'rt, 'imm16s('rs)");
2183 Unknown(instr);
2185 Format(instr, "lld 'rt, 'imm16s('rs)");
2190 Unknown(instr);
2192 Format(instr, "sc 'rt, 'imm16s('rs)");
2197 Unknown(instr);
2199 Format(instr, "scd 'rt, 'imm16s('rs)");
2203 Format(instr, "lwc1 'ft, 'imm16s('rs)");
2206 Format(instr, "ldc1 'ft, 'imm16s('rs)");
2209 Format(instr, "swc1 'ft, 'imm16s('rs)");
2212 Format(instr, "sdc1 'ft, 'imm16s('rs)");
2215 int32_t imm21 = instr->Imm21Value();
2220 Format(instr, "aluipc 'rs, 'imm16s");
2223 Format(instr, "auipc 'rs, 'imm16s");
2230 Format(instr, "ldpc 'rs, 'imm18s");
2237 Format(instr, "lwupc 'rs, 'imm19s");
2240 Format(instr, "lwpc 'rs, 'imm19s");
2243 Format(instr, "addiupc 'rs, 'imm19s");
2257 DecodeTypeImmediateSPECIAL3(instr);
2260 switch (instr->MSAMinorOpcodeField()) {
2262 DecodeTypeMsaI8(instr);
2265 DecodeTypeMsaI5(instr);
2268 DecodeTypeMsaI10(instr);
2271 DecodeTypeMsaELM(instr);
2274 DecodeTypeMsaBIT(instr);
2277 DecodeTypeMsaMI10(instr);
2284 printf("a 0x%x \n", instr->OpcodeFieldRaw());
2289 void Decoder::DecodeTypeJump(Instruction* instr) {
2290 switch (instr->OpcodeFieldRaw()) {
2292 Format(instr, "j 'imm26x -> 'imm26j");
2295 Format(instr, "jal 'imm26x -> 'imm26j");
2302 void Decoder::DecodeTypeMsaI8(Instruction* instr) {
2303 uint32_t opcode = instr->InstructionBits() & kMsaI8Mask;
2307 Format(instr, "andi.b 'wd, 'ws, 'imm8");
2310 Format(instr, "ori.b 'wd, 'ws, 'imm8");
2313 Format(instr, "nori.b 'wd, 'ws, 'imm8");
2316 Format(instr, "xori.b 'wd, 'ws, 'imm8");
2319 Format(instr, "bmnzi.b 'wd, 'ws, 'imm8");
2322 Format(instr, "bmzi.b 'wd, 'ws, 'imm8");
2325 Format(instr, "bseli.b 'wd, 'ws, 'imm8");
2328 Format(instr, "shf.b 'wd, 'ws, 'imm8");
2331 Format(instr, "shf.h 'wd, 'ws, 'imm8");
2334 Format(instr, "shf.w 'wd, 'ws, 'imm8");
2341 void Decoder::DecodeTypeMsaI5(Instruction* instr) {
2342 uint32_t opcode = instr->InstructionBits() & kMsaI5Mask;
2346 Format(instr, "addvi.'t 'wd, 'ws, 'imm5u");
2349 Format(instr, "subvi.'t 'wd, 'ws, 'imm5u");
2352 Format(instr, "maxi_s.'t 'wd, 'ws, 'imm5s");
2355 Format(instr, "maxi_u.'t 'wd, 'ws, 'imm5u");
2358 Format(instr, "mini_s.'t 'wd, 'ws, 'imm5s");
2361 Format(instr, "mini_u.'t 'wd, 'ws, 'imm5u");
2364 Format(instr, "ceqi.'t 'wd, 'ws, 'imm5s");
2367 Format(instr, "clti_s.'t 'wd, 'ws, 'imm5s");
2370 Format(instr, "clti_u.'t 'wd, 'ws, 'imm5u");
2373 Format(instr, "clei_s.'t 'wd, 'ws, 'imm5s");
2376 Format(instr, "clei_u.'t 'wd, 'ws, 'imm5u");
2383 void Decoder::DecodeTypeMsaI10(Instruction* instr) {
2384 uint32_t opcode = instr->InstructionBits() & kMsaI5Mask;
2386 Format(instr, "ldi.'t 'wd, 'imm10s1");
2392 void Decoder::DecodeTypeMsaELM(Instruction* instr) {
2393 uint32_t opcode = instr->InstructionBits() & kMsaELMMask;
2396 if (instr->Bits(21, 16) == 0x3E) {
2397 Format(instr, "ctcmsa ");
2398 PrintMSAControlRegister(instr->WdValue());
2400 PrintRegister(instr->WsValue());
2402 Format(instr, "sldi.'t 'wd, 'ws['imme]");
2406 if (instr->Bits(21, 16) == 0x3E) {
2407 Format(instr, "cfcmsa ");
2408 PrintRegister(instr->WdValue());
2410 PrintMSAControlRegister(instr->WsValue());
2412 Format(instr, "splati.'t 'wd, 'ws['imme]");
2416 if (instr->Bits(21, 16) == 0x3E) {
2417 Format(instr, "move.v 'wd, 'ws");
2419 Format(instr, "copy_s.'t ");
2420 PrintMsaCopy(instr);
2424 Format(instr, "copy_u.'t ");
2425 PrintMsaCopy(instr);
2428 Format(instr, "insert.'t 'wd['imme], ");
2429 PrintRegister(instr->WsValue());
2432 Format(instr, "insve.'t 'wd['imme], 'ws[0]");
2439 void Decoder::DecodeTypeMsaBIT(Instruction* instr) {
2440 uint32_t opcode = instr->InstructionBits() & kMsaBITMask;
2444 Format(instr, "slli.'t 'wd, 'ws, 'immb");
2447 Format(instr, "srai.'t 'wd, 'ws, 'immb");
2450 Format(instr, "srli.'t 'wd, 'ws, 'immb");
2453 Format(instr, "bclri.'t 'wd, 'ws, 'immb");
2456 Format(instr, "bseti.'t 'wd, 'ws, 'immb");
2459 Format(instr, "bnegi.'t 'wd, 'ws, 'immb");
2462 Format(instr, "binsli.'t 'wd, 'ws, 'immb");
2465 Format(instr, "binsri.'t 'wd, 'ws, 'immb");
2468 Format(instr, "sat_s.'t 'wd, 'ws, 'immb");
2471 Format(instr, "sat_u.'t 'wd, 'ws, 'immb");
2474 Format(instr, "srari.'t 'wd, 'ws, 'immb");
2477 Format(instr, "srlri.'t 'wd, 'ws, 'immb");
2484 void Decoder::DecodeTypeMsaMI10(Instruction* instr) {
2485 uint32_t opcode = instr->InstructionBits() & kMsaMI10Mask;
2487 Format(instr, "ld.'t 'wd, 'imm10s2(");
2488 PrintRegister(instr->WsValue());
2491 Format(instr, "st.'t 'wd, 'imm10s2(");
2492 PrintRegister(instr->WsValue());
2499 void Decoder::DecodeTypeMsa3R(Instruction* instr) {
2500 uint32_t opcode = instr->InstructionBits() & kMsa3RMask;
2503 Format(instr, "sll.'t 'wd, 'ws, 'wt");
2506 Format(instr, "sra.'t 'wd, 'ws, 'wt");
2509 Format(instr, "srl.'t 'wd, 'ws, 'wt");
2512 Format(instr, "bclr.'t 'wd, 'ws, 'wt");
2515 Format(instr, "bset.'t 'wd, 'ws, 'wt");
2518 Format(instr, "bneg.'t 'wd, 'ws, 'wt");
2521 Format(instr, "binsl.'t 'wd, 'ws, 'wt");
2524 Format(instr, "binsr.'t 'wd, 'ws, 'wt");
2527 Format(instr, "addv.'t 'wd, 'ws, 'wt");
2530 Format(instr, "subv.'t 'wd, 'ws, 'wt");
2533 Format(instr, "max_s.'t 'wd, 'ws, 'wt");
2536 Format(instr, "max_u.'t 'wd, 'ws, 'wt");
2539 Format(instr, "min_s.'t 'wd, 'ws, 'wt");
2542 Format(instr, "min_u.'t 'wd, 'ws, 'wt");
2545 Format(instr, "max_a.'t 'wd, 'ws, 'wt");
2548 Format(instr, "min_a.'t 'wd, 'ws, 'wt");
2551 Format(instr, "ceq.'t 'wd, 'ws, 'wt");
2554 Format(instr, "clt_s.'t 'wd, 'ws, 'wt");
2557 Format(instr, "clt_u.'t 'wd, 'ws, 'wt");
2560 Format(instr, "cle_s.'t 'wd, 'ws, 'wt");
2563 Format(instr, "cle_u.'t 'wd, 'ws, 'wt");
2566 Format(instr, "add_a.'t 'wd, 'ws, 'wt");
2569 Format(instr, "adds_a.'t 'wd, 'ws, 'wt");
2572 Format(instr, "adds_s.'t 'wd, 'ws, 'wt");
2575 Format(instr, "adds_u.'t 'wd, 'ws, 'wt");
2578 Format(instr, "ave_s.'t 'wd, 'ws, 'wt");
2581 Format(instr, "ave_u.'t 'wd, 'ws, 'wt");
2584 Format(instr, "aver_s.'t 'wd, 'ws, 'wt");
2587 Format(instr, "aver_u.'t 'wd, 'ws, 'wt");
2590 Format(instr, "subs_s.'t 'wd, 'ws, 'wt");
2593 Format(instr, "subs_u.'t 'wd, 'ws, 'wt");
2596 Format(instr, "subsus_u.'t 'wd, 'ws, 'wt");
2599 Format(instr, "subsuu_s.'t 'wd, 'ws, 'wt");
2602 Format(instr, "asub_s.'t 'wd, 'ws, 'wt");
2605 Format(instr, "asub_u.'t 'wd, 'ws, 'wt");
2608 Format(instr, "mulv.'t 'wd, 'ws, 'wt");
2611 Format(instr, "maddv.'t 'wd, 'ws, 'wt");
2614 Format(instr, "msubv.'t 'wd, 'ws, 'wt");
2617 Format(instr, "div_s.'t 'wd, 'ws, 'wt");
2620 Format(instr, "div_u.'t 'wd, 'ws, 'wt");
2623 Format(instr, "mod_s.'t 'wd, 'ws, 'wt");
2626 Format(instr, "mod_u.'t 'wd, 'ws, 'wt");
2629 Format(instr, "dotp_s.'t 'wd, 'ws, 'wt");
2632 Format(instr, "dotp_u.'t 'wd, 'ws, 'wt");
2635 Format(instr, "dpadd_s.'t 'wd, 'ws, 'wt");
2638 Format(instr, "dpadd_u.'t 'wd, 'ws, 'wt");
2641 Format(instr, "dpsub_s.'t 'wd, 'ws, 'wt");
2644 Format(instr, "dpsub_u.'t 'wd, 'ws, 'wt");
2647 Format(instr, "sld.'t 'wd, 'ws['rt]");
2650 Format(instr, "splat.'t 'wd, 'ws['rt]");
2653 Format(instr, "pckev.'t 'wd, 'ws, 'wt");
2656 Format(instr, "pckod.'t 'wd, 'ws, 'wt");
2659 Format(instr, "ilvl.'t 'wd, 'ws, 'wt");
2662 Format(instr, "ilvr.'t 'wd, 'ws, 'wt");
2665 Format(instr, "ilvev.'t 'wd, 'ws, 'wt");
2668 Format(instr, "ilvod.'t 'wd, 'ws, 'wt");
2671 Format(instr, "vshf.'t 'wd, 'ws, 'wt");
2674 Format(instr, "srar.'t 'wd, 'ws, 'wt");
2677 Format(instr, "srlr.'t 'wd, 'ws, 'wt");
2680 Format(instr, "hadd_s.'t 'wd, 'ws, 'wt");
2683 Format(instr, "hadd_u.'t 'wd, 'ws, 'wt");
2686 Format(instr, "hsub_s.'t 'wd, 'ws, 'wt");
2689 Format(instr, "hsub_u.'t 'wd, 'ws, 'wt");
2696 void Decoder::DecodeTypeMsa3RF(Instruction* instr) {
2697 uint32_t opcode = instr->InstructionBits() & kMsa3RFMask;
2700 Format(instr, "fcaf.'t 'wd, 'ws, 'wt");
2703 Format(instr, "fcun.'t 'wd, 'ws, 'wt");
2706 Format(instr, "fceq.'t 'wd, 'ws, 'wt");
2709 Format(instr, "fcueq.'t 'wd, 'ws, 'wt");
2712 Format(instr, "fclt.'t 'wd, 'ws, 'wt");
2715 Format(instr, "fcult.'t 'wd, 'ws, 'wt");
2718 Format(instr, "fcle.'t 'wd, 'ws, 'wt");
2721 Format(instr, "fcule.'t 'wd, 'ws, 'wt");
2724 Format(instr, "fsaf.'t 'wd, 'ws, 'wt");
2727 Format(instr, "fsun.'t 'wd, 'ws, 'wt");
2730 Format(instr, "fseq.'t 'wd, 'ws, 'wt");
2733 Format(instr, "fsueq.'t 'wd, 'ws, 'wt");
2736 Format(instr, "fslt.'t 'wd, 'ws, 'wt");
2739 Format(instr, "fsult.'t 'wd, 'ws, 'wt");
2742 Format(instr, "fsle.'t 'wd, 'ws, 'wt");
2745 Format(instr, "fsule.'t 'wd, 'ws, 'wt");
2748 Format(instr, "fadd.'t 'wd, 'ws, 'wt");
2751 Format(instr, "fsub.'t 'wd, 'ws, 'wt");
2754 Format(instr, "fmul.'t 'wd, 'ws, 'wt");
2757 Format(instr, "fdiv.'t 'wd, 'ws, 'wt");
2760 Format(instr, "fmadd.'t 'wd, 'ws, 'wt");
2763 Format(instr, "fmsub.'t 'wd, 'ws, 'wt");
2766 Format(instr, "fexp2.'t 'wd, 'ws, 'wt");
2769 Format(instr, "fexdo.'t 'wd, 'ws, 'wt");
2772 Format(instr, "ftq.'t 'wd, 'ws, 'wt");
2775 Format(instr, "fmin.'t 'wd, 'ws, 'wt");
2778 Format(instr, "fmin_a.'t 'wd, 'ws, 'wt");
2781 Format(instr, "fmax.'t 'wd, 'ws, 'wt");
2784 Format(instr, "fmax_a.'t 'wd, 'ws, 'wt");
2787 Format(instr, "fcor.'t 'wd, 'ws, 'wt");
2790 Format(instr, "fcune.'t 'wd, 'ws, 'wt");
2793 Format(instr, "fcne.'t 'wd, 'ws, 'wt");
2796 Format(instr, "mul_q.'t 'wd, 'ws, 'wt");
2799 Format(instr, "madd_q.'t 'wd, 'ws, 'wt");
2802 Format(instr, "msub_q.'t 'wd, 'ws, 'wt");
2805 Format(instr, "fsor.'t 'wd, 'ws, 'wt");
2808 Format(instr, "fsune.'t 'wd, 'ws, 'wt");
2811 Format(instr, "fsne.'t 'wd, 'ws, 'wt");
2814 Format(instr, "mulr_q.'t 'wd, 'ws, 'wt");
2817 Format(instr, "maddr_q.'t 'wd, 'ws, 'wt");
2820 Format(instr, "msubr_q.'t 'wd, 'ws, 'wt");
2827 void Decoder::DecodeTypeMsaVec(Instruction* instr) {
2828 uint32_t opcode = instr->InstructionBits() & kMsaVECMask;
2831 Format(instr, "and.v 'wd, 'ws, 'wt");
2834 Format(instr, "or.v 'wd, 'ws, 'wt");
2837 Format(instr, "nor.v 'wd, 'ws, 'wt");
2840 Format(instr, "xor.v 'wd, 'ws, 'wt");
2843 Format(instr, "bmnz.v 'wd, 'ws, 'wt");
2846 Format(instr, "bmz.v 'wd, 'ws, 'wt");
2849 Format(instr, "bsel.v 'wd, 'ws, 'wt");
2856 void Decoder::DecodeTypeMsa2R(Instruction* instr) {
2857 uint32_t opcode = instr->InstructionBits() & kMsa2RMask;
2860 Format(instr, "fill.'t 'wd, ");
2861 PrintRegister(instr->WsValue()); // rs value is in ws field
2864 Format(instr, "pcnt.'t 'wd, 'ws");
2867 Format(instr, "nloc.'t 'wd, 'ws");
2870 Format(instr, "nlzc.'t 'wd, 'ws");
2877 void Decoder::DecodeTypeMsa2RF(Instruction* instr) {
2878 uint32_t opcode = instr->InstructionBits() & kMsa2RFMask;
2881 Format(instr, "fclass.'t 'wd, 'ws");
2884 Format(instr, "ftrunc_s.'t 'wd, 'ws");
2887 Format(instr, "ftrunc_u.'t 'wd, 'ws");
2890 Format(instr, "fsqrt.'t 'wd, 'ws");
2893 Format(instr, "frsqrt.'t 'wd, 'ws");
2896 Format(instr, "frcp.'t 'wd, 'ws");
2899 Format(instr, "frint.'t 'wd, 'ws");
2902 Format(instr, "flog2.'t 'wd, 'ws");
2905 Format(instr, "fexupl.'t 'wd, 'ws");
2908 Format(instr, "fexupr.'t 'wd, 'ws");
2911 Format(instr, "ffql.'t 'wd, 'ws");
2914 Format(instr, "ffqr.'t 'wd, 'ws");
2917 Format(instr, "ftint_s.'t 'wd, 'ws");
2920 Format(instr, "ftint_u.'t 'wd, 'ws");
2923 Format(instr, "ffint_s.'t 'wd, 'ws");
2926 Format(instr, "ffint_u.'t 'wd, 'ws");
2938 Instruction* instr = Instruction::At(instr_ptr);
2941 "%08x ", instr->InstructionBits());
2942 switch (instr->InstructionType()) {
2944 return DecodeTypeRegister(instr);
2947 DecodeTypeImmediate(instr);
2951 DecodeTypeJump(instr);
2955 Format(instr, "UNSUPPORTED");