ppcdisasm: fix frsp and add tests for it.

This commit is contained in:
Maxim Poliakovski 2021-01-23 02:32:30 +01:00
parent d8f7588693
commit 014eefdf7e
2 changed files with 8 additions and 2 deletions

View File

@ -1687,8 +1687,12 @@ void opc_group63(PPCDisasmContext* ctx) {
case 12: /* frsp */
if (ra != 0)
opc_illegal(ctx);
else
ctx->instr_str = my_sprintf("%-8s%d, r%d, r%d", "frsp", rs, rb);
else {
strcpy(opcode, "frsp");
if (rc_set)
strcat(opcode, ".");
ctx->instr_str = my_sprintf("%-8sf%d, f%d", opcode, rs, rb);
}
break;
case 14: /* fctiw */
if (ra != 0)

View File

@ -365,6 +365,8 @@
0xFFF00100,0xFD600110,fnabs,f11,f0
0xFFF00100,0xFD002034,frsqrte,f8,f4
0xFFF00100,0x7FF957AE,stfiwx,f31,r25,r10
0xFFF00100,0xFC40F818,frsp,f2,f31
0xFFF00100,0xFC201019,frsp.,f1,f2
# compare instructions
0xFFF00100,0x7C15A000,cmpw,r21,r20

1 # Test data for PowerPC disassembler supplied as comma-separated values
365 0xFFF00100,0xFFE0004C,mtfsb1,31 0xFFF00100,0x7FEF2C2A,lswx,r31,r15,r5
366 0xFFF00100,0xFFE0048F,mffs.,f31 0xFFF00100,0x7E000400,mcrxr,cr4
367 0xFFF00100,0x7C2000A6,mfmsr,r1 0xFFF00100,0xFFE0004C,mtfsb1,31
368 0xFFF00100,0xFFE0048F,mffs.,f31
369 0xFFF00100,0x7C2000A6,mfmsr,r1
370 0xFFF00100,0x7C000124,mtmsr,r0
371 0xFFF00100,0x7FEF01A4,mtsr,15,r31
372 0xFFF00100,0x7C6021E4,mtsrin,r3,r4