[arm][turbofan] Pass the slot index for the peek instruction by operand

This is the implementation of crrev.com/c/866721 for arm.

Drive-by change: I simplified the slot index calculation.

Original description:

At the moment the slot index is encoded in the opcode. This, however,
sets an upper limit the slot index which is lower than what we want to
have (i.e. < 512). With this change we pass the slot index as an
immediate operand, which does not impose limits on the value it
contains.

R=v8-arm-ports@googlegroups.com

Change-Id: Ic448872aa1da63f421d569ab5ec9160f36e6652b
Reviewed-on: https://chromium-review.googlesource.com/866745
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50607}
This commit is contained in:
Andreas Haas 2018-01-15 16:48:38 +01:00 committed by Commit Bot
parent 1d48b7bf4f
commit 0c28bfb054
3 changed files with 6 additions and 9 deletions

View File

@ -1612,7 +1612,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmPeek: {
int reverse_slot = MiscField::decode(instr->opcode());
// The incoming value is 0-based, but we need a 1-based value.
int reverse_slot = i.InputInt32(0) + 1;
int offset =
FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
if (instr->OutputAt(0)->IsFPRegister()) {

View File

@ -1537,7 +1537,6 @@ void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
int reverse_slot = 0;
for (PushParameter output : *results) {
if (!output.location.IsCallerFrameSlot()) continue;
++reverse_slot;
// Skip any alignment holes in nodes.
if (output.node != nullptr) {
DCHECK(!descriptor->IsCFunctionCall());
@ -1546,13 +1545,10 @@ void InstructionSelector::EmitPrepareResults(ZoneVector<PushParameter>* results,
} else if (output.location.GetType() == MachineType::Float64()) {
MarkAsFloat64(output.node);
}
InstructionOperand result = g.DefineAsRegister(output.node);
Emit(kArmPeek | MiscField::encode(reverse_slot), result);
}
if (output.location.GetType() == MachineType::Float64()) {
// Float64 require an implicit second slot.
++reverse_slot;
Emit(kArmPeek, g.DefineAsRegister(output.node),
g.UseImmediate(reverse_slot));
}
reverse_slot += output.location.GetSizeInPointers();
}
}

View File

@ -173,7 +173,7 @@
'test-multiple-return/*': [SKIP],
}],
# TODO(ahaas): Port multiple return values to ARM, MIPS, S390 and PPC
['arch == arm or arch == ia32 or arch == mips or arch == mips64 or arch == mipsel or arch == mips64el or arch == s390 or arch == s390x or arch == ppc or arch == ppc64', {
['arch == ia32 or arch == mips or arch == mips64 or arch == mipsel or arch == mips64el or arch == s390 or arch == s390x or arch == ppc or arch == ppc64', {
'test-multiple-return/ReturnLastValue*': [SKIP],
}],
##############################################################################