Commit 1bb5d012 authored by Deepti Gandluri's avatar Deepti Gandluri Committed by Commit Bot

[arm64] Cleanup visitors for Atomic operations

Change-Id: I4e32786d7c100161daf3d245d887dfe19b164394
Reviewed-on: https://chromium-review.googlesource.com/1013046Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52600}
parent b40cc63e
...@@ -2108,17 +2108,13 @@ void VisitAtomicExchange(InstructionSelector* selector, Node* node, ...@@ -2108,17 +2108,13 @@ void VisitAtomicExchange(InstructionSelector* selector, Node* node,
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
Node* value = node->InputAt(2); Node* value = node->InputAt(2);
InstructionOperand inputs[3]; InstructionOperand inputs[] = {g.UseRegister(base), g.UseRegister(index),
size_t input_count = 0; g.UseUniqueRegister(value)};
inputs[input_count++] = g.UseRegister(base); InstructionOperand outputs[] = {g.DefineAsRegister(node)};
inputs[input_count++] = g.UseRegister(index);
inputs[input_count++] = g.UseUniqueRegister(value);
InstructionOperand outputs[1];
outputs[0] = g.DefineAsRegister(node);
InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()}; InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
InstructionCode code = opcode | AddressingModeField::encode(kMode_MRR); InstructionCode code = opcode | AddressingModeField::encode(kMode_MRR);
selector->Emit(code, 1, outputs, input_count, inputs, arraysize(temps), selector->Emit(code, arraysize(outputs), outputs, arraysize(inputs), inputs,
temps); arraysize(temps), temps);
} }
void VisitAtomicCompareExchange(InstructionSelector* selector, Node* node, void VisitAtomicCompareExchange(InstructionSelector* selector, Node* node,
...@@ -2128,18 +2124,14 @@ void VisitAtomicCompareExchange(InstructionSelector* selector, Node* node, ...@@ -2128,18 +2124,14 @@ void VisitAtomicCompareExchange(InstructionSelector* selector, Node* node,
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
Node* old_value = node->InputAt(2); Node* old_value = node->InputAt(2);
Node* new_value = node->InputAt(3); Node* new_value = node->InputAt(3);
InstructionOperand inputs[4]; InstructionOperand inputs[] = {g.UseRegister(base), g.UseRegister(index),
size_t input_count = 0; g.UseUniqueRegister(old_value),
inputs[input_count++] = g.UseRegister(base); g.UseUniqueRegister(new_value)};
inputs[input_count++] = g.UseRegister(index); InstructionOperand outputs[] = {g.DefineAsRegister(node)};
inputs[input_count++] = g.UseUniqueRegister(old_value);
inputs[input_count++] = g.UseUniqueRegister(new_value);
InstructionOperand outputs[1];
outputs[0] = g.DefineAsRegister(node);
InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()}; InstructionOperand temps[] = {g.TempRegister(), g.TempRegister()};
InstructionCode code = opcode | AddressingModeField::encode(kMode_MRR); InstructionCode code = opcode | AddressingModeField::encode(kMode_MRR);
selector->Emit(code, 1, outputs, input_count, inputs, arraysize(temps), selector->Emit(code, arraysize(outputs), outputs, arraysize(inputs), inputs,
temps); arraysize(temps), temps);
} }
void VisitAtomicLoad(InstructionSelector* selector, Node* node, void VisitAtomicLoad(InstructionSelector* selector, Node* node,
...@@ -2161,14 +2153,11 @@ void VisitAtomicStore(InstructionSelector* selector, Node* node, ...@@ -2161,14 +2153,11 @@ void VisitAtomicStore(InstructionSelector* selector, Node* node,
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
Node* value = node->InputAt(2); Node* value = node->InputAt(2);
InstructionOperand inputs[3]; InstructionOperand inputs[] = {g.UseRegister(base), g.UseRegister(index),
size_t input_count = 0; g.UseUniqueRegister(value)};
inputs[input_count++] = g.UseRegister(base);
inputs[input_count++] = g.UseRegister(index);
inputs[input_count++] = g.UseUniqueRegister(value);
InstructionCode code = opcode | AddressingModeField::encode(kMode_MRR);
InstructionOperand temps[] = {g.TempRegister()}; InstructionOperand temps[] = {g.TempRegister()};
selector->Emit(code, 0, nullptr, input_count, inputs, arraysize(temps), InstructionCode code = opcode | AddressingModeField::encode(kMode_MRR);
selector->Emit(code, 0, nullptr, arraysize(inputs), inputs, arraysize(temps),
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