diff --git a/src/xenia/cpu/frontend/ppc_emit_alu.cc b/src/xenia/cpu/frontend/ppc_emit_alu.cc index 9ac7f9a52..3be51eeae 100644 --- a/src/xenia/cpu/frontend/ppc_emit_alu.cc +++ b/src/xenia/cpu/frontend/ppc_emit_alu.cc @@ -176,6 +176,7 @@ XEEMITTER(addzex, 0x7C000194, XO)(PPCHIRBuilder& f, InstrData& i) { // With XER[SO] update too. // e.update_xer_with_overflow_and_carry(b.CreateExtractValue(v, 1)); assert_always(); + return 1; } else { // Just CA update. f.StoreCA(AddWithCarryDidCarry(f, ra, f.LoadZeroInt64(), f.LoadCA())); @@ -713,8 +714,7 @@ XEEMITTER(cntlzwx, 0x7C000034, X)(PPCHIRBuilder& f, InstrData& i) { XEEMITTER(eqvx, 0x7C000238, X)(PPCHIRBuilder& f, InstrData& i) { // RA <- (RS) == (RB) - Value* ra = f.Xor(f.LoadGPR(i.X.RT), f.LoadGPR(i.X.RB)); - ra = f.Not(ra); + Value* ra = f.Not(f.Xor(f.LoadGPR(i.X.RT), f.LoadGPR(i.X.RB))); f.StoreGPR(i.X.RA, ra); if (i.X.Rc) { f.UpdateCR(0, ra); diff --git a/src/xenia/cpu/frontend/ppc_emit_memory.cc b/src/xenia/cpu/frontend/ppc_emit_memory.cc index bbf4e099a..ee9ec2462 100644 --- a/src/xenia/cpu/frontend/ppc_emit_memory.cc +++ b/src/xenia/cpu/frontend/ppc_emit_memory.cc @@ -22,62 +22,28 @@ using namespace xe::cpu::hir; using xe::cpu::hir::Value; -#define TRUNCATE_ADDRESSES 0 - Value* CalculateEA(PPCHIRBuilder& f, uint32_t ra, uint32_t rb) { -#if TRUNCATE_ADDRESSES - return f.ZeroExtend(f.Add(f.Truncate(f.LoadGPR(ra), INT32_TYPE), - f.Truncate(f.LoadGPR(rb), INT32_TYPE)), - INT64_TYPE); -#else return f.Add(f.LoadGPR(ra), f.LoadGPR(rb)); -#endif // TRUNCATE_ADDRESSES } Value* CalculateEA_0(PPCHIRBuilder& f, uint32_t ra, uint32_t rb) { -#if TRUNCATE_ADDRESSES - if (ra) { - return f.ZeroExtend(f.Add(f.Truncate(f.LoadGPR(ra), INT32_TYPE), - f.Truncate(f.LoadGPR(rb), INT32_TYPE)), - INT64_TYPE); - } else { - return f.ZeroExtend(f.Truncate(f.LoadGPR(rb), INT32_TYPE), INT64_TYPE); - } -#else if (ra) { return f.Add(f.LoadGPR(ra), f.LoadGPR(rb)); } else { return f.LoadGPR(rb); } -#endif // TRUNCATE_ADDRESSES } Value* CalculateEA_i(PPCHIRBuilder& f, uint32_t ra, uint64_t imm) { -#if TRUNCATE_ADDRESSES - return f.ZeroExtend(f.Add(f.Truncate(f.LoadGPR(ra), INT32_TYPE), - f.LoadConstant((int32_t)imm)), - INT64_TYPE); -#else return f.Add(f.LoadGPR(ra), f.LoadConstantUint64(imm)); -#endif // TRUNCATE_ADDRESSES } Value* CalculateEA_0_i(PPCHIRBuilder& f, uint32_t ra, uint64_t imm) { -#if TRUNCATE_ADDRESSES - if (ra) { - return f.ZeroExtend(f.Add(f.Truncate(f.LoadGPR(ra), INT32_TYPE), - f.LoadConstant((int32_t)imm)), - INT64_TYPE); - } else { - return f.ZeroExtend(f.LoadConstant((int32_t)imm), INT64_TYPE); - } -#else if (ra) { return f.Add(f.LoadGPR(ra), f.LoadConstantUint64(imm)); } else { return f.LoadConstantUint64(imm); } -#endif // TRUNCATE_ADDRESSES } void StoreEA(PPCHIRBuilder& f, uint32_t rt, Value* ea) { @@ -483,7 +449,6 @@ XEEMITTER(stwux, 0x7C00016E, X)(PPCHIRBuilder& f, InstrData& i) { // RA <- EA Value* ea = CalculateEA(f, i.X.RA, i.X.RB); f.Store(ea, f.ByteSwap(f.Truncate(f.LoadGPR(i.X.RT), INT32_TYPE))); - f.StoreGPR(i.X.RA, f.ZeroExtend(f.Truncate(ea, INT32_TYPE), INT64_TYPE)); StoreEA(f, i.X.RA, ea); return 0; }