From 02b5a07bc9e2df713a42198ab09506669977454d Mon Sep 17 00:00:00 2001 From: DrChat Date: Wed, 14 Feb 2018 13:50:57 -0600 Subject: [PATCH] [JIT] rlwinmx: Use Truncate/ZeroExtend instead of And 0xFFFFFFFF --- src/xenia/cpu/ppc/ppc_emit_alu.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xenia/cpu/ppc/ppc_emit_alu.cc b/src/xenia/cpu/ppc/ppc_emit_alu.cc index 265fb1267..9dbe68286 100644 --- a/src/xenia/cpu/ppc/ppc_emit_alu.cc +++ b/src/xenia/cpu/ppc/ppc_emit_alu.cc @@ -984,8 +984,10 @@ int InstrEmit_rlwinmx(PPCHIRBuilder& f, const InstrData& i) { // m <- MASK(MB+32, ME+32) // RA <- r & m Value* v = f.LoadGPR(i.M.RT); + // (x||x) - v = f.Or(f.Shl(v, 32), f.And(v, f.LoadConstantUint64(0xFFFFFFFF))); + v = f.Or(f.Shl(v, 32), f.ZeroExtend(f.Truncate(v, INT32_TYPE), INT64_TYPE)); + // TODO(benvanik): optimize srwi // TODO(benvanik): optimize slwi // The compiler will generate a bunch of these for the special case of SH=0.