GekkoDisassembler: Remove unused parameter dmode from dab function

With the removal of m_flags, dmode is no longer used in dab.
This commit is contained in:
Dentomologist 2023-07-01 18:04:27 -07:00
parent a732647e5a
commit a177c8bcb1
2 changed files with 92 additions and 93 deletions

View File

@ -714,7 +714,7 @@ void GekkoDisassembler::trap(u32 in, unsigned char dmode)
// Standard instruction: xxxx rD,rA,rB // Standard instruction: xxxx rD,rA,rB
void GekkoDisassembler::dab(u32 in, std::string_view name, int mask, int smode, int chkoe, void GekkoDisassembler::dab(u32 in, std::string_view name, int mask, int smode, int chkoe,
int chkrc, unsigned char dmode) int chkrc)
{ {
if (chkrc >= 0 && ((in & 1) != (unsigned int)chkrc)) if (chkrc >= 0 && ((in & 1) != (unsigned int)chkrc))
{ {
@ -1180,7 +1180,7 @@ void GekkoDisassembler::ps(u32 inst)
if (inst & PPCDMASK) if (inst & PPCDMASK)
ill(inst); ill(inst);
else else
dab(inst, "dcbz_l", 3, 0, 0, 0, 0); dab(inst, "dcbz_l", 3, 0, 0, 0);
return; return;
} }
@ -1444,89 +1444,89 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
case 8: case 8:
case (PPCOE >> 1) + 8: case (PPCOE >> 1) + 8:
dab(swapab(in), "subc", 7, 0, 1, -1, 0); dab(swapab(in), "subc", 7, 0, 1, -1);
break; break;
case 9: case 9:
dab(in, "mulhdu", 7, 0, 0, -1, PPCF_64); dab(in, "mulhdu", 7, 0, 0, -1);
break; break;
case 10: case 10:
case (PPCOE >> 1) + 10: case (PPCOE >> 1) + 10:
dab(in, "addc", 7, 0, 1, -1, 0); dab(in, "addc", 7, 0, 1, -1);
break; break;
case 11: case 11:
dab(in, "mulhwu", 7, 0, 0, -1, 0); dab(in, "mulhwu", 7, 0, 0, -1);
break; break;
case 19: case 19:
if (in & (PPCAMASK | PPCBMASK)) if (in & (PPCAMASK | PPCBMASK))
ill(in); ill(in);
else else
dab(in, "mfcr", 4, 0, 0, 0, 0); dab(in, "mfcr", 4, 0, 0, 0);
break; break;
case 20: case 20:
dab(in, "lwarx", 7, 0, 0, 0, 0); dab(in, "lwarx", 7, 0, 0, 0);
break; break;
case 21: case 21:
dab(in, "ldx", 7, 0, 0, 0, PPCF_64); dab(in, "ldx", 7, 0, 0, 0);
break; break;
case 23: case 23:
dab(in, "lwzx", 7, 0, 0, 0, 0); dab(in, "lwzx", 7, 0, 0, 0);
break; break;
case 24: case 24:
dab(in, "slw", 7, 1, 0, -1, 0); dab(in, "slw", 7, 1, 0, -1);
break; break;
case 26: case 26:
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "cntlzw", 6, 1, 0, -1, 0); dab(in, "cntlzw", 6, 1, 0, -1);
break; break;
case 27: case 27:
dab(in, "sld", 7, 1, 0, -1, PPCF_64); dab(in, "sld", 7, 1, 0, -1);
break; break;
case 28: case 28:
dab(in, "and", 7, 1, 0, -1, 0); dab(in, "and", 7, 1, 0, -1);
break; break;
case 40: case 40:
case (PPCOE >> 1) + 40: case (PPCOE >> 1) + 40:
dab(swapab(in), "sub", 7, 0, 1, -1, 0); dab(swapab(in), "sub", 7, 0, 1, -1);
break; break;
case 53: case 53:
dab(in, "ldux", 7, 0, 0, 0, PPCF_64); dab(in, "ldux", 7, 0, 0, 0);
break; break;
case 54: case 54:
if (in & PPCDMASK) if (in & PPCDMASK)
ill(in); ill(in);
else else
dab(in, "dcbst", 3, 0, 0, 0, 0); dab(in, "dcbst", 3, 0, 0, 0);
break; break;
case 55: case 55:
dab(in, "lwzux", 7, 0, 0, 0, 0); dab(in, "lwzux", 7, 0, 0, 0);
break; break;
case 58: case 58:
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "cntlzd", 6, 1, 0, -1, PPCF_64); dab(in, "cntlzd", 6, 1, 0, -1);
break; break;
case 60: case 60:
dab(in, "andc", 7, 1, 0, -1, 0); dab(in, "andc", 7, 1, 0, -1);
break; break;
case 68: case 68:
@ -1534,33 +1534,33 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 73: case 73:
dab(in, "mulhd", 7, 0, 0, -1, PPCF_64); dab(in, "mulhd", 7, 0, 0, -1);
break; break;
case 75: case 75:
dab(in, "mulhw", 7, 0, 0, -1, 0); dab(in, "mulhw", 7, 0, 0, -1);
break; break;
case 83: case 83:
if (in & (PPCAMASK | PPCBMASK)) if (in & (PPCAMASK | PPCBMASK))
ill(in); ill(in);
else else
dab(in, "mfmsr", 4, 0, 0, 0, PPCF_SUPER); dab(in, "mfmsr", 4, 0, 0, 0);
break; break;
case 84: case 84:
dab(in, "ldarx", 7, 0, 0, 0, PPCF_64); dab(in, "ldarx", 7, 0, 0, 0);
break; break;
case 86: case 86:
if (in & PPCDMASK) if (in & PPCDMASK)
ill(in); ill(in);
else else
dab(in, "dcbf", 3, 0, 0, 0, 0); dab(in, "dcbf", 3, 0, 0, 0);
break; break;
case 87: case 87:
dab(in, "lbzx", 7, 0, 0, 0, 0); dab(in, "lbzx", 7, 0, 0, 0);
break; break;
case 104: case 104:
@ -1568,28 +1568,28 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "neg", 6, 0, 1, -1, 0); dab(in, "neg", 6, 0, 1, -1);
break; break;
case 119: case 119:
dab(in, "lbzux", 7, 0, 0, 0, 0); dab(in, "lbzux", 7, 0, 0, 0);
break; break;
case 124: case 124:
if (PPCGETD(in) == PPCGETB(in)) if (PPCGETD(in) == PPCGETB(in))
dab(in, "not", 6, 1, 0, -1, 0); dab(in, "not", 6, 1, 0, -1);
else else
dab(in, "nor", 7, 1, 0, -1, 0); dab(in, "nor", 7, 1, 0, -1);
break; break;
case 136: case 136:
case (PPCOE >> 1) + 136: case (PPCOE >> 1) + 136:
dab(in, "subfe", 7, 0, 1, -1, 0); dab(in, "subfe", 7, 0, 1, -1);
break; break;
case 138: case 138:
case (PPCOE >> 1) + 138: case (PPCOE >> 1) + 138:
dab(in, "adde", 7, 0, 1, -1, 0); dab(in, "adde", 7, 0, 1, -1);
break; break;
case 144: case 144:
@ -1600,27 +1600,27 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & (PPCAMASK | PPCBMASK)) if (in & (PPCAMASK | PPCBMASK))
ill(in); ill(in);
else else
dab(in, "mtmsr", 4, 0, 0, 0, PPCF_SUPER); dab(in, "mtmsr", 4, 0, 0, 0);
break; break;
case 149: case 149:
dab(in, "stdx", 7, 0, 0, 0, PPCF_64); dab(in, "stdx", 7, 0, 0, 0);
break; break;
case 150: case 150:
dab(in, "stwcx.", 7, 0, 0, 1, 0); dab(in, "stwcx.", 7, 0, 0, 1);
break; break;
case 151: case 151:
dab(in, "stwx", 7, 0, 0, 0, 0); dab(in, "stwx", 7, 0, 0, 0);
break; break;
case 181: case 181:
dab(in, "stdux", 7, 0, 0, 0, PPCF_64); dab(in, "stdux", 7, 0, 0, 0);
break; break;
case 183: case 183:
dab(in, "stwux", 7, 0, 0, 0, 0); dab(in, "stwux", 7, 0, 0, 0);
break; break;
case 200: case 200:
@ -1628,7 +1628,7 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "subfze", 6, 0, 1, -1, 0); dab(in, "subfze", 6, 0, 1, -1);
break; break;
case 202: case 202:
@ -1636,7 +1636,7 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "addze", 6, 0, 1, -1, 0); dab(in, "addze", 6, 0, 1, -1);
break; break;
case 210: case 210:
@ -1644,11 +1644,11 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 214: case 214:
dab(in, "stdcx.", 7, 0, 0, 1, PPCF_64); dab(in, "stdcx.", 7, 0, 0, 1);
break; break;
case 215: case 215:
dab(in, "stbx", 7, 0, 0, 0, 0); dab(in, "stbx", 7, 0, 0, 0);
break; break;
case 232: case 232:
@ -1656,12 +1656,12 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "subfme", 6, 0, 1, -1, 0); dab(in, "subfme", 6, 0, 1, -1);
break; break;
case 233: case 233:
case (PPCOE >> 1) + 233: case (PPCOE >> 1) + 233:
dab(in, "mulld", 7, 0, 1, -1, PPCF_64); dab(in, "mulld", 7, 0, 1, -1);
break; break;
case 234: case 234:
@ -1669,69 +1669,69 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "addme", 6, 0, 1, -1, 0); dab(in, "addme", 6, 0, 1, -1);
break; break;
case 235: case 235:
case (PPCOE >> 1) + 235: case (PPCOE >> 1) + 235:
dab(in, "mullw", 7, 0, 1, -1, 0); dab(in, "mullw", 7, 0, 1, -1);
break; break;
case 242: case 242:
if (in & PPCAMASK) if (in & PPCAMASK)
ill(in); ill(in);
else else
dab(in, "mtsrin", 5, 0, 0, 0, PPCF_SUPER); dab(in, "mtsrin", 5, 0, 0, 0);
break; break;
case 246: case 246:
if (in & PPCDMASK) if (in & PPCDMASK)
ill(in); ill(in);
else else
dab(in, "dcbtst", 3, 0, 0, 0, 0); dab(in, "dcbtst", 3, 0, 0, 0);
break; break;
case 247: case 247:
dab(in, "stbux", 7, 0, 0, 0, 0); dab(in, "stbux", 7, 0, 0, 0);
break; break;
case 266: case 266:
case (PPCOE >> 1) + 266: case (PPCOE >> 1) + 266:
dab(in, "add", 7, 0, 1, -1, 0); dab(in, "add", 7, 0, 1, -1);
break; break;
case 278: case 278:
if (in & PPCDMASK) if (in & PPCDMASK)
ill(in); ill(in);
else else
dab(in, "dcbt", 3, 0, 0, 0, 0); dab(in, "dcbt", 3, 0, 0, 0);
break; break;
case 279: case 279:
dab(in, "lhzx", 7, 0, 0, 0, 0); dab(in, "lhzx", 7, 0, 0, 0);
break; break;
case 284: case 284:
dab(in, "eqv", 7, 1, 0, -1, 0); dab(in, "eqv", 7, 1, 0, -1);
break; break;
case 306: case 306:
if (in & (PPCDMASK | PPCAMASK)) if (in & (PPCDMASK | PPCAMASK))
ill(in); ill(in);
else else
dab(in, "tlbie", 1, 0, 0, 0, PPCF_SUPER); dab(in, "tlbie", 1, 0, 0, 0);
break; break;
case 310: case 310:
dab(in, "eciwx", 7, 0, 0, 0, 0); dab(in, "eciwx", 7, 0, 0, 0);
break; break;
case 311: case 311:
dab(in, "lhzux", 7, 0, 0, 0, 0); dab(in, "lhzux", 7, 0, 0, 0);
break; break;
case 316: case 316:
dab(in, "xor", 7, 1, 0, -1, 0); dab(in, "xor", 7, 1, 0, -1);
break; break;
case 339: case 339:
@ -1739,11 +1739,11 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 341: case 341:
dab(in, "lwax", 7, 0, 0, 0, PPCF_64); dab(in, "lwax", 7, 0, 0, 0);
break; break;
case 343: case 343:
dab(in, "lhax", 7, 0, 0, 0, 0); dab(in, "lhax", 7, 0, 0, 0);
break; break;
case 370: case 370:
@ -1755,19 +1755,19 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 373: case 373:
dab(in, "lwaux", 7, 0, 0, 0, PPCF_64); dab(in, "lwaux", 7, 0, 0, 0);
break; break;
case 375: case 375:
dab(in, "lhaux", 7, 0, 0, 0, 0); dab(in, "lhaux", 7, 0, 0, 0);
break; break;
case 407: case 407:
dab(in, "sthx", 7, 0, 0, 0, 0); dab(in, "sthx", 7, 0, 0, 0);
break; break;
case 412: case 412:
dab(in, "orc", 7, 1, 0, -1, 0); dab(in, "orc", 7, 1, 0, -1);
break; break;
case 413: case 413:
@ -1778,32 +1778,32 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & (PPCDMASK | PPCAMASK)) if (in & (PPCDMASK | PPCAMASK))
ill(in); ill(in);
else else
dab(in, "slbie", 1, 0, 0, 0, PPCF_SUPER | PPCF_64); dab(in, "slbie", 1, 0, 0, 0);
break; break;
case 438: case 438:
dab(in, "ecowx", 7, 0, 0, 0, 0); dab(in, "ecowx", 7, 0, 0, 0);
break; break;
case 439: case 439:
dab(in, "sthux", 7, 0, 0, 0, 0); dab(in, "sthux", 7, 0, 0, 0);
break; break;
case 444: case 444:
if (PPCGETD(in) == PPCGETB(in)) if (PPCGETD(in) == PPCGETB(in))
dab(in, "mr", 6, 1, 0, -1, 0); dab(in, "mr", 6, 1, 0, -1);
else else
dab(in, "or", 7, 1, 0, -1, 0); dab(in, "or", 7, 1, 0, -1);
break; break;
case 457: case 457:
case (PPCOE >> 1) + 457: case (PPCOE >> 1) + 457:
dab(in, "divdu", 7, 0, 1, -1, PPCF_64); dab(in, "divdu", 7, 0, 1, -1);
break; break;
case 459: case 459:
case (PPCOE >> 1) + 459: case (PPCOE >> 1) + 459:
dab(in, "divwu", 7, 0, 1, -1, 0); dab(in, "divwu", 7, 0, 1, -1);
break; break;
case 467: case 467:
@ -1814,21 +1814,21 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCDMASK) if (in & PPCDMASK)
ill(in); ill(in);
else else
dab(in, "dcbi", 3, 0, 0, 0, 0); dab(in, "dcbi", 3, 0, 0, 0);
break; break;
case 476: case 476:
dab(in, "nand", 7, 1, 0, -1, 0); dab(in, "nand", 7, 1, 0, -1);
break; break;
case 489: case 489:
case (PPCOE >> 1) + 489: case (PPCOE >> 1) + 489:
dab(in, "divd", 7, 0, 1, -1, PPCF_64); dab(in, "divd", 7, 0, 1, -1);
break; break;
case 491: case 491:
case (PPCOE >> 1) + 491: case (PPCOE >> 1) + 491:
dab(in, "divw", 7, 0, 1, -1, 0); dab(in, "divw", 7, 0, 1, -1);
break; break;
case 498: case 498:
@ -1848,11 +1848,11 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 533: case 533:
dab(in, "lswx", 7, 0, 0, 0, 0); dab(in, "lswx", 7, 0, 0, 0);
break; break;
case 534: case 534:
dab(in, "lwbrx", 7, 0, 0, 0, 0); dab(in, "lwbrx", 7, 0, 0, 0);
break; break;
case 535: case 535:
@ -1860,11 +1860,11 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 536: case 536:
dab(in, "srw", 7, 1, 0, -1, 0); dab(in, "srw", 7, 1, 0, -1);
break; break;
case 539: case 539:
dab(in, "srd", 7, 1, 0, -1, PPCF_64); dab(in, "srd", 7, 1, 0, -1);
break; break;
case 566: case 566:
@ -1899,15 +1899,15 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCAMASK) if (in & PPCAMASK)
ill(in); ill(in);
else else
dab(in, "mfsrin", 5, 0, 0, 0, PPCF_SUPER); dab(in, "mfsrin", 5, 0, 0, 0);
break; break;
case 661: case 661:
dab(in, "stswx", 7, 0, 0, 0, 0); dab(in, "stswx", 7, 0, 0, 0);
break; break;
case 662: case 662:
dab(in, "stwbrx", 7, 0, 0, 0, 0); dab(in, "stwbrx", 7, 0, 0, 0);
break; break;
case 663: case 663:
@ -1931,15 +1931,15 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 790: case 790:
dab(in, "lhbrx", 7, 0, 0, 0, 0); dab(in, "lhbrx", 7, 0, 0, 0);
break; break;
case 792: case 792:
dab(in, "sraw", 7, 1, 0, -1, 0); dab(in, "sraw", 7, 1, 0, -1);
break; break;
case 794: case 794:
dab(in, "srad", 7, 1, 0, -1, PPCF_64); dab(in, "srad", 7, 1, 0, -1);
break; break;
case 824: case 824:
@ -1951,28 +1951,28 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
break; break;
case 918: case 918:
dab(in, "sthbrx", 7, 0, 0, 0, 0); dab(in, "sthbrx", 7, 0, 0, 0);
break; break;
case 922: case 922:
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "extsh", 6, 1, 0, -1, 0); dab(in, "extsh", 6, 1, 0, -1);
break; break;
case 954: case 954:
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "extsb", 6, 1, 0, -1, 0); dab(in, "extsb", 6, 1, 0, -1);
break; break;
case 982: case 982:
if (in & PPCDMASK) if (in & PPCDMASK)
ill(in); ill(in);
else else
dab(in, "icbi", 3, 0, 0, 0, 0); dab(in, "icbi", 3, 0, 0, 0);
break; break;
case 983: case 983:
@ -1983,14 +1983,14 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & PPCBMASK) if (in & PPCBMASK)
ill(in); ill(in);
else else
dab(in, "extsw", 6, 1, 0, -1, PPCF_64); dab(in, "extsw", 6, 1, 0, -1);
break; break;
case 1014: case 1014:
if (in & PPCDMASK) if (in & PPCDMASK)
ill(in); ill(in);
else else
dab(in, "dcbz", 3, 0, 0, 0, 0); dab(in, "dcbz", 3, 0, 0, 0);
break; break;
default: default:
@ -2233,7 +2233,7 @@ u32* GekkoDisassembler::DoDisassembly(bool big_endian)
if (in & (PPCAMASK | PPCBMASK)) if (in & (PPCAMASK | PPCBMASK))
ill(in); ill(in);
else else
dab(in, "mffs", 4, 0, 0, -1, 0); dab(in, "mffs", 4, 0, 0, -1);
break; break;
case 711: case 711:

View File

@ -72,8 +72,7 @@ private:
static void rld(u32 in, std::string_view name, int i); static void rld(u32 in, std::string_view name, int i);
static void cmp(u32 in); static void cmp(u32 in);
static void trap(u32 in, unsigned char dmode); static void trap(u32 in, unsigned char dmode);
static void dab(u32 in, std::string_view name, int mask, int smode, int chkoe, int chkrc, static void dab(u32 in, std::string_view name, int mask, int smode, int chkoe, int chkrc);
unsigned char dmode);
static void rrn(u32 in, std::string_view name, int smode, int chkoe, int chkrc, static void rrn(u32 in, std::string_view name, int smode, int chkoe, int chkrc,
unsigned char dmode); unsigned char dmode);
static void mtcr(u32 in); static void mtcr(u32 in);