mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-24 12:30:05 +00:00
Fixed compare instructions
This commit is contained in:
parent
5b2369458e
commit
c71be1bc37
@ -473,7 +473,7 @@ void opc_cmp_i_li(PPCDisasmContext* ctx)
|
||||
auto ls = (ctx->instr_code >> 21) & 0x1;
|
||||
auto ra = (ctx->instr_code >> 16) & 0x1F;
|
||||
auto crfd = (ctx->instr_code >> 23) & 0x07;
|
||||
auto imm = ctx->instr_code & 0xFFFF;
|
||||
int imm = ctx->instr_code & 0xFFFF;
|
||||
|
||||
|
||||
if (ctx->simplified) {
|
||||
@ -481,7 +481,7 @@ void opc_cmp_i_li(PPCDisasmContext* ctx)
|
||||
if ((ctx->instr_code >> 26) & 0x1)
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, r%d, 0x%X", "cmpwi", crfd, ra, imm);
|
||||
else
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, r%d, 0x%04X", "cmplwi", crfd, ra, imm);
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, r%d, %s0x%X", "cmplwi", crfd, ra, (imm < 0) ? "-" : "", abs(imm));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -490,7 +490,7 @@ void opc_cmp_i_li(PPCDisasmContext* ctx)
|
||||
if ((ctx->instr_code >> 26) & 0x1)
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, %d, r%d, 0x%X", "cmpi", crfd, ls, ra, imm);
|
||||
else
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, %d, r%d, 0x%04X", "cmpli", crfd, ls, ra, imm);
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, %d, r%d, %s0x%X", "cmpli", crfd, ls, ra, (imm < 0) ? "-" : "", abs(imm));
|
||||
}
|
||||
|
||||
void opc_bool_im(PPCDisasmContext* ctx)
|
||||
@ -1067,8 +1067,14 @@ void opc_group31(PPCDisasmContext* ctx)
|
||||
|
||||
if (ctx->simplified) {
|
||||
if (!(rs & 1)) {
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, r%d, r%d", "cmpw", (rs >> 2), ra, rb);
|
||||
return;
|
||||
if ((rs >> 2) == 0) {
|
||||
ctx->instr_str = my_sprintf("%-8sr%d, r%d", "cmpw", ra, rb);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, r%d, r%d", "cmpw", (rs >> 2), ra, rb);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1127,8 +1133,9 @@ void opc_group31(PPCDisasmContext* ctx)
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
else {
|
||||
ctx->instr_str = my_sprintf("%-8scr%d, %d, r%d, r%d", "cmpl", (rs >> 2), (rs & 1), ra, rb);
|
||||
}
|
||||
break;
|
||||
case 83: /* mfmsr */
|
||||
ctx->instr_str = my_sprintf("%-8sr%d", "mfmsr",
|
||||
|
@ -357,9 +357,9 @@
|
||||
# compare instructions
|
||||
0xFFF00100,0x7C15A000,cmpw,r21,r20
|
||||
0xFFF00100,0x7FBFB800,cmp,cr7,1,r31,r23
|
||||
0xFFF00100,0x7FA05840,cmpl,cr7,1,r0,r11
|
||||
0xFFF00100,0x2FA90000,cmpi,cr7,1,r9,0x0
|
||||
0xFFF00100,0x2AA3FFFF,cmpli,cr5,1,r3,0xFFFF
|
||||
0xFFF00100,0x7F804840,cmplw,cr7,r0,r9
|
||||
0xFFF00100,0x2F800000,cmpwi,cr7,r0,0x0
|
||||
0xFFF00100,0x298E0022,cmplwi,cr3,r14,0x22
|
||||
0xFFF00100,0xFE17C840,fcmpo,cr4,f23,f25
|
||||
0xFFF00100,0xFF0C6800,fcmpu,cr6,f12,f13
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user