Commit 6c389cef authored by sreten.kovacevic's avatar sreten.kovacevic Committed by Commit bot

MIPS64: Port `[turbofan] ARM64: Faster checked ops for PoT arrays`

Port 95f210d5

Original commit message:
Improve CheckedLoad and Store bounds checking for arrays with power of two
length.

BUG=

Review-Url: https://codereview.chromium.org/2632213002
Cr-Commit-Position: refs/heads/master@{#42414}
parent f12661a1
......@@ -1854,6 +1854,15 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
: g.UseRegister(length)
: g.UseRegister(length);
if (length->opcode() == IrOpcode::kInt32Constant) {
Int32Matcher m(length);
if (m.IsPowerOf2()) {
Emit(opcode, g.DefineAsRegister(node), offset_operand,
g.UseImmediate(length), g.UseRegister(buffer));
return;
}
}
Emit(opcode | AddressingModeField::encode(kMode_MRI),
g.DefineAsRegister(node), offset_operand, length_operand,
g.UseRegister(buffer));
......@@ -1906,6 +1915,15 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
: g.UseRegister(length)
: g.UseRegister(length);
if (length->opcode() == IrOpcode::kInt32Constant) {
Int32Matcher m(length);
if (m.IsPowerOf2()) {
Emit(opcode, g.NoOutput(), offset_operand, g.UseImmediate(length),
g.UseRegisterOrImmediateZero(value), g.UseRegister(buffer));
return;
}
}
Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
offset_operand, length_operand, g.UseRegisterOrImmediateZero(value),
g.UseRegister(buffer));
......
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