Fix issue with STV in Vector Dest Analysis

STV can write to multiple registers, so it needs to do extra checking to
determine whether or not the destination register is used.
This commit is contained in:
LegendOfDragoon 2015-11-30 20:40:01 -08:00
parent b2f73ecb93
commit 36d491c989
1 changed files with 17 additions and 1 deletions

View File

@ -678,9 +678,25 @@ BOOL WriteToVectorDest2 (DWORD DestReg, int PC, BOOL RecursiveCall) {
case RSP_LSC2_HV:
case RSP_LSC2_FV:
case RSP_LSC2_WV:
case RSP_LSC2_TV:
if (DestReg == RspOp.rt) { return TRUE; }
break;
case RSP_LSC2_TV:
if (8 <= 32 - RspOp.rt) {
if (DestReg >= RspOp.rt && DestReg <= RspOp.rt + 7) {
return TRUE;
}
} else {
int length = 32 - RspOp.rt, count, del = RspOp.del >> 1, vect = RspOp.rt;
for (count = 0; count < length; count++) {
if (DestReg == vect + del) {
return TRUE;
}
del = (del + 1) & 7;
}
}
break;
default:
CompilerWarning("Unkown opcode in WriteToVectorDest\n%s",RSPOpcodeName(RspOp.Hex,PC));
return TRUE;