Commit 0a4f5297 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC: fix smi compare in DoBoundsCheck

CmplSmiLiteral should be used to compare smi

R=joransiu@ca.ibm.com, jyan@ca.ibm.com
BUG=

Review-Url: https://codereview.chromium.org/2614663009
Cr-Commit-Position: refs/heads/master@{#42108}
parent 2bbcedb5
......@@ -4022,7 +4022,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
int32_t length = ToInteger32(LConstantOperand::cast(instr->length()));
Register index = ToRegister(instr->index());
if (representation.IsSmi()) {
__ Cmpli(index, Operand(Smi::FromInt(length)), r0);
__ CmplSmiLiteral(index, Smi::FromInt(length), r0);
} else {
__ Cmplwi(index, Operand(length), r0);
}
......@@ -4031,7 +4031,7 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
int32_t index = ToInteger32(LConstantOperand::cast(instr->index()));
Register length = ToRegister(instr->length());
if (representation.IsSmi()) {
__ Cmpli(length, Operand(Smi::FromInt(index)), r0);
__ CmplSmiLiteral(length, Smi::FromInt(index), r0);
} else {
__ Cmplwi(length, Operand(index), r0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment