Trying again to fix compares.

This commit is contained in:
Ben Vanik 2013-05-24 20:40:00 -07:00
parent e7556a09f8
commit 346a27ddf8
1 changed files with 9 additions and 8 deletions

View File

@ -1232,7 +1232,7 @@ void X64Emitter::update_xer_with_carry(GpVar& value) {
GpVar xer(c.newGpVar());
c.mov(xer, xer_value());
c.and_(xer, imm(0xDFFFFFFF)); // clear bit 29
c.mov(value.r8(), value.r8());
c.and_(value, imm(0xF));
c.shl(value, imm(29));
c.or_(xer, value);
update_xer_value(xer);
@ -1348,7 +1348,8 @@ void X64Emitter::update_cr_value(uint32_t n, GpVar& value) {
GpVar cr_tmp(c.newGpVar());
c.mov(cr_tmp, qword_ptr(c.getGpArg(0), offsetof(xe_ppc_state_t, cr)));
GpVar cr_n(c.newGpVar());
c.mov(cr_n, value.r8());
c.mov(cr_n, value);
c.and_(cr_n, imm(0xF));
if (n) {
c.shl(cr_n, imm(n * 4));
}
@ -1376,9 +1377,9 @@ void X64Emitter::update_cr_with_cond(uint32_t n, GpVar& lhs) {
GpVar v(c.newGpVar());
c.shl(v_g, imm(1));
c.shl(v_e, imm(2));
c.mov(v.r8(), v_l.r8());
c.or_(v.r8(), v_g.r8());
c.or_(v.r8(), v_e.r8());
c.mov(v, v_l.r8());
c.or_(v, v_g.r8());
c.or_(v, v_e.r8());
// TODO(benvanik): set bit 4 to XER[SO]
// c.seto?
@ -1405,9 +1406,9 @@ void X64Emitter::update_cr_with_cond(uint32_t n, GpVar& lhs, GpVar& rhs) {
GpVar v(c.newGpVar());
c.shl(v_g, imm(1));
c.shl(v_e, imm(2));
c.mov(v.r8(), v_l.r8());
c.or_(v.r8(), v_g.r8());
c.or_(v.r8(), v_e.r8());
c.mov(v, v_l.r8());
c.or_(v, v_g.r8());
c.or_(v, v_e.r8());
// TODO(benvanik): set bit 4 to XER[SO]
// c.seto?