Optimize ADDIU in RSP Recompiler

The second part happens in Hydro Thunder LLE audio.
This commit is contained in:
LegendOfDragoon 2015-09-07 12:18:28 -07:00
parent 2ff2165bd9
commit 48fcced3bc
1 changed files with 6 additions and 2 deletions

View File

@ -472,12 +472,16 @@ void Compile_ADDIU ( void ) {
if (RSPOpC.rt == 0) return;
if (RSPOpC.rt == RSPOpC.rs) {
AddConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
if(Immediate != 0) {
AddConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
}
} else if (RSPOpC.rs == 0) {
MoveConstToVariable(Immediate, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
} else {
MoveVariableToX86reg(&RSP_GPR[RSPOpC.rs].UW, GPR_Name(RSPOpC.rs), x86_EAX);
AddConstToX86Reg(x86_EAX, Immediate);
if(Immediate != 0) {
AddConstToX86Reg(x86_EAX, Immediate);
}
MoveX86regToVariable(x86_EAX, &RSP_GPR[RSPOpC.rt].UW, GPR_Name(RSPOpC.rt));
}
}