Fixing disasm of subfic, fixing neg->not, fixing tests to use 8bits.

This commit is contained in:
Ben Vanik 2013-05-24 23:03:35 -07:00
parent 6320ef6b7e
commit ef3bd6cc53
3 changed files with 10 additions and 10 deletions

View File

@ -232,9 +232,9 @@ XEDISASMR(subfcx, 0x7C000010, XO )(InstrData& i, InstrDisasm& d) {
XEDISASMR(subficx, 0x20000000, D )(InstrData& i, InstrDisasm& d) {
d.Init("subfic", "Subtract From Immediate Carrying", InstrDisasm::kCA);
d.AddRegOperand(InstrRegister::kGPR, i.XO.RT, InstrRegister::kWrite);
d.AddRegOperand(InstrRegister::kGPR, i.XO.RA, InstrRegister::kRead);
d.AddRegOperand(InstrRegister::kGPR, i.XO.RB, InstrRegister::kRead);
d.AddRegOperand(InstrRegister::kGPR, i.D.RT, InstrRegister::kWrite);
d.AddRegOperand(InstrRegister::kGPR, i.D.RA, InstrRegister::kRead);
d.AddSImmOperand(XEEXTS16(i.D.DS), 2);
return d.Finish();
}

View File

@ -378,7 +378,7 @@ XEEMITTER(subfx, 0x7C000050, XO )(X64Emitter& e, X86Compiler& c, InstrDat
GpVar v(c.newGpVar());
c.mov(v, e.gpr_value(i.XO.RA));
c.neg(v);
c.not_(v);
c.stc(); // Always carrying.
c.adc(v, e.gpr_value(i.XO.RB));
@ -408,7 +408,7 @@ XEEMITTER(subficx, 0x20000000, D )(X64Emitter& e, X86Compiler& c, InstrDat
GpVar v(c.newGpVar());
c.mov(v, e.gpr_value(i.D.RA));
c.neg(v);
c.not_(v);
c.stc(); // Always carrying.
c.adc(v, imm(XEEXTS16(i.D.DS)));
GpVar cc(c.newGpVar());
@ -425,7 +425,7 @@ XEEMITTER(subfex, 0x7C000110, XO )(X64Emitter& e, X86Compiler& c, InstrDat
GpVar v(c.newGpVar());
c.mov(v, e.gpr_value(i.XO.RA));
c.neg(v);
c.not_(v);
// Add in carry flag from XER, only if needed.
// It may be possible to do this much more efficiently.
@ -619,7 +619,7 @@ XEEMITTER(andcx, 0x7C000078, X )(X64Emitter& e, X86Compiler& c, InstrDat
GpVar v(c.newGpVar());
c.mov(v, e.gpr_value(i.X.RB));
c.neg(v);
c.not_(v);
c.and_(v, e.gpr_value(i.X.RT));
e.update_gpr_value(i.X.RA, v);
@ -740,7 +740,7 @@ XEEMITTER(norx, 0x7C0000F8, X )(X64Emitter& e, X86Compiler& c, InstrDat
GpVar v(c.newGpVar());
c.mov(v, e.gpr_value(i.X.RT));
c.or_(v, e.gpr_value(i.X.RB));
c.neg(v);
c.not_(v);
e.update_gpr_value(i.X.RA, v);
if (i.X.Rc) {

View File

@ -80,7 +80,7 @@ int XeEmitBranchTo(
if (condition) {
// Fast test -- if condition passed then jump to target.
// TODO(benvanik): need to spill here? somehow?
c.test(*condition, *condition);
c.test((*condition).r8(), (*condition).r8());
c.jnz(target_label);
} else {
// TODO(benvanik): need to spill here?
@ -95,7 +95,7 @@ int XeEmitBranchTo(
if (condition) {
// TODO(benvanik): add debug info for this?
post_jump_label = c.newLabel();
c.test(*condition, *condition);
c.test((*condition).r8(), (*condition).r8());
// TODO(benvanik): experiment with various hints?
c.jz(post_jump_label, kCondHintNone);
}