Commit 220b4a3b authored by Liu Yu's avatar Liu Yu Committed by Commit Bot

[mips32][wasm-simd] Support returning Simd128 on caller's stack

Port: 360c9294

Change-Id: I9a0d0dd3d70ad6dd5aa94aa2d8f200111a9f5c3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2570828Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71588}
parent bef5c470
...@@ -1677,17 +1677,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1677,17 +1677,18 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} }
break; break;
case kMipsPeek: { case kMipsPeek: {
// The incoming value is 0-based, but we need a 1-based value. int reverse_slot = i.InputInt32(0);
int reverse_slot = i.InputInt32(0) + 1;
int offset = int offset =
FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot); FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot);
if (instr->OutputAt(0)->IsFPRegister()) { if (instr->OutputAt(0)->IsFPRegister()) {
LocationOperand* op = LocationOperand::cast(instr->OutputAt(0)); LocationOperand* op = LocationOperand::cast(instr->OutputAt(0));
if (op->representation() == MachineRepresentation::kFloat64) { if (op->representation() == MachineRepresentation::kFloat64) {
__ Ldc1(i.OutputDoubleRegister(), MemOperand(fp, offset)); __ Ldc1(i.OutputDoubleRegister(), MemOperand(fp, offset));
} else { } else if (op->representation() == MachineRepresentation::kFloat32) {
DCHECK_EQ(op->representation(), MachineRepresentation::kFloat32);
__ lwc1(i.OutputSingleRegister(0), MemOperand(fp, offset)); __ lwc1(i.OutputSingleRegister(0), MemOperand(fp, offset));
} else {
DCHECK_EQ(op->representation(), MachineRepresentation::kSimd128);
__ ld_b(i.OutputSimd128Register(), MemOperand(fp, offset));
} }
} else { } else {
__ lw(i.OutputRegister(0), MemOperand(fp, offset)); __ lw(i.OutputRegister(0), MemOperand(fp, offset));
......
...@@ -1382,6 +1382,8 @@ void InstructionSelector::EmitPrepareResults( ...@@ -1382,6 +1382,8 @@ void InstructionSelector::EmitPrepareResults(
MarkAsFloat32(output.node); MarkAsFloat32(output.node);
} else if (output.location.GetType() == MachineType::Float64()) { } else if (output.location.GetType() == MachineType::Float64()) {
MarkAsFloat64(output.node); MarkAsFloat64(output.node);
} else if (output.location.GetType() == MachineType::Simd128()) {
MarkAsSimd128(output.node);
} }
int offset = call_descriptor->GetOffsetToReturns(); int offset = call_descriptor->GetOffsetToReturns();
int reverse_slot = -output.location.GetLocation() - offset; int reverse_slot = -output.location.GetLocation() - offset;
......
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