RSP: Update display of vector ops

This commit is contained in:
zilmar 2023-06-29 10:59:54 +09:30
parent 080a3b69ac
commit 1c61f15ea9
4 changed files with 94 additions and 70 deletions

View File

@ -104,24 +104,6 @@ extern char * GPR_Strings[32];
: (Reg) == 15 ? "DP TMEM load counter" \ : (Reg) == 15 ? "DP TMEM load counter" \
: "Unknown Register" : "Unknown Register"
#define ElementSpecifier(Elem) \
(Elem) == 0 ? "" : (Elem) == 1 ? "" \
: (Elem) == 2 ? " [0q]" \
: (Elem) == 3 ? " [1q]" \
: (Elem) == 4 ? " [0h]" \
: (Elem) == 5 ? " [1h]" \
: (Elem) == 6 ? " [2h]" \
: (Elem) == 7 ? " [3h]" \
: (Elem) == 8 ? " [0]" \
: (Elem) == 9 ? " [1]" \
: (Elem) == 10 ? " [2]" \
: (Elem) == 11 ? " [3]" \
: (Elem) == 12 ? " [4]" \
: (Elem) == 13 ? " [5]" \
: (Elem) == 14 ? " [6]" \
: (Elem) == 15 ? " [7]" \
: "Unknown Element"
void Enter_RSP_Register_Window(void); void Enter_RSP_Register_Window(void);
void InitilizeRSPRegisters(void); void InitilizeRSPRegisters(void);
void UpdateRSPRegistersScreen(void); void UpdateRSPRegistersScreen(void);

View File

@ -25,6 +25,8 @@ private:
void DecodeLC2Name(void); void DecodeLC2Name(void);
void DecodeSC2Name(void); void DecodeSC2Name(void);
static const char * ElementSpecifier(uint32_t Element);
uint32_t m_Address; uint32_t m_Address;
RSPOpcode m_Instruction; RSPOpcode m_Instruction;
char m_Name[40]; char m_Name[40];

View File

@ -49,6 +49,22 @@ union RSPOpcode
unsigned : 5; unsigned : 5;
unsigned : 6; unsigned : 6;
}; };
struct
{
unsigned : 6;
unsigned vd : 5;
unsigned vs : 5;
unsigned vt : 5;
unsigned e : 4;
unsigned : 7;
};
struct
{
unsigned : 11;
unsigned de : 5;
unsigned : 16;
};
}; };
#pragma warning(pop) #pragma warning(pop)

View File

