Eliminate unnecessary shifts

This commit is contained in:
Jeff Parsons 2015-01-20 22:23:45 -08:00 committed by jeffpar
commit 06dfd59ad6
2 changed files with 57 additions and 57 deletions

View file

@ -285,7 +285,7 @@ function genSIB(sib) {
print(" */");
print(" function " + sFunc + "(mod) {");
var sBase = (base == 5? "(mod? this.reg" + aBase[base] + " : this.getIPWord())" : "this.reg" + aBase[base]);
if (index != 4) sBase += " + (this.reg" + (aIndex[index] + " << " + scale) + ")";
if (index != 4) sBase += " + " + (scale? ("(this.reg" + aIndex[index] + " << " + scale + ")") : ("this.reg" + aIndex[index]));
print(" return " + sBase + ";");
print(" }" + (sib < 255? "," : ""));
}