Fixing disasm of subfic, fixing neg->not, fixing tests to use 8bits.
This commit is contained in:
parent
6320ef6b7e
commit
ef3bd6cc53
|
@ -232,9 +232,9 @@ XEDISASMR(subfcx, 0x7C000010, XO )(InstrData& i, InstrDisasm& d) {
|
||||||
|
|
||||||
XEDISASMR(subficx, 0x20000000, D )(InstrData& i, InstrDisasm& d) {
|
XEDISASMR(subficx, 0x20000000, D )(InstrData& i, InstrDisasm& d) {
|
||||||
d.Init("subfic", "Subtract From Immediate Carrying", InstrDisasm::kCA);
|
d.Init("subfic", "Subtract From Immediate Carrying", InstrDisasm::kCA);
|
||||||
d.AddRegOperand(InstrRegister::kGPR, i.XO.RT, InstrRegister::kWrite);
|
d.AddRegOperand(InstrRegister::kGPR, i.D.RT, InstrRegister::kWrite);
|
||||||
d.AddRegOperand(InstrRegister::kGPR, i.XO.RA, InstrRegister::kRead);
|
d.AddRegOperand(InstrRegister::kGPR, i.D.RA, InstrRegister::kRead);
|
||||||
d.AddRegOperand(InstrRegister::kGPR, i.XO.RB, InstrRegister::kRead);
|
d.AddSImmOperand(XEEXTS16(i.D.DS), 2);
|
||||||
return d.Finish();
|
return d.Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ XEEMITTER(subfx, 0x7C000050, XO )(X64Emitter& e, X86Compiler& c, InstrDat
|
||||||
|
|
||||||
GpVar v(c.newGpVar());
|
GpVar v(c.newGpVar());
|
||||||
c.mov(v, e.gpr_value(i.XO.RA));
|
c.mov(v, e.gpr_value(i.XO.RA));
|
||||||
c.neg(v);
|
c.not_(v);
|
||||||
c.stc(); // Always carrying.
|
c.stc(); // Always carrying.
|
||||||
c.adc(v, e.gpr_value(i.XO.RB));
|
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());
|
GpVar v(c.newGpVar());
|
||||||
c.mov(v, e.gpr_value(i.D.RA));
|
c.mov(v, e.gpr_value(i.D.RA));
|
||||||
c.neg(v);
|
c.not_(v);
|
||||||
c.stc(); // Always carrying.
|
c.stc(); // Always carrying.
|
||||||
c.adc(v, imm(XEEXTS16(i.D.DS)));
|
c.adc(v, imm(XEEXTS16(i.D.DS)));
|
||||||
GpVar cc(c.newGpVar());
|
GpVar cc(c.newGpVar());
|
||||||
|
@ -425,7 +425,7 @@ XEEMITTER(subfex, 0x7C000110, XO )(X64Emitter& e, X86Compiler& c, InstrDat
|
||||||
|
|
||||||
GpVar v(c.newGpVar());
|
GpVar v(c.newGpVar());
|
||||||
c.mov(v, e.gpr_value(i.XO.RA));
|
c.mov(v, e.gpr_value(i.XO.RA));
|
||||||
c.neg(v);
|
c.not_(v);
|
||||||
|
|
||||||
// Add in carry flag from XER, only if needed.
|
// Add in carry flag from XER, only if needed.
|
||||||
// It may be possible to do this much more efficiently.
|
// 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());
|
GpVar v(c.newGpVar());
|
||||||
c.mov(v, e.gpr_value(i.X.RB));
|
c.mov(v, e.gpr_value(i.X.RB));
|
||||||
c.neg(v);
|
c.not_(v);
|
||||||
c.and_(v, e.gpr_value(i.X.RT));
|
c.and_(v, e.gpr_value(i.X.RT));
|
||||||
e.update_gpr_value(i.X.RA, v);
|
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());
|
GpVar v(c.newGpVar());
|
||||||
c.mov(v, e.gpr_value(i.X.RT));
|
c.mov(v, e.gpr_value(i.X.RT));
|
||||||
c.or_(v, e.gpr_value(i.X.RB));
|
c.or_(v, e.gpr_value(i.X.RB));
|
||||||
c.neg(v);
|
c.not_(v);
|
||||||
e.update_gpr_value(i.X.RA, v);
|
e.update_gpr_value(i.X.RA, v);
|
||||||
|
|
||||||
if (i.X.Rc) {
|
if (i.X.Rc) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ int XeEmitBranchTo(
|
||||||
if (condition) {
|
if (condition) {
|
||||||
// Fast test -- if condition passed then jump to target.
|
// Fast test -- if condition passed then jump to target.
|
||||||
// TODO(benvanik): need to spill here? somehow?
|
// TODO(benvanik): need to spill here? somehow?
|
||||||
c.test(*condition, *condition);
|
c.test((*condition).r8(), (*condition).r8());
|
||||||
c.jnz(target_label);
|
c.jnz(target_label);
|
||||||
} else {
|
} else {
|
||||||
// TODO(benvanik): need to spill here?
|
// TODO(benvanik): need to spill here?
|
||||||
|
@ -95,7 +95,7 @@ int XeEmitBranchTo(
|
||||||
if (condition) {
|
if (condition) {
|
||||||
// TODO(benvanik): add debug info for this?
|
// TODO(benvanik): add debug info for this?
|
||||||
post_jump_label = c.newLabel();
|
post_jump_label = c.newLabel();
|
||||||
c.test(*condition, *condition);
|
c.test((*condition).r8(), (*condition).r8());
|
||||||
// TODO(benvanik): experiment with various hints?
|
// TODO(benvanik): experiment with various hints?
|
||||||
c.jz(post_jump_label, kCondHintNone);
|
c.jz(post_jump_label, kCondHintNone);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue