Skip to content
Permalink
Browse files

Fix RSP scalar elements

  • Loading branch information...
sp1187 committed Sep 11, 2019
1 parent 2df8aba commit 7aa5cbaa519cb1f29a1d01986078c1c0c408ba2b
@@ -18,7 +18,7 @@ enum class MipsRegisterType
RspCop0,
RspVector,
RspVectorControl,
RspBroadcastElement,
RspVectorElement,
RspScalarElement,
RspOffsetElement
};
@@ -355,7 +355,7 @@ const tMipsOpcode MipsOpcodes[] = {
// |--000--|--001--|--010--|--011--|--100--|--101--|--110--|--111--| lo
// 000 | --- | TLBR | TLBWI | --- | --- | --- | TLBWR | --- | 00..07
// 001 | TLBP | --- | --- | --- | --- | --- | --- | --- | 08..0F
// 010 | --- | --- | --- | --- | --- | --- | --- | --- | 10..17
// 010 | RFE | --- | --- | --- | --- | --- | --- | --- | 10..17
// 011 | ERET | --- | --- | --- | --- | --- | --- | --- | 18..1F
// 100 | --- | --- | --- | --- | --- | --- | --- | --- | 20..27
// 101 | --- | --- | --- | --- | --- | --- | --- | --- | 28..2F
@@ -341,9 +341,9 @@ bool MipsParser::parseRspVectorRegister(Parser& parser, MipsRegisterValue& dest)
return parseRegisterTable(parser,dest,mipsRspVectorRegisters,ARRAY_SIZE(mipsRspVectorRegisters));
}

bool MipsParser::parseRspBroadcastElement(Parser& parser, MipsRegisterValue& dest)
bool MipsParser::parseRspVectorElement(Parser& parser, MipsRegisterValue& dest)
{
dest.type = MipsRegisterType::RspBroadcastElement;
dest.type = MipsRegisterType::RspVectorElement;

if (parser.peekToken().type == TokenType::LBrack)
{
@@ -407,7 +407,7 @@ bool MipsParser::parseRspScalarElement(Parser& parser, MipsRegisterValue& dest)
return false;

dest.name = formatString(L"%d", token.intValue);
dest.num = token.intValue;
dest.num = token.intValue + 8;

return parser.nextToken().type == TokenType::RBrack;
}
@@ -1364,16 +1364,16 @@ bool MipsParser::parseParameters(Parser& parser, const tMipsOpcode& opcode)
case 's': // vector register
CHECK(parseRspVectorRegister(parser,registers.rspvrs));
break;
case 'e': // vector broadcast element
CHECK(parseRspBroadcastElement(parser,registers.rspve));
case 'e': // vector element
CHECK(parseRspVectorElement(parser,registers.rspve));
break;
case 'l': // vector scalar element
case 'l': // scalar element
CHECK(parseRspScalarElement(parser,registers.rspve));
break;
case 'm': // vector scalar destination element
case 'm': // scalar destination element
CHECK(parseRspScalarElement(parser,registers.rspvde));
break;
case 'o': // vector byte offset element
case 'o': // byte offset element
CHECK(parseRspOffsetElement(parser,registers.rspvealt));
break;
default:
@@ -29,7 +29,7 @@ class MipsParser
bool parseRspCop0Register(Parser& parser, MipsRegisterValue& dest);
bool parseRspVectorControlRegister(Parser& parser, MipsRegisterValue& dest);
bool parseRspVectorRegister(Parser& parser, MipsRegisterValue& dest);
bool parseRspBroadcastElement(Parser& parser, MipsRegisterValue& dest);
bool parseRspVectorElement(Parser& parser, MipsRegisterValue& dest);
bool parseRspScalarElement(Parser& parser, MipsRegisterValue& dest);
bool parseRspOffsetElement(Parser& parser, MipsRegisterValue& dest);
bool parseVfpuRegister(Parser& parser, MipsRegisterValue& reg, int size);
BIN +0 Bytes (100%) Tests/RSP Opcodes/expected.bin
Binary file not shown.

0 comments on commit 7aa5cba

Please sign in to comment.
You can’t perform that action at this time.