Removing some dead code.

This commit is contained in:
Ben Vanik 2015-12-14 20:49:50 -08:00
parent 826ea60890
commit 5e6c1f5a50
2 changed files with 2 additions and 37 deletions

View File

@ -176,6 +176,7 @@ XEEMITTER(addzex, 0x7C000194, XO)(PPCHIRBuilder& f, InstrData& i) {
// With XER[SO] update too. // With XER[SO] update too.
// e.update_xer_with_overflow_and_carry(b.CreateExtractValue(v, 1)); // e.update_xer_with_overflow_and_carry(b.CreateExtractValue(v, 1));
assert_always(); assert_always();
return 1;
} else { } else {
// Just CA update. // Just CA update.
f.StoreCA(AddWithCarryDidCarry(f, ra, f.LoadZeroInt64(), f.LoadCA())); 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) { XEEMITTER(eqvx, 0x7C000238, X)(PPCHIRBuilder& f, InstrData& i) {
// RA <- (RS) == (RB) // RA <- (RS) == (RB)
Value* ra = f.Xor(f.LoadGPR(i.X.RT), f.LoadGPR(i.X.RB)); Value* ra = f.Not(f.Xor(f.LoadGPR(i.X.RT), f.LoadGPR(i.X.RB)));
ra = f.Not(ra);
f.StoreGPR(i.X.RA, ra); f.StoreGPR(i.X.RA, ra);
if (i.X.Rc) { if (i.X.Rc) {
f.UpdateCR(0, ra); f.UpdateCR(0, ra);

View File

@ -22,62 +22,28 @@ using namespace xe::cpu::hir;
using xe::cpu::hir::Value; using xe::cpu::hir::Value;
#define TRUNCATE_ADDRESSES 0
Value* CalculateEA(PPCHIRBuilder& f, uint32_t ra, uint32_t rb) { 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)); return f.Add(f.LoadGPR(ra), f.LoadGPR(rb));
#endif // TRUNCATE_ADDRESSES
} }
Value* CalculateEA_0(PPCHIRBuilder& f, uint32_t ra, uint32_t rb) { 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) { if (ra) {
return f.Add(f.LoadGPR(ra), f.LoadGPR(rb)); return f.Add(f.LoadGPR(ra), f.LoadGPR(rb));
} else { } else {
return f.LoadGPR(rb); return f.LoadGPR(rb);
} }
#endif // TRUNCATE_ADDRESSES
} }
Value* CalculateEA_i(PPCHIRBuilder& f, uint32_t ra, uint64_t imm) { 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)); return f.Add(f.LoadGPR(ra), f.LoadConstantUint64(imm));
#endif // TRUNCATE_ADDRESSES
} }
Value* CalculateEA_0_i(PPCHIRBuilder& f, uint32_t ra, uint64_t imm) { 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) { if (ra) {
return f.Add(f.LoadGPR(ra), f.LoadConstantUint64(imm)); return f.Add(f.LoadGPR(ra), f.LoadConstantUint64(imm));
} else { } else {
return f.LoadConstantUint64(imm); return f.LoadConstantUint64(imm);
} }
#endif // TRUNCATE_ADDRESSES
} }
void StoreEA(PPCHIRBuilder& f, uint32_t rt, Value* ea) { void StoreEA(PPCHIRBuilder& f, uint32_t rt, Value* ea) {
@ -483,7 +449,6 @@ XEEMITTER(stwux, 0x7C00016E, X)(PPCHIRBuilder& f, InstrData& i) {
// RA <- EA // RA <- EA
Value* ea = CalculateEA(f, i.X.RA, i.X.RB); 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.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); StoreEA(f, i.X.RA, ea);
return 0; return 0;
} }