[turbofan][x64] Use leaq for Int64Mul if possiable

Change-Id: Ic81be39ed0666c708f9129bef1e75268afc7faf1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3807123
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#82374}
This commit is contained in:
jiepan 2022-08-03 18:33:10 +08:00 committed by V8 LUCI CQ
parent 68c158ab20
commit e9c1884e81

View File

@ -1453,6 +1453,14 @@ void InstructionSelector::VisitInt32MulWithOverflow(Node* node) {
}
void InstructionSelector::VisitInt64Mul(Node* node) {
Int64ScaleMatcher m(node, true);
if (m.matches()) {
Node* index = node->InputAt(0);
Node* base = m.power_of_two_plus_one() ? index : nullptr;
EmitLea(this, kX64Lea, node, index, m.scale(), base, nullptr,
kPositiveDisplacement);
return;
}
VisitMul(this, node, kX64Imul);
}