Merge pull request #792 from LegendOfDragoon/master

Improve Vector Dest Analysis
This commit is contained in:
zilmar 2015-12-01 16:05:23 +11:00
commit 184aec553e
1 changed files with 23 additions and 4 deletions

View File

@ -648,14 +648,17 @@ BOOL WriteToVectorDest2 (DWORD DestReg, int PC, BOOL RecursiveCall) {
case RSP_LSC2_RV:
break;
case RSP_LSC2_HV:
case RSP_LSC2_QV:
case RSP_LSC2_BV:
case RSP_LSC2_LV:
case RSP_LSC2_UV:
case RSP_LSC2_PV:
case RSP_LSC2_TV:
break;
case RSP_LSC2_PV:
case RSP_LSC2_UV:
case RSP_LSC2_HV:
if (DestReg == RspOp.rt) { return FALSE; }
break;
default:
CompilerWarning("Unkown opcode in WriteToVectorDest\n%s",RSPOpcodeName(RspOp.Hex,PC));
@ -675,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;