Commit 1fe4c1e7 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Fix "[turbofan] Support unboxed float and double stack parameters."

R=titzer@chromium.org, jyan@ca.ibm.com, dstence@us.ibm.com, joransiu@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#30395}
parent 1607c9d1
......@@ -981,7 +981,13 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
break;
case kPPC_PushFrame: {
int num_slots = i.InputInt32(1);
__ StorePU(i.InputRegister(0), MemOperand(sp, -num_slots * kPointerSize));
if (instr->InputAt(0)->IsDoubleRegister()) {
__ stfdu(i.InputDoubleRegister(0),
MemOperand(sp, -num_slots * kPointerSize));
} else {
__ StorePU(i.InputRegister(0),
MemOperand(sp, -num_slots * kPointerSize));
}
break;
}
case kPPC_StoreToStackSlot: {
......@@ -1338,6 +1344,8 @@ void CodeGenerator::AssemblePrologue() {
__ StubPrologue();
frame()->SetRegisterSaveAreaSize(
StandardFrameConstants::kFixedFrameSizeFromFp);
} else {
frame()->SetPCOnStack(false);
}
if (info()->is_osr()) {
......@@ -1384,6 +1392,7 @@ void CodeGenerator::AssembleReturn() {
const RegList saves = descriptor->CalleeSavedRegisters() & ~frame_saves;
__ MultiPop(saves);
}
__ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
} else if (descriptor->IsJSFunctionCall() || needs_frame_) {
// Canonicalize JSFunction return sites for now.
if (return_label_.is_bound()) {
......@@ -1391,9 +1400,11 @@ void CodeGenerator::AssembleReturn() {
return;
} else {
__ bind(&return_label_);
__ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
}
} else {
__ Drop(pop_count);
}
__ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
__ Ret();
}
......
......@@ -1477,15 +1477,17 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
int num_slots = static_cast<int>(descriptor->StackParameterCount());
int slot = 0;
for (Node* input : buffer.pushed_nodes) {
// Skip any alignment holes in pushed nodes.
if (input == nullptr) continue;
if (slot == 0) {
DCHECK(input);
Emit(kPPC_PushFrame, g.NoOutput(), g.UseRegister(input),
g.TempImmediate(num_slots));
} else {
// Skip any alignment holes in pushed nodes.
if (input) {
Emit(kPPC_StoreToStackSlot, g.NoOutput(), g.UseRegister(input),
g.TempImmediate(slot));
}
}
++slot;
}
}
......@@ -1580,9 +1582,17 @@ void InstructionSelector::VisitTailCall(Node* node) {
InitializeCallBuffer(node, &buffer, true, false);
// Push any stack arguments.
for (Node* input : base::Reversed(buffer.pushed_nodes)) {
if (input == nullptr) continue;
Emit(kPPC_Push, g.NoOutput(), g.UseRegister(input));
int num_slots = static_cast<int>(descriptor->StackParameterCount());
int slot = 0;
for (Node* input : buffer.pushed_nodes) {
if (slot == 0) {
Emit(kPPC_PushFrame, g.NoOutput(), g.UseRegister(input),
g.TempImmediate(num_slots));
} else {
Emit(kPPC_StoreToStackSlot, g.NoOutput(), g.UseRegister(input),
g.TempImmediate(slot));
}
++slot;
}
// Select the appropriate opcode based on the call type.
......
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