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