[JIT] rlwinmx: Use Truncate/ZeroExtend instead of And 0xFFFFFFFF

This commit is contained in:
DrChat 2018-02-14 13:50:57 -06:00
parent bbafcc089d
commit 02b5a07bc9
1 changed files with 3 additions and 1 deletions

View File

@ -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.