x86jit: Optimize loads of 0 into fp regs.

This commit is contained in:
Unknown W. Brackets committed 2014-11-08 18:41:16 -08:00
1 parent 7d8858687e
commit 27d8108bb2
2 files changed
+12 -4

No files matched your search

+6 -2
View File
@@ -384,9 +384,13 @@ void Jit::Comp_mxc1(MIPSOpcode op) {
return;
case 4: //FI(fs) = R(rt); break; //mtc1
gpr.KillImmediate(rt, true, false);
fpr.MapReg(fs, false, true);
MOVD_xmm(fpr.RX(fs), gpr.R(rt));
if (gpr.IsImm(rt) && gpr.GetImm(rt) == 0) {
XORPS(fpr.RX(fs), fpr.R(fs));
} else {
gpr.KillImmediate(rt, true, false);
MOVD_xmm(fpr.RX(fs), gpr.R(rt));
}
return;
case 6: //currentMIPS->WriteFCR(fs, R(rt)); break; //ctc1
+6 -2
View File
@@ -1848,8 +1848,12 @@ void Jit::Comp_Mftv(MIPSOpcode op) {
if (imm < 128) { // VI(imm) = R(rt);
fpr.MapRegV(imm, MAP_DIRTY | MAP_NOINIT);
// Let's not bother mapping rt if we don't have to.
gpr.KillImmediate(rt, true, false);
MOVD_xmm(fpr.VX(imm), gpr.R(rt));
if (gpr.IsImm(rt) && gpr.GetImm(rt) == 0) {
XORPS(fpr.VX(imm), fpr.V(imm));
} else {
gpr.KillImmediate(rt, true, false);
MOVD_xmm(fpr.VX(imm), gpr.R(rt));
}
} else if (imm < 128 + VFPU_CTRL_MAX) { //mtvc //currentMIPS->vfpuCtrl[imm - 128] = R(rt);
if (imm - 128 == VFPU_CTRL_CC) {
if (gpr.IsImm(rt)) {