From ec501a32c66fcb083da2cff591c93c7d780779b7 Mon Sep 17 00:00:00 2001 From: DrChat Date: Wed, 14 Feb 2018 22:05:54 -0600 Subject: [PATCH] [JIT] Apply the same ZeroExtend/Truncate to rlwimix and rlwnmx --- src/xenia/cpu/ppc/ppc_emit_alu.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/ppc/ppc_emit_alu.cc b/src/xenia/cpu/ppc/ppc_emit_alu.cc index 9dbe68286..72780974f 100644 --- a/src/xenia/cpu/ppc/ppc_emit_alu.cc +++ b/src/xenia/cpu/ppc/ppc_emit_alu.cc @@ -960,7 +960,7 @@ int InstrEmit_rlwimix(PPCHIRBuilder& f, const InstrData& i) { // RA <- r&m | (RA)&¬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)); if (i.M.SH) { v = f.RotateLeft(v, f.LoadConstantInt8(i.M.SH)); } @@ -1018,7 +1018,7 @@ int InstrEmit_rlwnmx(PPCHIRBuilder& f, const InstrData& i) { f.And(f.Truncate(f.LoadGPR(i.M.SH), INT8_TYPE), f.LoadConstantInt8(0x1F)); 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)); v = f.RotateLeft(v, sh); v = f.And(v, f.LoadConstantUint64(XEMASK(i.M.MB + 32, i.M.ME + 32))); f.StoreGPR(i.M.RA, v);