Commit 017c5183 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

[x86] Fix register constraints for multiply high and modulus.

R=jarin@chromium.org
TEST=mjsunit/compiler/regress-register-allocator2

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

Cr-Commit-Position: refs/heads/master@{#25054}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25054 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2d07d762
......@@ -648,10 +648,9 @@ void InstructionSelector::VisitInt32Mul(Node* node) {
void InstructionSelector::VisitInt32MulHigh(Node* node) {
IA32OperandGenerator g(this);
InstructionOperand* temps[] = {g.TempRegister(eax)};
Emit(kIA32ImulHigh, g.DefineAsFixed(node, edx),
g.UseFixed(node->InputAt(0), eax), g.UseUniqueRegister(node->InputAt(1)),
arraysize(temps), temps);
g.UseFixed(node->InputAt(0), eax),
g.UseUniqueRegister(node->InputAt(1)));
}
......@@ -679,11 +678,9 @@ void InstructionSelector::VisitUint32Div(Node* node) {
static inline void VisitMod(InstructionSelector* selector, Node* node,
ArchOpcode opcode) {
IA32OperandGenerator g(selector);
InstructionOperand* temps[] = {g.TempRegister(eax), g.TempRegister(edx)};
size_t temp_count = arraysize(temps);
selector->Emit(opcode, g.DefineAsFixed(node, edx),
g.UseFixed(node->InputAt(0), eax),
g.UseUnique(node->InputAt(1)), temp_count, temps);
g.UseUnique(node->InputAt(1)));
}
......
......@@ -420,10 +420,9 @@ void InstructionSelector::VisitInt64Mul(Node* node) {
void InstructionSelector::VisitInt32MulHigh(Node* node) {
X64OperandGenerator g(this);
InstructionOperand* temps[] = {g.TempRegister(rax)};
Emit(kX64ImulHigh32, g.DefineAsFixed(node, rdx),
g.UseFixed(node->InputAt(0), rax), g.UseUniqueRegister(node->InputAt(1)),
arraysize(temps), temps);
g.UseFixed(node->InputAt(0), rax),
g.UseUniqueRegister(node->InputAt(1)));
}
......@@ -460,10 +459,9 @@ void InstructionSelector::VisitUint64Div(Node* node) {
static void VisitMod(InstructionSelector* selector, Node* node,
ArchOpcode opcode) {
X64OperandGenerator g(selector);
InstructionOperand* temps[] = {g.TempRegister(rax), g.TempRegister(rdx)};
selector->Emit(
opcode, g.DefineAsFixed(node, rdx), g.UseFixed(node->InputAt(0), rax),
g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
selector->Emit(opcode, g.DefineAsFixed(node, rdx),
g.UseFixed(node->InputAt(0), rax),
g.UseUniqueRegister(node->InputAt(1)));
}
......
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function f() {
var x = 0;
var y = 0;
x ^= undefined;
assertEquals(x /= 1);
assertEquals(NaN, y %= 1);
assertEquals(y = 1);
f();
y = -2;
assertEquals(x >>= 1);
assertEquals(0, ((y+(y+(y+((y^(x%5))+y)))+(y+y))>>y)+y);
}
try { f(); } catch (e) {}
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