Commit 6ad9bc2f authored by baptiste.afsa's avatar baptiste.afsa Committed by Commit bot

[turbofan][arm64] Use immediates instead of MiscField for stack operations.

This avoid to depend on MiscField to be big enough to hold the offset/size.
This patch also remove the Arm64PokePair which is no longer used.

R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27505}
parent 073009e3
...@@ -610,24 +610,16 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { ...@@ -610,24 +610,16 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
// Pseudo instruction turned into cbz/cbnz in AssembleArchBranch. // Pseudo instruction turned into cbz/cbnz in AssembleArchBranch.
break; break;
case kArm64Claim: { case kArm64Claim: {
int words = MiscField::decode(instr->opcode()); __ Claim(i.InputInt32(0));
__ Claim(words);
break; break;
} }
case kArm64Poke: { case kArm64Poke: {
int slot = MiscField::decode(instr->opcode()); Operand operand(i.InputInt32(1) * kPointerSize);
Operand operand(slot * kPointerSize);
__ Poke(i.InputRegister(0), operand); __ Poke(i.InputRegister(0), operand);
break; break;
} }
case kArm64PokePairZero: {
// TODO(dcarney): test slot offset and register order.
int slot = MiscField::decode(instr->opcode()) - 1;
__ PokePair(i.InputRegister(0), xzr, slot * kPointerSize);
break;
}
case kArm64PokePair: { case kArm64PokePair: {
int slot = MiscField::decode(instr->opcode()) - 1; int slot = i.InputInt32(2) - 1;
__ PokePair(i.InputRegister(1), i.InputRegister(0), slot * kPointerSize); __ PokePair(i.InputRegister(1), i.InputRegister(0), slot * kPointerSize);
break; break;
} }
......
...@@ -77,7 +77,6 @@ namespace compiler { ...@@ -77,7 +77,6 @@ namespace compiler {
V(Arm64CompareAndBranch32) \ V(Arm64CompareAndBranch32) \
V(Arm64Claim) \ V(Arm64Claim) \
V(Arm64Poke) \ V(Arm64Poke) \
V(Arm64PokePairZero) \
V(Arm64PokePair) \ V(Arm64PokePair) \
V(Arm64Float64Cmp) \ V(Arm64Float64Cmp) \
V(Arm64Float64Add) \ V(Arm64Float64Add) \
......
...@@ -1168,7 +1168,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { ...@@ -1168,7 +1168,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
if (aligned_push_count > 0) { if (aligned_push_count > 0) {
// TODO(dcarney): it would be better to bump the csp here only // TODO(dcarney): it would be better to bump the csp here only
// and emit paired stores with increment for non c frames. // and emit paired stores with increment for non c frames.
Emit(kArm64Claim | MiscField::encode(aligned_push_count), g.NoOutput()); Emit(kArm64Claim, g.NoOutput(), g.TempImmediate(aligned_push_count));
} }
// Move arguments to the stack. // Move arguments to the stack.
{ {
...@@ -1176,15 +1176,16 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { ...@@ -1176,15 +1176,16 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
// Emit the uneven pushes. // Emit the uneven pushes.
if (pushed_count_uneven) { if (pushed_count_uneven) {
Node* input = buffer.pushed_nodes[slot]; Node* input = buffer.pushed_nodes[slot];
Emit(kArm64Poke | MiscField::encode(slot), g.NoOutput(), Emit(kArm64Poke, g.NoOutput(), g.UseRegister(input),
g.UseRegister(input)); g.TempImmediate(slot));
slot--; slot--;
} }
// Now all pushes can be done in pairs. // Now all pushes can be done in pairs.
for (; slot >= 0; slot -= 2) { for (; slot >= 0; slot -= 2) {
Emit(kArm64PokePair | MiscField::encode(slot), g.NoOutput(), Emit(kArm64PokePair, g.NoOutput(),
g.UseRegister(buffer.pushed_nodes[slot]), g.UseRegister(buffer.pushed_nodes[slot]),
g.UseRegister(buffer.pushed_nodes[slot - 1])); g.UseRegister(buffer.pushed_nodes[slot - 1]),
g.TempImmediate(slot));
} }
} }
......
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