From 8306be77b08ddde6717e1e1817fa45068aa8d5b0 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sun, 27 Oct 2013 18:43:43 -0700 Subject: [PATCH] Fixed constant tracking through mr. --- src/xenia/cpu/x64/x64_emit_alu.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/xenia/cpu/x64/x64_emit_alu.cc b/src/xenia/cpu/x64/x64_emit_alu.cc index 87f8d8f15..1c9fc63ea 100644 --- a/src/xenia/cpu/x64/x64_emit_alu.cc +++ b/src/xenia/cpu/x64/x64_emit_alu.cc @@ -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; }