Fixed cntlzw, mtsr(in), tlbie

This commit is contained in:
dingusdev 2020-02-13 21:37:33 -07:00
parent 3d89b0438a
commit 73dfec443a

View File

@ -818,19 +818,25 @@ void opc_group31(PPCDisasmContext* ctx)
} }
return; return;
case 0x12: /* tlb instructions */ case 0x12: /* tlb & segment register instructions */
if (index == 11) { if (index == 6) { /* mtsr */
if (!rs & !ra & !rb) if (ra & 16)
opc_illegal(ctx); opc_illegal(ctx);
else else
ctx->instr_str = my_sprintf("%-8s", "tlbia"); ctx->instr_str = my_sprintf("%-8s%d, r%d", "mtsr", ra, rs);
} }
else if (index == 18) { else if (index == 7) { /* mtsrin */
if (!rs & !ra) if (rb & 16)
opc_illegal(ctx); opc_illegal(ctx);
else else
ctx->instr_str = my_sprintf("%-8sr%s", "tlbie", rb); ctx->instr_str = my_sprintf("%-8sr%d, r%d", "mtsrin", rs, rb);
}
else if (index == 9) { /* tlbie */
ctx->instr_str = my_sprintf("%-8sr%s", "tlbie", rb);
}
else if (index == 11) { /* tlbia */
ctx->instr_str = my_sprintf("%-8s", "tlbia");
} }
else if (index == 30) { /* tlbld - 603 only */ else if (index == 30) { /* tlbld - 603 only */
if (!rs & !ra) if (!rs & !ra)
@ -884,9 +890,11 @@ void opc_group31(PPCDisasmContext* ctx)
return; return;
case 0x1A: /* Byte sign extend instructions */ case 0x1A: /* Byte sign extend instructions (and cntlzw) */
if (index == 28) if (index == 0)
strcpy(opcode, "cntlzw");
else if (index == 28)
strcpy(opcode, "extsh"); strcpy(opcode, "extsh");
else if (index == 29) else if (index == 29)
strcpy(opcode, "extsb"); strcpy(opcode, "extsb");
@ -996,10 +1004,7 @@ void opc_group31(PPCDisasmContext* ctx)
} }
} }
else if (index == 30) { /* icbi */ else if (index == 30) { /* icbi */
if (rs == 0) fmt_twoop(ctx->instr_str, opcode, ra, rb);
opc_illegal(ctx);
else
fmt_twoop(ctx->instr_str, opcode, ra, rb);
} }
else if (index == 17) { /* tlbsync */ else if (index == 17) { /* tlbsync */
ctx->instr_str = my_sprintf("%-8s", opcode); ctx->instr_str = my_sprintf("%-8s", opcode);
@ -1053,15 +1058,6 @@ void opc_group31(PPCDisasmContext* ctx)
else else
fmt_threeop(ctx->instr_str, "lwarx", rs, ra, rb); fmt_threeop(ctx->instr_str, "lwarx", rs, ra, rb);
} }
break;
case 26: /* cntlzw */
printf("CASE REACH! \n");
if (rc_set)
fmt_twoop(ctx->instr_str, "cntlzw.", rs, ra);
else
fmt_twoop(ctx->instr_str, "cntlzw", rs, ra);
break; break;
case 29: /* maskg */ case 29: /* maskg */
strcpy(opcode, "maskg"); strcpy(opcode, "maskg");
@ -1092,18 +1088,6 @@ void opc_group31(PPCDisasmContext* ctx)
case 146: /* mtmsr */ case 146: /* mtmsr */
fmt_oneop(ctx->instr_str, "mtmsr", rs); fmt_oneop(ctx->instr_str, "mtmsr", rs);
break; break;
case 210: /* mtsr */
if (ra & 16)
opc_illegal(ctx);
else
ctx->instr_str = my_sprintf("%-8%d, r%d", "mtsr", ra, rs);
break;
case 242: /* mtsrin */
if (rb & 16)
opc_illegal(ctx);
else
ctx->instr_str = my_sprintf("%-8r%d, r%d", "mtsr", rs, rb);
break;
case 277: /* lscbx */ case 277: /* lscbx */
strcpy(opcode, "lscbx"); strcpy(opcode, "lscbx");