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.
// 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);

View File

@ -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;
}