Fixing rlwimix.

This commit is contained in:
Ben Vanik 2013-05-25 17:08:31 -07:00
parent bd8376e231
commit ce27fb333b
1 changed files with 6 additions and 2 deletions

View File

@ -903,15 +903,19 @@ XEEMITTER(rlwimix, 0x50000000, M )(X64Emitter& e, X86Compiler& c, InstrDat
// m <- MASK(MB+32, ME+32) // m <- MASK(MB+32, ME+32)
// RA <- r&m | (RA)&¬m // RA <- r&m | (RA)&¬m
c.int3();
GpVar v(c.newGpVar()); GpVar v(c.newGpVar());
c.mov(v.r32(), e.gpr_value(i.M.RT).r32()); // truncate c.mov(v.r32(), e.gpr_value(i.M.RT).r32()); // truncate
c.rol(v.r32(), imm(i.M.SH)); c.rol(v.r32(), imm(i.M.SH));
uint64_t m = XEMASK(i.M.MB + 32, i.M.ME + 32); uint64_t m = XEMASK(i.M.MB + 32, i.M.ME + 32);
c.and_(v, imm(m)); GpVar mask(c.newGpVar());
c.mov(mask, imm(m));
c.and_(v, mask);
GpVar old_ra(c.newGpVar()); GpVar old_ra(c.newGpVar());
c.mov(old_ra, e.gpr_value(i.M.RA)); c.mov(old_ra, e.gpr_value(i.M.RA));
c.and_(old_ra, imm(~m)); c.not_(mask);
c.and_(old_ra, mask);
c.or_(v, old_ra); c.or_(v, old_ra);
e.update_gpr_value(i.M.RA, v); e.update_gpr_value(i.M.RA, v);