More tests +fix for fsel

This commit is contained in:
dingusdev 2020-02-14 07:58:30 -07:00
parent 17e69677e8
commit 4f02a98c2b
2 changed files with 16 additions and 73 deletions

View File

@ -609,68 +609,6 @@ void opc_bx(PPCDisasmContext* ctx)
ctx->instr_str = my_sprintf("%-8s0x%08X", bx_mnem[ctx->instr_code & 3], dst);
}
void opc_ori(PPCDisasmContext* ctx)
{
auto ra = (ctx->instr_code >> 16) & 0x1F;
auto rs = (ctx->instr_code >> 21) & 0x1F;
auto imm = ctx->instr_code & 0xFFFF;
if (!ra && !rs && !imm && ctx->simplified) {
ctx->instr_str = my_sprintf("%-8s", "nop");
return;
}
if (imm == 0 && ctx->simplified) { /* inofficial, produced by IDA */
fmt_twoop(ctx->instr_str, "mr", ra, rs);
return;
}
fmt_threeop_uimm(ctx->instr_str, "ori", ra, rs, imm);
}
void opc_oris(PPCDisasmContext* ctx)
{
auto ra = (ctx->instr_code >> 16) & 0x1F;
auto rs = (ctx->instr_code >> 21) & 0x1F;
auto imm = ctx->instr_code & 0xFFFF;
fmt_threeop_uimm(ctx->instr_str, "oris", ra, rs, imm);
}
void opc_xori(PPCDisasmContext* ctx)
{
auto ra = (ctx->instr_code >> 16) & 0x1F;
auto rs = (ctx->instr_code >> 21) & 0x1F;
auto imm = ctx->instr_code & 0xFFFF;
fmt_threeop_uimm(ctx->instr_str, "xori", ra, rs, imm);
}
void opc_xoris(PPCDisasmContext* ctx)
{
auto ra = (ctx->instr_code >> 16) & 0x1F;
auto rs = (ctx->instr_code >> 21) & 0x1F;
auto imm = ctx->instr_code & 0xFFFF;
fmt_threeop_uimm(ctx->instr_str, "xoris", ra, rs, imm);
}
void opc_andidot(PPCDisasmContext* ctx)
{
auto ra = (ctx->instr_code >> 16) & 0x1F;
auto rs = (ctx->instr_code >> 21) & 0x1F;
auto imm = ctx->instr_code & 0xFFFF;
fmt_threeop_uimm(ctx->instr_str, "andi.", ra, rs, imm);
}
void opc_andisdot(PPCDisasmContext* ctx)
{
auto ra = (ctx->instr_code >> 16) & 0x1F;
auto rs = (ctx->instr_code >> 21) & 0x1F;
auto imm = ctx->instr_code & 0xFFFF;
fmt_threeop_uimm(ctx->instr_str, "andis.", ra, rs, imm);
}
void opc_sc(PPCDisasmContext* ctx)
{
ctx->instr_str = my_sprintf("%-8s", "sc");
@ -1447,15 +1385,12 @@ void opc_group63(PPCDisasmContext* ctx)
return;
case 23: /* fsel */
strcpy(opcode, "fsel");
strcpy(opcode, opc_flt_ext_arith[23]);
if (rc_set)
strcat(opcode, ".");
if ((rc != 0) | (ra != 0))
opc_illegal(ctx);
else
fmt_fourop_flt(ctx->instr_str, opcode, rs, ra, rb, rc);
fmt_fourop_flt(ctx->instr_str, opcode, rs, ra, rc, rb);
return;

View File

@ -146,12 +146,12 @@
0xFFF00100,0x7C843515,addeo.,r4,r4,r6
0xFFF00100,0x7CE80194,addze,r7,r8
0xFFF00100,0x7C800195,addze.,r4,r0
# FIXME addzeo
# FIXME addzeo.
# FIXME addme
# FIXME addme.
# FIXME addmeo
# FIXME addmeo.
0xFFF00100,0x7C000594,addzeo,r0,r0
0xFFF00100,0x7C000595,addzeo.,r0,r0
0xFFF00100,0x7F9C01D4,addme,r28,r28
0xFFF00100,0x7D0801D5,addme.,r8,r8
0xFFF00100,0x7D0805D4,addmeo,r8,r8
0xFFF00100,0x7D0805D5,addmeo.,r8,r8
0xFFF00100,0x7F03EA14,add,r24,r3,r29
0xFFF00100,0x7ED6E215,add.,r22,r22,r28
0xFFF00100,0x7D040614,addo,r8,r4,r0
@ -231,6 +231,7 @@
0xFFF00100,0x6744AAAA,oris,r4,r26,0xAAAA
# synchronization instructions
0xFFF00100,0x7FEF2E2C,lhbrx,r31,r15,r5
0xFFF00100,0x7D201828,lwarx,r9,0,r3
0xFFF00100,0x7D20192D,stwcx.,r9,0,r3
0xFFF00100,0x7FAB052C,stwbrx,r29,r11,r0
@ -285,9 +286,16 @@
#floating point operations
0xFFF00100,0xFC03282A,fadd,f0,f3,f5
0xFFF00100,0xFDAD682B,fadd.,f13,f13,f13
0xFFF00100,0xFC0D6028,fsub,f0,f13,f12
0xFFF00100,0xFC2107F2,fmul,f1,f1,f31
0xFFF00100,0xFF2C07F3,fmul.,f25,f12,f31
0xFFF00100,0xFC0D0024,fdiv,f0,f13,f0
0xFFF00100,0xFC2B0025,fdiv.,f1,f11,f0
0xFFF00100,0xFD8952FC,fnmsub,f12,f9,f11,f10
0xFFF00100,0xEDA66278,fmsubs,f13,f6,f9,f12
0xFFF00100,0xEDA66279,fmsubs.,f13,f6,f9,f12
0xFFF00100,0xEC00637C,fnmsubs,f0,f0,f13,f12
0xFFF00100,0xFE0820AF,fsel.,f16,f8,f2,f4
0xFFF00100,0xFD600110,fnabs,f11,f0
0xFFF00100,0xFD002034,frsqrte,f8,f4
0xFFF00100,0x7FF957AE,stfiwx,f31,r25,r10

1 # Test data for PowerPC disassembler supplied as comma-separated values
146 # FIXME addmeo. 0xFFF00100,0x7D0805D5,addmeo.,r8,r8
147 0xFFF00100,0x7F03EA14,add,r24,r3,r29
148 0xFFF00100,0x7ED6E215,add.,r22,r22,r28
149 0xFFF00100,0x7D040614,addo,r8,r4,r0
150 0xFFF00100,0x7DE40615,addo.,r15,r4,r0
151 # integer multiplications & divisions, primary opcode 0x1F
152 0xFFF00100,0x7C8C5016,mulhwu,r4,r12,r10
153 0xFFF00100,0x7CA72017,mulhwu.,r5,r7,r4
154 0xFFF00100,0x7CA72096,mulhw,r5,r7,r4
155 0xFFF00100,0x7CA72097,mulhw.,r5,r7,r4
156 0xFFF00100,0x7C9000D6,mul,r4,r16,r0
157 0xFFF00100,0x7CA428D7,mul.,r5,r4,r5
231 0xFFF00100,0x80A2FFB8,lwz,r5,-0x48(r2) 0xFFF00100,0x80BF0808,lwz,r5,0x808(r31)
232 0xFFF00100,0x80002F3C,lwz,r0,0x2F3C 0xFFF00100,0x80A2FFB8,lwz,r5,-0x48(r2)
233 0xFFF00100,0x8506003C,lwzu,r8,0x3C(r6) 0xFFF00100,0x80002F3C,lwz,r0,0x2F3C
234 0xFFF00100,0x8506003C,lwzu,r8,0x3C(r6)
235 0xFFF00100,0x8403FFF8,lwzu,r0,-0x8(r3)
236 0xFFF00100,0x88FD00FA,lbz,r7,0xFA(r29)
237 0xFFF00100,0x889EFFF4,lbz,r4,-0xC(r30)
286 0xFFF00100,0x7FFF0035,cntlzw.,r31,r31 0xFFF00100,0x7FA05840,cmpl,cr7,1,r0,r11
287 0xFFF00100,0x7C00D7AC,icbi,r0,r26 0xFFF00100,0x2FA90000,cmpi,cr7,1,r9,0x0
288 0xFFF00100,0x7D604828,lwarx,r11,0,r9 0xFFF00100,0x2AA3FFFF,cmpli,cr5,1,r3,0xFFFF
289 0xFFF00100,0xFE17C840,fcmpo,cr4,f23,f25
290 0xFFF00100,0xFF0C6800,fcmpu,cr6,f12,f13
291 # misc instructions
292 0xFFF00100,0x7CBC04AA,lswi,r5,r28,0x20 0xFFF00100,0x7D290034,cntlzw,r9,r9
293 0xFFF00100,0x7FEF2C2A,lswx,r31,r15,r5 0xFFF00100,0x7FFF0035,cntlzw.,r31,r31
294 0xFFF00100,0x7E000400,mcrxr,cr4 0xFFF00100,0x7C00D7AC,icbi,r0,r26
295 0xFFF00100,0x7D604828,lwarx,r11,0,r9
296 0xFFF00100,0x7CBC04AA,lswi,r5,r28,0x20
297 0xFFF00100,0x7FEF2C2A,lswx,r31,r15,r5
298 0xFFF00100,0x7E000400,mcrxr,cr4
299 0xFFF00100,0xFFE0004C,mtfsb1,31
300 0xFFF00100,0xFFE0048F,mffs.,f31
301 0xFFF00100,0x7FEF01A4,mtsr,15,r31