16 static const int enable4_bits[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
34 LOG_DEBUG(
"address: 0x%8.8" PRIx32
", value: 0x%8.8" PRIx32
"",
39 LOG_DEBUG(
"address: 0x%8.8" PRIx32
" failed",
48 *imm = opcode & 0x1FFFFFF;
55 *rt = (opcode >> 20) & 0x1F;
56 *imm = opcode & 0xFFFFF;
63 *rt = (opcode >> 20) & 0x1F;
64 *ra = (opcode >> 15) & 0x1F;
65 *imm = opcode & 0x7FFF;
71 uint8_t *rb, int32_t *imm)
73 *rt = (opcode >> 20) & 0x1F;
74 *ra = (opcode >> 15) & 0x1F;
75 *rb = (opcode >> 10) & 0x1F;
76 *imm = opcode & 0x3FF;
82 uint8_t *rb, uint8_t *rd, uint8_t *sub_opc)
84 *rt = (opcode >> 20) & 0x1F;
85 *ra = (opcode >> 15) & 0x1F;
86 *rb = (opcode >> 10) & 0x1F;
87 *rd = (opcode >> 5) & 0x1F;
88 *sub_opc = opcode & 0x1F;
102 switch (opc_6 & 0x7) {
112 snprintf(instruction->
text,
114 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
115 "\tLBI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
129 snprintf(instruction->
text,
131 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
132 "\tLHI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
146 snprintf(instruction->
text,
148 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
149 "\tLWI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
162 snprintf(instruction->
text,
164 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
165 "\tLBI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
178 snprintf(instruction->
text,
180 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
181 "\tLHI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
194 snprintf(instruction->
text,
196 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
197 "\tLWI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32
"",
203 snprintf(instruction->
text,
205 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
221 switch (opc_6 & 0x7) {
231 snprintf(instruction->
text,
233 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
234 "\tSBI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
248 snprintf(instruction->
text,
250 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
251 "\tSHI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
265 snprintf(instruction->
text,
267 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
268 "\tSWI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
281 snprintf(instruction->
text,
283 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
284 "\tSBI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
297 snprintf(instruction->
text,
299 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
300 "\tSHI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
313 snprintf(instruction->
text,
315 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
316 "\tSWI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
322 snprintf(instruction->
text,
324 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
340 switch (opc_6 & 0x7) {
350 snprintf(instruction->
text,
352 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
353 "\tLBSI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
367 snprintf(instruction->
text,
369 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
370 "\tLHSI\t$r%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
381 if (sub_type & 0x10) {
384 snprintf(instruction->
text,
386 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
387 "\tDPREFI.d\t%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
394 snprintf(instruction->
text,
396 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
397 "\tDPREFI.w\t%" PRIu8
",[$r%" PRIu8
"+#%" PRId32
"]",
412 snprintf(instruction->
text,
414 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
415 "\tLBSI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
428 snprintf(instruction->
text,
430 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
431 "\tLHSI.bi\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
439 if ((instruction->
info.
imm >> 19) & 0x1) {
444 snprintf(instruction->
text,
446 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
447 "\tLBSI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
455 snprintf(instruction->
text,
457 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
458 "\tLBI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
464 snprintf(instruction->
text,
466 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
478 uint32_t sub_opcode = opcode & 0x3F;
479 uint32_t val_ra, val_rb;
480 switch (sub_opcode >> 3) {
482 switch (sub_opcode & 0x7) {
491 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
493 snprintf(instruction->
text,
495 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
496 "\tLB\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
500 (instruction->
info.
imm >> 8) & 0x3);
510 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
512 snprintf(instruction->
text,
514 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
515 "\tLH\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
519 (instruction->
info.
imm >> 8) & 0x3);
529 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
531 snprintf(instruction->
text,
533 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
534 "\tLW\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
538 (instruction->
info.
imm >> 8) & 0x3);
548 snprintf(instruction->
text,
550 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
551 "\tLB.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
553 opcode, instruction->
info.
rt,
555 (instruction->
info.
imm >> 8) & 0x3);
565 snprintf(instruction->
text,
567 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
568 "\tLH.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
572 (instruction->
info.
imm >> 8) & 0x3);
582 snprintf(instruction->
text,
584 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
585 "\tLW.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
589 (instruction->
info.
imm >> 8) & 0x3);
594 switch (sub_opcode & 0x7) {
603 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
605 snprintf(instruction->
text,
607 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
608 "\tSB\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
610 opcode, instruction->
info.
rt,
612 (instruction->
info.
imm >> 8) & 0x3);
622 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
624 snprintf(instruction->
text,
626 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
627 "\tSH\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
631 (instruction->
info.
imm >> 8) & 0x3);
641 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
643 snprintf(instruction->
text,
645 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
646 "\tSW\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
648 opcode, instruction->
info.
rt,
650 (instruction->
info.
imm >> 8) & 0x3);
660 snprintf(instruction->
text,
662 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
663 "\tSB.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
667 (instruction->
info.
imm >> 8) & 0x3);
677 snprintf(instruction->
text,
679 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
680 "\tSH.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
684 (instruction->
info.
imm >> 8) & 0x3);
694 snprintf(instruction->
text,
696 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
697 "\tSW.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
701 (instruction->
info.
imm >> 8) & 0x3);
706 switch (sub_opcode & 0x7) {
715 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
717 snprintf(instruction->
text,
719 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
720 "\tLBS\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
722 opcode, instruction->
info.
rt,
724 (instruction->
info.
imm >> 8) & 0x3);
734 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
736 snprintf(instruction->
text,
738 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
739 "\tLHS\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
743 (instruction->
info.
imm >> 8) & 0x3);
750 snprintf(instruction->
text,
752 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
753 "\tDPREF\t#%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<#%" PRId32
")]",
757 (instruction->
info.
imm >> 8) & 0x3);
767 snprintf(instruction->
text,
769 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
770 "\tLBS.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
774 (instruction->
info.
imm >> 8) & 0x3);
784 snprintf(instruction->
text,
786 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
787 "\tLHS.bi\t$r%" PRIu8
",[$r%" PRIu8
"],($r%" PRIu8
"<<%" PRId32
")",
791 (instruction->
info.
imm >> 8) & 0x3);
796 switch (sub_opcode & 0x7) {
805 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
807 snprintf(instruction->
text,
809 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
810 "\tLLW\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
814 (instruction->
info.
imm >> 8) & 0x3);
824 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
826 snprintf(instruction->
text,
828 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
829 "\tSCW\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
833 (instruction->
info.
imm >> 8) & 0x3);
838 switch (sub_opcode & 0x7) {
847 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
849 snprintf(instruction->
text,
851 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
852 "\tLBUP\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
856 (instruction->
info.
imm >> 8) & 0x3);
866 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
868 snprintf(instruction->
text,
870 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
871 "\tLWUP\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
875 (instruction->
info.
imm >> 8) & 0x3);
880 switch (sub_opcode & 0x7) {
889 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
891 snprintf(instruction->
text,
893 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
894 "\tSBUP\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
898 (instruction->
info.
imm >> 8) & 0x3);
908 (val_rb << ((instruction->
info.
imm >> 8) & 0x3));
910 snprintf(instruction->
text,
912 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
913 "\tSWUP\t$r%" PRIu8
",[$r%" PRIu8
"+($r%" PRIu8
"<<%" PRId32
")]",
917 (instruction->
info.
imm >> 8) & 0x3);
922 snprintf(instruction->
text,
924 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
940 enable4 = (instruction->
info.
imm >> 6) & 0xF;
941 ba = (instruction->
info.
imm >> 4) & 0x1;
942 id = (instruction->
info.
imm >> 3) & 0x1;
975 switch (opcode & 0x3) {
984 snprintf(instruction->
text,
986 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
987 "\tSMW\t$r%" PRIu8
",[$r%" PRIu8
"],$r%" PRIu8
",%" PRId32,
991 (instruction->
info.
imm >> 6) & 0xF);
999 snprintf(instruction->
text,
1001 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1002 "\tSMWA\t$r%" PRIu8
",[$r%" PRIu8
"],$r%" PRIu8
",%" PRId32,
1006 (instruction->
info.
imm >> 6) & 0xF);
1014 snprintf(instruction->
text,
1016 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1017 "\tSMWZB\t$r%" PRIu8
",[$r%" PRIu8
"],$r%" PRIu8
",%" PRId32,
1021 (instruction->
info.
imm >> 6) & 0xF);
1024 snprintf(instruction->
text,
1026 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
1032 switch (opcode & 0x3) {
1039 snprintf(instruction->
text,
1041 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1042 "\tLMW\t$r%" PRIu8
",[$r%" PRIu8
"],$r%" PRIu8
",%" PRId32,
1046 (instruction->
info.
imm >> 6) & 0xF);
1054 snprintf(instruction->
text,
1056 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1057 "\tLMWA\t$r%" PRIu8
",[$r%" PRIu8
"],$r%" PRIu8
",%" PRId32,
1061 (instruction->
info.
imm >> 6) & 0xF);
1069 snprintf(instruction->
text,
1071 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1072 "\tLMWZB\t$r%" PRIu8
",[$r%" PRIu8
"],$r%" PRIu8
",%" PRId32,
1076 (instruction->
info.
imm >> 6) & 0xF);
1079 snprintf(instruction->
text,
1081 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
1094 switch ((opcode >> 18) & 0x3) {
1102 snprintf(instruction->
text,
1104 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1105 "\tLHI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
1116 snprintf(instruction->
text,
1118 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1119 "\tLHSI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
1130 snprintf(instruction->
text,
1132 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1133 "\tSHI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
1139 if ((opcode >> 17) & 0x1) {
1147 snprintf(instruction->
text,
1149 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1150 "\tSWI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
1161 snprintf(instruction->
text,
1163 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1164 "\tLWI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
1171 snprintf(instruction->
text,
1173 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
1185 switch ((opcode >> 19) & 0x1) {
1193 snprintf(instruction->
text,
1195 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1196 "\tSBI.gp\t$r%" PRIu8
",[#%" PRId32
"]",
1204 snprintf(instruction->
text,
1206 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1207 "\tADDI.gp\t$r%" PRIu8
",#%" PRId32
"",
1212 snprintf(instruction->
text,
1214 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
1230 switch (opc_6 & 0x7) {
1244 snprintf(instruction->
text,
1246 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
1258 switch (opcode & 0x1F) {
1265 snprintf(instruction->
text,
1267 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1268 "\tADD_SLLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1274 snprintf(instruction->
text,
1276 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1277 "\tADD\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1289 snprintf(instruction->
text,
1291 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1292 "\tSUB_SLLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1298 snprintf(instruction->
text,
1300 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1301 "\tSUB\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
"",
1313 snprintf(instruction->
text,
1315 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1316 "\tAND_SLLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1322 snprintf(instruction->
text,
1324 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1325 "\tAND\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
"",
1337 snprintf(instruction->
text,
1339 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1340 "\tXOR_SLLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1346 snprintf(instruction->
text,
1348 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1349 "\tXOR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1361 snprintf(instruction->
text,
1363 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1364 "\tOR_SLLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1370 snprintf(instruction->
text,
1372 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1373 "\tOR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1383 snprintf(instruction->
text,
1385 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1386 "\tNOR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1396 snprintf(instruction->
text,
1398 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1399 "\tSLT\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1409 snprintf(instruction->
text,
1411 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1412 "\tSLTS\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1425 snprintf(instruction->
text,
1427 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1428 "\tSLLI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1442 snprintf(instruction->
text,
1444 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1445 "\tSRLI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1459 snprintf(instruction->
text,
1461 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1462 "\tSRAI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1476 snprintf(instruction->
text,
1478 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1479 "\tROTRI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1490 snprintf(instruction->
text,
1492 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1493 "\tSLL\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1504 snprintf(instruction->
text,
1506 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1507 "\tSRL\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1518 snprintf(instruction->
text,
1520 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1521 "\tSRA\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1532 snprintf(instruction->
text,
1534 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1535 "\tROTR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1546 snprintf(instruction->
text,
1548 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1549 "\tSEB\t$r%" PRIu8
",$r%" PRIu8,
1559 snprintf(instruction->
text,
1561 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1562 "\tSEH\t$r%" PRIu8
",$r%" PRIu8,
1572 snprintf(instruction->
text,
1574 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1575 "\tBITC\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1585 snprintf(instruction->
text,
1587 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1588 "\tZEH\t$r%" PRIu8
",$r%" PRIu8,
1598 snprintf(instruction->
text,
1600 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1601 "\tWSBH\t$r%" PRIu8
",$r%" PRIu8,
1613 snprintf(instruction->
text,
1615 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1616 "\tOR_SRLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1622 snprintf(instruction->
text,
1624 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1625 "\tOR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1636 snprintf(instruction->
text,
1638 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1639 "\tDIVSR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1652 snprintf(instruction->
text,
1654 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1655 "\tDIVR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1667 snprintf(instruction->
text,
1669 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1670 "\tSVA\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1681 snprintf(instruction->
text,
1683 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1684 "\tSVS\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1695 snprintf(instruction->
text,
1697 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1698 "\tCMOVZ\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1709 snprintf(instruction->
text,
1711 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1712 "\tCMOVN\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1725 snprintf(instruction->
text,
1727 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1728 "\tADD_SRLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1734 snprintf(instruction->
text,
1736 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1737 "\tADD\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1749 snprintf(instruction->
text,
1751 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1752 "\tSUB_SRLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1758 snprintf(instruction->
text,
1760 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1761 "\tSUB\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1773 snprintf(instruction->
text,
1775 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1776 "\tAND_SRLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1782 snprintf(instruction->
text,
1784 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1785 "\tAND\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1797 snprintf(instruction->
text,
1799 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1800 "\tXOR_SRLI\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8
",%" PRId32,
1806 snprintf(instruction->
text,
1808 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1809 "\tXOR\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1815 snprintf(instruction->
text,
1817 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
1829 switch (opcode & 0x3F) {
1835 snprintf(instruction->
text,
1837 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1838 "\tMAX\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1848 snprintf(instruction->
text,
1850 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1851 "\tMIN\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1861 snprintf(instruction->
text,
1863 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1864 "\tAVE\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
1874 snprintf(instruction->
text,
1876 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1877 "\tAVE\t$r%" PRIu8
",$r%" PRIu8,
1885 &imm, &(instruction->
info.
imm));
1888 snprintf(instruction->
text,
1890 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1891 "\tCLIPS\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1901 &imm, &(instruction->
info.
imm));
1904 snprintf(instruction->
text,
1906 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1907 "\tCLIP\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1918 snprintf(instruction->
text,
1920 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1921 "\tCLO\t$r%" PRIu8
",$r%" PRIu8,
1930 snprintf(instruction->
text,
1932 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1933 "\tCLZ\t$r%" PRIu8
",$r%" PRIu8,
1941 &imm, &(instruction->
info.
imm));
1944 snprintf(instruction->
text,
1946 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1947 "\tBSET\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1957 &imm, &(instruction->
info.
imm));
1960 snprintf(instruction->
text,
1962 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1963 "\tBCLR\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1973 &imm, &(instruction->
info.
imm));
1976 snprintf(instruction->
text,
1978 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1979 "\tBTGL\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
1989 &imm, &(instruction->
info.
imm));
1992 snprintf(instruction->
text,
1994 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
1995 "\tBTST\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2006 snprintf(instruction->
text,
2008 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2009 "\tBSE\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2019 snprintf(instruction->
text,
2021 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2022 "\tBSP\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2032 snprintf(instruction->
text,
2034 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2035 "\tFFB\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2045 snprintf(instruction->
text,
2047 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2048 "\tFFMISM\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2058 snprintf(instruction->
text,
2060 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2061 "\tFFZMISM\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2070 snprintf(instruction->
text,
2072 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2073 "\tMFUSR\t$r%" PRIu8
",#%" PRId32,
2075 opcode, instruction->
info.
rt,
2076 (instruction->
info.
imm >> 10) & 0x3FF);
2082 snprintf(instruction->
text,
2084 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2085 "\tMTUSR\t$r%" PRIu8
",#%" PRId32,
2087 opcode, instruction->
info.
rt,
2088 (instruction->
info.
imm >> 10) & 0x3FF);
2095 snprintf(instruction->
text,
2097 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2098 "\tMUL\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2109 snprintf(instruction->
text,
2111 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2112 "\tMULTS64\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2114 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2124 snprintf(instruction->
text,
2126 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2127 "\tMULT64\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2129 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2138 snprintf(instruction->
text,
2140 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2141 "\tMADDS64\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2143 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2152 snprintf(instruction->
text,
2154 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2155 "\tMADD64\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2157 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2166 snprintf(instruction->
text,
2168 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2169 "\tMSUBS64\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2171 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2180 snprintf(instruction->
text,
2182 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2183 "\tMSUB64\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2185 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2194 snprintf(instruction->
text,
2196 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2197 "\tDIVS\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2199 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2208 snprintf(instruction->
text,
2210 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2211 "\tDIV\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2213 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2222 snprintf(instruction->
text,
2224 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2225 "\tMULT32\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2227 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2236 snprintf(instruction->
text,
2238 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2239 "\tMADD32\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2241 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2250 snprintf(instruction->
text,
2252 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2253 "\tMSUB32\t$D%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
2255 opcode, (uint8_t)((dt_val >> 1) & 0x1), instruction->
info.
ra,
2260 snprintf(instruction->
text,
2262 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
2278 switch (opc_6 & 0x7) {
2291 snprintf(instruction->
text,
2293 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2294 "\tMOVI\t$r%" PRIu8
",#%" PRId32,
2302 snprintf(instruction->
text,
2304 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2305 "\tSETHI\t$r%" PRIu8
",0x%8.8" PRIx32,
2314 if ((instruction->
info.
imm >> 24) & 0x1) {
2315 snprintf(instruction->
text,
2317 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2320 opcode, instruction->
info.
imm);
2322 snprintf(instruction->
text,
2324 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2327 opcode, instruction->
info.
imm);
2333 instruction->
info.
rb = (imm >> 10) & 0x1F;
2335 switch (imm & 0x1F) {
2339 snprintf(instruction->
text,
2341 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2344 opcode, instruction->
info.
rb);
2346 snprintf(instruction->
text,
2348 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2351 opcode, instruction->
info.
rb);
2355 instruction->
info.
rt = (imm >> 20) & 0x1F;
2356 snprintf(instruction->
text,
2358 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2359 "\tJRAL\t$r%" PRIu8
",$r%" PRIu8,
2364 snprintf(instruction->
text,
2366 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2367 "\tJRNEZ\t$r%" PRIu8,
2369 opcode, instruction->
info.
rb);
2372 instruction->
info.
rt = (imm >> 20) & 0x1F;
2374 snprintf(instruction->
text,
2376 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2377 "\tJRALNEZ\t$r%" PRIu8,
2379 opcode, instruction->
info.
rb);
2381 snprintf(instruction->
text,
2383 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2384 "\tJRALNEZ\t$r%" PRIu8
",$r%" PRIu8,
2398 if ((imm >> 14) & 0x1) {
2403 snprintf(instruction->
text,
2405 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2406 "\tBNE\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2415 snprintf(instruction->
text,
2417 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2418 "\tBEQ\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2420 opcode, instruction->
info.
rt,
2431 switch ((imm >> 16) & 0xF) {
2436 snprintf(instruction->
text,
2438 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2439 "\tBEQZ\t$r%" PRIu8
",#%" PRId32,
2447 snprintf(instruction->
text,
2449 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2450 "\tBNEZ\t$r%" PRIu8
",#%" PRId32,
2458 snprintf(instruction->
text,
2460 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2461 "\tBGEZ\t$r%" PRIu8
",#%" PRId32,
2469 snprintf(instruction->
text,
2471 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2472 "\tBLTZ\t$r%" PRIu8
",#%" PRId32,
2480 snprintf(instruction->
text,
2482 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2483 "\tBGTZ\t$r%" PRIu8
",#%" PRId32,
2491 snprintf(instruction->
text,
2493 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2494 "\tBLEZ\t$r%" PRIu8
",#%" PRId32,
2502 snprintf(instruction->
text,
2504 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2505 "\tBGEZAL\t$r%" PRIu8
",#%" PRId32,
2513 snprintf(instruction->
text,
2515 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2516 "\tBLTZAL\t$r%" PRIu8
",#%" PRId32,
2524 snprintf(instruction->
text,
2526 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
2542 switch (opc_6 & 0x7) {
2548 snprintf(instruction->
text,
2550 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2551 "\tADDI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2561 snprintf(instruction->
text,
2563 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2564 "\tSUBRI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2573 snprintf(instruction->
text,
2575 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2576 "\tANDI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2585 snprintf(instruction->
text,
2587 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2588 "\tXORI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2597 snprintf(instruction->
text,
2599 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2600 "\tORI\t$r%" PRIu8
",$r%" PRIu8
",0x%8.8" PRIx32,
2610 snprintf(instruction->
text,
2612 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2613 "\tSLTI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2623 snprintf(instruction->
text,
2625 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2626 "\tSLTSI\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2632 snprintf(instruction->
text,
2634 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
2650 switch (opc_6 & 0x7) {
2657 sub_opc = imm & 0x1F;
2661 snprintf(instruction->
text,
2663 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2664 "\tSTANDBY\t#%" PRIu32,
2666 opcode, (opcode >> 5) & 0x3);
2673 snprintf(instruction->
text,
2675 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tCCTL",
2683 snprintf(instruction->
text,
2685 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2686 "\tMFSR\t$r%" PRIu8
",#%" PRId32,
2688 opcode, instruction->
info.
rt,
2689 (instruction->
info.
imm >> 10) & 0x3FF);
2695 snprintf(instruction->
text,
2697 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2698 "\tMTSR\t$r%" PRIu8
",#%" PRId32,
2700 opcode, instruction->
info.
ra,
2701 (instruction->
info.
imm >> 10) & 0x3FF);
2705 snprintf(instruction->
text,
2707 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tIRET",
2713 snprintf(instruction->
text,
2715 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2716 "\tTRAP\t#%" PRId32,
2718 opcode, (imm >> 5) & 0x7FFF);
2724 snprintf(instruction->
text,
2726 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2727 "\tTEQZ\t$r%" PRIu8
",#%" PRId32,
2729 opcode, instruction->
info.
ra,
2730 (instruction->
info.
imm >> 5) & 0x7FFF);
2736 snprintf(instruction->
text,
2738 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2739 "\tTNEZ\t$r%" PRIu8
",#%" PRId32,
2741 opcode, instruction->
info.
ra,
2742 (instruction->
info.
imm >> 5) & 0x7FFF);
2746 snprintf(instruction->
text,
2748 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tDSB",
2754 snprintf(instruction->
text,
2756 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tISB",
2763 instruction->
info.
imm = (imm >> 5) & 0x7FFF;
2764 snprintf(instruction->
text,
2766 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2767 "\tBREAK\t#%" PRId32,
2769 opcode, instruction->
info.
imm);
2773 snprintf(instruction->
text,
2775 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2776 "\tSYSCALL\t#%" PRId32,
2778 opcode, (imm >> 5) & 0x7FFF);
2782 snprintf(instruction->
text,
2784 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2785 "\tMSYNC\t#%" PRId32,
2787 opcode, (imm >> 5) & 0x7);
2793 snprintf(instruction->
text,
2795 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
2796 "\tISYNC\t$r%" PRIu8,
2798 opcode, instruction->
info.
ra);
2805 snprintf(instruction->
text,
2807 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tTLBOP",
2816 snprintf(instruction->
text,
2818 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
2850 switch ((opcode >> 10) & 0x7) {
2855 snprintf(instruction->
text,
2857 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2858 "\t\tMOV55\t$r%" PRIu8
",$r%" PRIu8,
2867 snprintf(instruction->
text,
2869 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2870 "\t\tMOVI55\t$r%" PRIu8
",#%" PRId32,
2879 snprintf(instruction->
text,
2881 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2882 "\t\tADD45\t$r%" PRIu8
",$r%" PRIu8,
2886 snprintf(instruction->
text,
2888 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2889 "\t\tSUB45\t$r%" PRIu8
",$r%" PRIu8,
2900 snprintf(instruction->
text,
2902 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2903 "\t\tADDI45\t$r%" PRIu8
",#%" PRId32,
2907 snprintf(instruction->
text,
2909 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2910 "\t\tSUBI45\t$r%" PRIu8
",#%" PRId32,
2920 snprintf(instruction->
text,
2922 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2923 "\t\tSRAI45\t$r%" PRIu8
",#%" PRId32,
2927 if ((instruction->
info.
rt == 0) && (instruction->
info.
imm == 0)) {
2928 snprintf(instruction->
text,
2930 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
"\t\tNOP",
2934 snprintf(instruction->
text,
2936 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2937 "\t\tSRLI45\t$r%" PRIu8
",#%" PRId32,
2949 snprintf(instruction->
text,
2951 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2952 "\t\tSLLI333\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
2960 snprintf(instruction->
text,
2962 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2963 "\t\tZEB33\t$r%" PRIu8
",$r%" PRIu8,
2968 snprintf(instruction->
text,
2970 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2971 "\t\tZEH33\t$r%" PRIu8
",$r%" PRIu8,
2976 snprintf(instruction->
text,
2978 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2979 "\t\tSEB33\t$r%" PRIu8
",$r%" PRIu8,
2984 snprintf(instruction->
text,
2986 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2987 "\t\tSEH33\t$r%" PRIu8
",$r%" PRIu8,
2992 snprintf(instruction->
text,
2994 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
2995 "\t\tXLSB33\t$r%" PRIu8
",$r%" PRIu8,
3000 snprintf(instruction->
text,
3002 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3003 "\t\tXLLB33\t$r%" PRIu8
",$r%" PRIu8,
3008 instruction->
info.
ra = 0;
3010 snprintf(instruction->
text,
3012 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3013 "\t\tBMSKI33\t$r%" PRIu8
",$r%" PRId32,
3018 instruction->
info.
ra = 0;
3020 snprintf(instruction->
text,
3022 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3023 "\t\tFEXTI33\t$r%" PRIu8
",$r%" PRId32,
3028 snprintf(instruction->
text,
3030 "0x%8.8" PRIx32
"\t0x%8.8" PRIx16
3031 "\tUNDEFINED INSTRUCTION",
3044 snprintf(instruction->
text,
3046 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3047 "\t\tADD333\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
3052 snprintf(instruction->
text,
3054 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3055 "\t\tSUB333\t$r%" PRIu8
",$r%" PRIu8
",$r%" PRIu8,
3067 snprintf(instruction->
text,
3069 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3070 "\t\tADDI333\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
3075 snprintf(instruction->
text,
3077 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3078 "\t\tSUBI333\t$r%" PRIu8
",$r%" PRIu8
",#%" PRId32,
3085 snprintf(instruction->
text,
3087 "0x%8.8" PRIx32
"\t0x%8.8" PRIx16
"\tUNDEFINED INSTRUCTION",
3099 switch ((opcode >> 9) & 0xF) {
3109 snprintf(instruction->
text,
3111 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3112 "\t\tLWI333\t$r%" PRIu8
",[$r%" PRIu8
"+(#%" PRId32
")]",
3125 snprintf(instruction->
text,
3127 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3128 "\t\tLWI333.BI\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
3142 snprintf(instruction->
text,
3144 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3145 "\t\tLHI333\t$r%" PRIu8
",[$r%" PRIu8
"+(#%" PRId32
")]",
3159 snprintf(instruction->
text,
3161 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3162 "\t\tLBI333\t$r%" PRIu8
",[$r%" PRIu8
"+(#%" PRId32
")]",
3176 snprintf(instruction->
text,
3178 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3179 "\t\tSWI333\t$r%" PRIu8
",[$r%" PRIu8
"+(#%" PRId32
")]",
3192 snprintf(instruction->
text,
3194 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3195 "\t\tSWI333.BI\t$r%" PRIu8
",[$r%" PRIu8
"],#%" PRId32,
3209 snprintf(instruction->
text,
3211 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3212 "\t\tSHI333\t$r%" PRIu8
",[$r%" PRIu8
"+(#%" PRId32
")]",
3226 snprintf(instruction->
text,
3228 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3229 "\t\tSHI333\t$r%" PRIu8
",[$r%" PRIu8
"+(#%" PRId32
")]",
3238 snprintf(instruction->
text,
3240 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3241 "\t\tADDRI36.SP\t$r%" PRIu8
",#%" PRId32,
3254 snprintf(instruction->
text,
3256 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3257 "\t\tLWI45.FE\t$r%" PRIu8
",[#%" PRId32
"]",
3268 snprintf(instruction->
text,
3270 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3271 "\t\tLWI450\t$r%" PRIu8
",$r%" PRIu8,
3282 snprintf(instruction->
text,
3284 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3285 "\t\tSWI450\t$r%" PRIu8
",$r%" PRIu8,
3300 snprintf(instruction->
text,
3302 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3303 "\t\tLWI37\t$r%" PRIu8
",[fp+#%" PRId32
"]",
3307 snprintf(instruction->
text,
3309 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3310 "\t\tSWI37\t$r%" PRIu8
",[fp+#%" PRId32
"]",
3316 snprintf(instruction->
text,
3318 "0x%8.8" PRIx32
"\t0x%8.8" PRIx16
"\tUNDEFINED INSTRUCTION",
3330 switch ((opcode >> 11) & 0x3) {
3336 snprintf(instruction->
text,
3338 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3339 "\t\tBEQZ38\t$r%" PRIu8
",#%" PRId32,
3348 snprintf(instruction->
text,
3350 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3351 "\t\tBNEZ38\t$r%" PRIu8
",#%" PRId32,
3360 if (instruction->
info.
rt == 5) {
3361 snprintf(instruction->
text,
3363 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3364 "\t\tJ8\t#%" PRId32,
3366 opcode, instruction->
info.
imm);
3368 snprintf(instruction->
text,
3370 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3371 "\t\tBEQS38\t$r%" PRIu8
",#%" PRId32,
3381 if (instruction->
info.
rt == 5) {
3386 snprintf(instruction->
text,
3388 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3389 "\t\tJR5\t$r%" PRIu8,
3391 opcode, instruction->
info.
rb);
3394 snprintf(instruction->
text,
3396 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3397 "\t\tJRAL5\t$r%" PRIu8,
3399 opcode, instruction->
info.
rb);
3402 instruction->
info.
rb = 0;
3405 snprintf(instruction->
text,
3407 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3408 "\t\tEX9.IT\t#%" PRId32,
3410 opcode, instruction->
info.
imm);
3413 snprintf(instruction->
text,
3415 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3416 "\t\tRET5\t$r%" PRIu8,
3418 opcode, instruction->
info.
rb);
3421 instruction->
info.
rt = 0;
3424 snprintf(instruction->
text,
3426 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3427 "\t\tADD5.PC\t$r%" PRIu8,
3429 opcode, instruction->
info.
rt);
3432 snprintf(instruction->
text,
3434 "0x%8.8" PRIx32
"\t0x%8.8" PRIx16
3435 "\tUNDEFINED INSTRUCTION",
3441 snprintf(instruction->
text,
3443 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3444 "\t\tBNES38\t$r%" PRIu8
",#%" PRId32,
3457 switch ((opcode >> 11) & 0x3) {
3459 switch ((opcode >> 9) & 0x3) {
3464 snprintf(instruction->
text,
3466 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3467 "\t\tSLTS45\t$r%" PRIu8
",$r%" PRIu8,
3475 snprintf(instruction->
text,
3477 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3478 "\t\tSLT45\t$r%" PRIu8
",$r%" PRIu8,
3486 snprintf(instruction->
text,
3488 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3489 "\t\tSLTSI45\t$r%" PRIu8
",#%" PRId32,
3497 snprintf(instruction->
text,
3499 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3500 "\t\tSLTI45\t$r%" PRIu8
",#%" PRId32,
3507 switch ((opcode >> 9) & 0x3) {
3513 snprintf(instruction->
text,
3515 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3516 "\t\tBEQZS8\t#%" PRId32,
3518 opcode, instruction->
info.
imm);
3520 snprintf(instruction->
text,
3522 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3523 "\t\tBNEZS8\t#%" PRId32,
3525 opcode, instruction->
info.
imm);
3529 if (((opcode >> 5) & 0xF) == 0) {
3531 snprintf(instruction->
text,
3533 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3534 "\t\tBREAK16\t#%" PRId16,
3536 opcode, (int16_t)(opcode & 0x1F));
3540 snprintf(instruction->
text,
3542 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3543 "\t\tEX9.IT\t#%" PRId16,
3545 opcode, (int16_t)(opcode & 0x1FF));
3550 instruction->
info.
imm = opcode & 0x3FF;
3553 snprintf(instruction->
text,
3555 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3556 "\t\tADDI10.SP\t#%" PRId32,
3558 opcode, instruction->
info.
imm);
3570 snprintf(instruction->
text,
3572 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3573 "\t\tLWI37.SP\t$r%" PRIu8
",[+#%" PRId32
"]",
3577 snprintf(instruction->
text,
3579 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3580 "\t\tSWI37.SP\t$r%" PRIu8
",[+#%" PRId32
"]",
3586 switch ((opcode >> 9) & 0x3) {
3588 instruction->
info.
imm = opcode & 0x1FF;
3590 snprintf(instruction->
text,
3592 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3593 "\t\tIFCALL9\t#%" PRId32
"",
3595 opcode, instruction->
info.
imm);
3601 snprintf(instruction->
text,
3603 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3604 "\t\tMOVPI45\t$r%" PRIu8
",#%" PRId32
"",
3609 switch ((opcode >> 7) & 0x3) {
3629 instruction->
info.
rd = re;
3631 gpr_count = 3 + (re - 5);
3638 snprintf(instruction->
text,
3640 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3641 "\t\tPUSH25\t$r%" PRIu8
",#%" PRId32,
3643 opcode, instruction->
info.
rd,
3666 instruction->
info.
rd = re;
3668 gpr_count = 3 + (re - 5);
3676 snprintf(instruction->
text,
3678 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3679 "\t\tPOP25\t$r%" PRIu8
",#%" PRId32,
3681 opcode, instruction->
info.
rd,
3692 snprintf(instruction->
text,
3694 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3695 "\t\tMOVD44\t$r%" PRIu8
",$r%" PRIu8,
3705 switch (opcode & 0x7) {
3707 snprintf(instruction->
text,
3709 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3710 "\t\tNEG33\t$r%" PRIu8
",$r%" PRIu8,
3715 snprintf(instruction->
text,
3717 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3718 "\t\tNOT33\t$r%" PRIu8
",$r%" PRIu8,
3723 snprintf(instruction->
text,
3725 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3726 "\t\tMUL33\t$r%" PRIu8
",$r%" PRIu8,
3731 snprintf(instruction->
text,
3733 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3734 "\t\tXOR33\t$r%" PRIu8
",$r%" PRIu8,
3739 snprintf(instruction->
text,
3741 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3742 "\t\tAND33\t$r%" PRIu8
",$r%" PRIu8,
3747 snprintf(instruction->
text,
3749 "0x%8.8" PRIx32
"\t0x%4.4" PRIx16
3750 "\t\tOR33\t$r%" PRIu8
",$r%" PRIu8,
3759 snprintf(instruction->
text,
3761 "0x%8.8" PRIx32
"\t0x%8.8" PRIx16
"\tUNDEFINED INSTRUCTION",
3781 opcode = (opcode >> 16) & 0xFFFF;
3782 instruction->
opcode = opcode;
3784 switch ((opcode >> 13) & 0x3) {
3798 snprintf(instruction->
text,
3800 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
3808 instruction->
opcode = opcode;
3811 opc_6 = opcode >> 25;
3814 switch ((opc_6 >> 3) & 0x7) {
3837 snprintf(instruction->
text,
3839 "0x%8.8" PRIx32
"\t0x%8.8" PRIx32
"\tUNDEFINED INSTRUCTION",
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
int nds32_get_mapped_reg(struct nds32 *nds32, unsigned regnum, uint32_t *value)
static int nds32_parse_lsmw(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_type_1(uint32_t opcode, uint8_t *rt, int32_t *imm)
static int nds32_parse_group_1_insn_16(struct nds32 *nds32, uint16_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_group_1_insn(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_type_3(uint32_t opcode, uint8_t *rt, uint8_t *ra, uint8_t *rb, int32_t *imm)
static int nds32_parse_group_0_insn_16(struct nds32 *nds32, uint16_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_group_3_insn(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_type_0(uint32_t opcode, int32_t *imm)
static const int enable4_bits[]
int nds32_evaluate_opcode(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_alu_1(uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_group_2_insn_16(struct nds32 *nds32, uint16_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_group_0_insn(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_calculate_lsmw_access_range(struct nds32 *nds32, struct nds32_instruction *instruction)
static int nds32_parse_alu_2(uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
int nds32_read_opcode(struct nds32 *nds32, uint32_t address, uint32_t *value)
static int nds32_parse_group_4_insn(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_group_3_insn_16(struct nds32 *nds32, uint16_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_type_2(uint32_t opcode, uint8_t *rt, uint8_t *ra, int32_t *imm)
static uint32_t field_mask[9]
static int nds32_parse_group_6_insn(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_hwgp(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_type_4(uint32_t opcode, uint8_t *rt, uint8_t *ra, uint8_t *rb, uint8_t *rd, uint8_t *sub_opc)
static int nds32_parse_group_2_insn(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_group_5_insn(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static uint8_t nds32_extract_field_8u(uint16_t opcode, uint32_t start, uint32_t length)
static int nds32_parse_sbgp(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
static int nds32_parse_mem(struct nds32 *nds32, uint32_t opcode, uint32_t address, struct nds32_instruction *instruction)
@ NDS32_INSN_RESOURCE_ACCESS
char id[RTT_CB_MAX_ID_LENGTH]
Control block identifier.
enum nds32_instruction_type type
struct nds32_instruction::@106 info
Represents a generic Andes core.
struct target * target
Backpointer to the target.
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
static bool target_was_examined(struct target *target)
static uint32_t be_to_h_u32(const uint8_t *buf)