Commit a685180d authored by mtrofin's avatar mtrofin Committed by Commit bot

[turbofan] Fixing IMulHigh, which has a temp.

On Intel, imul clobbers {r|e}ax.  We're missing that in the representation
of the MulHigh intermediate instructions. Fixing, by adding it as a temp,
akin VisitDiv does.

Review URL: https://codereview.chromium.org/1631973003

Cr-Commit-Position: refs/heads/master@{#33535}
parent 8c663eea
...@@ -508,9 +508,10 @@ namespace { ...@@ -508,9 +508,10 @@ namespace {
void VisitMulHigh(InstructionSelector* selector, Node* node, void VisitMulHigh(InstructionSelector* selector, Node* node,
ArchOpcode opcode) { ArchOpcode opcode) {
IA32OperandGenerator g(selector); IA32OperandGenerator g(selector);
selector->Emit(opcode, g.DefineAsFixed(node, edx), InstructionOperand temps[] = {g.TempRegister(eax)};
g.UseFixed(node->InputAt(0), eax), selector->Emit(
g.UseUniqueRegister(node->InputAt(1))); opcode, g.DefineAsFixed(node, edx), g.UseFixed(node->InputAt(0), eax),
g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
} }
......
...@@ -734,10 +734,11 @@ void VisitMulHigh(InstructionSelector* selector, Node* node, ...@@ -734,10 +734,11 @@ void VisitMulHigh(InstructionSelector* selector, Node* node,
if (selector->IsLive(left) && !selector->IsLive(right)) { if (selector->IsLive(left) && !selector->IsLive(right)) {
std::swap(left, right); std::swap(left, right);
} }
InstructionOperand temps[] = {g.TempRegister(rax)};
// TODO(turbofan): We use UseUniqueRegister here to improve register // TODO(turbofan): We use UseUniqueRegister here to improve register
// allocation. // allocation.
selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax), selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax),
g.UseUniqueRegister(right)); g.UseUniqueRegister(right), arraysize(temps), temps);
} }
......
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