@ -355,162 +355,162 @@ void RSPInstruction::DecodeCop2Name(void)
{ {
case RSP_VECTOR_VMULF: case RSP_VECTOR_VMULF:
strcpy(m_Name, "VMULF"); strcpy(m_Name, "VMULF");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMULU: case RSP_VECTOR_VMULU:
strcpy(m_Name, "VMULU"); strcpy(m_Name, "VMULU");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMUDL: case RSP_VECTOR_VMUDL:
strcpy(m_Name, "VMUDL"); strcpy(m_Name, "VMUDL");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMUDM: case RSP_VECTOR_VMUDM:
strcpy(m_Name, "VMUDM"); strcpy(m_Name, "VMUDM");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMUDN: case RSP_VECTOR_VMUDN:
strcpy(m_Name, "VMUDN"); strcpy(m_Name, "VMUDN");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMUDH: case RSP_VECTOR_VMUDH:
strcpy(m_Name, "VMUDH"); strcpy(m_Name, "VMUDH");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMACF: case RSP_VECTOR_VMACF:
strcpy(m_Name, "VMACF"); strcpy(m_Name, "VMACF");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMACU: case RSP_VECTOR_VMACU:
strcpy(m_Name, "VMACU"); strcpy(m_Name, "VMACU");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMACQ: case RSP_VECTOR_VMACQ:
strcpy(m_Name, "VMACQ"); strcpy(m_Name, "VMACQ");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMADL: case RSP_VECTOR_VMADL:
strcpy(m_Name, "VMADL"); strcpy(m_Name, "VMADL");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMADM: case RSP_VECTOR_VMADM:
strcpy(m_Name, "VMADM"); strcpy(m_Name, "VMADM");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMADN: case RSP_VECTOR_VMADN:
strcpy(m_Name, "VMADN"); strcpy(m_Name, "VMADN");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMADH: case RSP_VECTOR_VMADH:
strcpy(m_Name, "VMADH"); strcpy(m_Name, "VMADH");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VADD: case RSP_VECTOR_VADD:
strcpy(m_Name, "VADD"); strcpy(m_Name, "VADD");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VSUB: case RSP_VECTOR_VSUB:
strcpy(m_Name, "VSUB"); strcpy(m_Name, "VSUB");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VABS: case RSP_VECTOR_VABS:
strcpy(m_Name, "VABS"); strcpy(m_Name, "VABS");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VADDC: case RSP_VECTOR_VADDC:
strcpy(m_Name, "VADDC"); strcpy(m_Name, "VADDC");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VSUBC: case RSP_VECTOR_VSUBC:
strcpy(m_Name, "VSUBC"); strcpy(m_Name, "VSUBC");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VSAW: case RSP_VECTOR_VSAW:
strcpy(m_Name, "VSAW"); strcpy(m_Name, "VSAW");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VLT: case RSP_VECTOR_VLT:
strcpy(m_Name, "VLT"); strcpy(m_Name, "VLT");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VEQ: case RSP_VECTOR_VEQ:
strcpy(m_Name, "VEQ"); strcpy(m_Name, "VEQ");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VNE: case RSP_VECTOR_VNE:
strcpy(m_Name, "VNE"); strcpy(m_Name, "VNE");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VGE: case RSP_VECTOR_VGE:
strcpy(m_Name, "VGE"); strcpy(m_Name, "VGE");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VCL: case RSP_VECTOR_VCL:
strcpy(m_Name, "VCL"); strcpy(m_Name, "VCL");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VCH: case RSP_VECTOR_VCH:
strcpy(m_Name, "VCH"); strcpy(m_Name, "VCH");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VCR: case RSP_VECTOR_VCR:
strcpy(m_Name, "VCR"); strcpy(m_Name, "VCR");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMRG: case RSP_VECTOR_VMRG:
strcpy(m_Name, "VMRG"); strcpy(m_Name, "VMRG");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VAND: case RSP_VECTOR_VAND:
strcpy(m_Name, "VAND"); strcpy(m_Name, "VAND");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VNAND: case RSP_VECTOR_VNAND:
strcpy(m_Name, "VNAND"); strcpy(m_Name, "VNAND");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VOR: case RSP_VECTOR_VOR:
strcpy(m_Name, "VOR"); strcpy(m_Name, "VOR");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VNOR: case RSP_VECTOR_VNOR:
strcpy(m_Name, "VNOR"); strcpy(m_Name, "VNOR");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VXOR: case RSP_VECTOR_VXOR:
strcpy(m_Name, "VXOR"); strcpy(m_Name, "VXOR");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VNXOR: case RSP_VECTOR_VNXOR:
strcpy(m_Name, "VNXOR"); strcpy(m_Name, "VNXOR");
sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.sa, m_Instruction.rd, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); sprintf(m_Param, "$v%d, $v%d, $v%d%s", m_Instruction.vd, m_Instruction.vs, m_Instruction.vt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VRCP: case RSP_VECTOR_VRCP:
strcpy(m_Name, "VRCP"); strcpy(m_Name, "VRCP");
sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); break; sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.e));
case RSP_VECTOR_VRCPL: case RSP_VECTOR_VRCPL:
strcpy(m_Name, "VRCPL"); strcpy(m_Name, "VRCPL");
sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); break; sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VRCPH: case RSP_VECTOR_VRCPH:
strcpy(m_Name, "VRCPH"); strcpy(m_Name, "VRCPH");
sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); break; sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VMOV: case RSP_VECTOR_VMOV:
strcpy(m_Name, "VMOV"); strcpy(m_Name, "VMOV");
sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); break; sprintf(m_Param, "$v%d[%d], $v%d[%d]", m_Instruction.vd, m_Instruction.de & 0x7, m_Instruction.rt, m_Instruction.de & 0x7);
break; break;
case RSP_VECTOR_VRSQ: case RSP_VECTOR_VRSQ:
strcpy(m_Name, "VRSQ"); strcpy(m_Name, "VRSQ");
sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); break; sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VRSQL: case RSP_VECTOR_VRSQL:
strcpy(m_Name, "VRSQL"); strcpy(m_Name, "VRSQL");
sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); break; sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VRSQH: case RSP_VECTOR_VRSQH:
strcpy(m_Name, "VRSQH"); strcpy(m_Name, "VRSQH");
sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.rs & 0xF)); break; sprintf(m_Param, "$v%d[%d], $v%d%s", m_Instruction.sa, m_Instruction.rd & 0x7, m_Instruction.rt, ElementSpecifier(m_Instruction.e));
break; break;
case RSP_VECTOR_VNOP: case RSP_VECTOR_VNOP:
strcpy(m_Name, "VNOP"); strcpy(m_Name, "VNOP");
@ -529,47 +529,47 @@ void RSPInstruction::DecodeLC2Name(void)
{ {
case RSP_LSC2_BV: case RSP_LSC2_BV:
strcpy(m_Name, "LBV"); strcpy(m_Name, "LBV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 0), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_SV: case RSP_LSC2_SV:
strcpy(m_Name, "LSV"); strcpy(m_Name, "LSV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 1), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_LV: case RSP_LSC2_LV:
strcpy(m_Name, "LLV"); strcpy(m_Name, "LLV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 2), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_DV: case RSP_LSC2_DV:
strcpy(m_Name, "LDV"); strcpy(m_Name, "LDV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 3), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_QV: case RSP_LSC2_QV:
strcpy(m_Name, "LQV"); strcpy(m_Name, "LQV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 4), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_RV: case RSP_LSC2_RV:
strcpy(m_Name, "LRV"); strcpy(m_Name, "LRV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 4), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_PV: case RSP_LSC2_PV:
strcpy(m_Name, "LPV"); strcpy(m_Name, "LPV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 3), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_UV: case RSP_LSC2_UV:
strcpy(m_Name, "LUV"); strcpy(m_Name, "LUV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 3), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_HV: case RSP_LSC2_HV:
strcpy(m_Name, "LHV"); strcpy(m_Name, "LHV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 4), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_FV: case RSP_LSC2_FV:
strcpy(m_Name, "LFV"); strcpy(m_Name, "LFV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 4), GPR_Name(m_Instruction.base));
break; break;
case RSP_LSC2_TV: case RSP_LSC2_TV:
strcpy(m_Name, "LTV"); strcpy(m_Name, "LTV");
sprintf(m_Param, "$v%d[%d], %c0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? '-' : '+', abs(m_Instruction.voffset), GPR_Name(m_Instruction.base)); sprintf(m_Param, "$v%d[%d], %s0x%03X(%s)", m_Instruction.rt, m_Instruction.del, (m_Instruction.voffset < 0) ? "-" : "", abs(m_Instruction.voffset << 4), GPR_Name(m_Instruction.base));
break; break;
default: default:
strcpy(m_Name, "UNKNOWN"); strcpy(m_Name, "UNKNOWN");
@ -629,4 +629,28 @@ void RSPInstruction::DecodeSC2Name(void)
strcpy(m_Name, "UNKNOWN"); strcpy(m_Name, "UNKNOWN");
sprintf(m_Param, "0x%08X", m_Instruction.Value); sprintf(m_Param, "0x%08X", m_Instruction.Value);
} }
} }
const char * RSPInstruction::ElementSpecifier(uint32_t Element)
{
switch (Element)
{
case 0: return "";
case 1: return "";
case 2: return " [0q]";
case 3: return " [1q]";
case 4: return " [0h]";
case 5: return " [1h]";
case 6: return " [2h]";
case 7: return " [3h]";
case 8: return " [0]";
case 9: return " [1]";
case 10: return " [2]";
case 11: return " [3]";
case 12: return " [4]";
case 13: return " [5]";
case 14: return " [6]";
case 15: return " [7]";
}
return "Unknown Element";
}