Fixed constant tracking through mr.

This commit is contained in:
gibbed 2013-10-27 18:43:43 -07:00
parent 2de906f3d6
commit 8306be77b0
1 changed files with 9 additions and 1 deletions

View File

@ -1228,7 +1228,13 @@ XEEMITTER(orx, 0x7C000378, X )(X64Emitter& e, X86Compiler& c, InstrDat
// RA <- (RS) | (RB)
GpVar v(c.newGpVar());
bool is_constant = false;
if (i.X.RT == i.X.RB) {
uint64_t dummy;
if (e.get_constant_gpr_value(i.X.RT, &dummy)) {
e.set_constant_gpr_value(i.X.RA, dummy);
is_constant = true;
}
c.mov(v, e.gpr_value(i.X.RT));
} else {
c.mov(v, e.gpr_value(i.X.RT));
@ -1241,7 +1247,9 @@ XEEMITTER(orx, 0x7C000378, X )(X64Emitter& e, X86Compiler& c, InstrDat
e.update_cr_with_cond(0, v);
}
e.clear_constant_gpr_value(i.X.RA);
if (is_constant == false) {
e.clear_constant_gpr_value(i.X.RA);
}
return 0;
}