Better nop handling.

This commit is contained in:
Ben Vanik 2013-12-08 13:17:50 -08:00
parent 50f53a483e
commit 28ff739449
2 changed files with 10 additions and 5 deletions

View File

@ -425,14 +425,15 @@ XEDISASMR(orcx, 0x7C000338, X )(InstrData& i, InstrDisasm& d) {
XEDISASMR(ori, 0x60000000, D )(InstrData& i, InstrDisasm& d) {
if (!i.D.RA && !i.D.RT && !i.D.DS) {
d.Init("no-op", "OR Immediate", 0);
d.Init("nop", "OR Immediate", 0);
return d.Finish();
} else {
d.Init("ori", "OR Immediate", 0);
}
d.AddRegOperand(InstrRegister::kGPR, i.D.RA, InstrRegister::kWrite);
d.AddRegOperand(InstrRegister::kGPR, i.D.RT, InstrRegister::kRead);
d.AddUImmOperand(i.D.DS, 2);
return d.Finish();
}
}
XEDISASMR(oris, 0x64000000, D )(InstrData& i, InstrDisasm& d) {

View File

@ -800,6 +800,10 @@ XEEMITTER(orcx, 0x7C000338, X )(PPCFunctionBuilder& f, InstrData& i) {
XEEMITTER(ori, 0x60000000, D )(PPCFunctionBuilder& f, InstrData& i) {
// RA <- (RS) | (i48.0 || UI)
if (!i.D.RA && !i.D.RT && !i.D.DS) {
f.Nop();
return 0;
}
Value* ra = f.Or(
f.LoadGPR(i.D.RT),
f.LoadConstant((uint64_t)i.D.DS));