Commit 1107aa8b authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [turbofan]: Micro optimizations to lea[l/q] on ia32/x64.

  port 87ae05c7 (r40341)

  original commit message:
  Utilize all opportunities to turn leas into adds.

BUG=

Review-Url: https://codereview.chromium.org/2429763002
Cr-Commit-Position: refs/heads/master@{#40386}
parent 179436cf
......@@ -1870,7 +1870,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
if (i.InputRegister(1).is(i.OutputRegister())) {
__ shl(i.OutputRegister(), 1);
} else {
__ lea(i.OutputRegister(), i.MemoryOperand());
__ add(i.OutputRegister(), i.InputRegister(1));
}
} else if (mode == kMode_M2) {
__ shl(i.OutputRegister(), 1);
......@@ -1881,6 +1881,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} else {
__ lea(i.OutputRegister(), i.MemoryOperand());
}
} else if (mode == kMode_MR1 &&
i.InputRegister(1).is(i.OutputRegister())) {
__ add(i.OutputRegister(), i.InputRegister(0));
} else {
__ lea(i.OutputRegister(), i.MemoryOperand());
}
......
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