X87: Turbofan: Modify WASM linkage to store floats using only 4 bytes.

port 817b59c8ad (r36654)

  original commit message:
  Adds instructions for ARM to push floats.

BUG=

Review-Url: https://codereview.chromium.org/2036773004
Cr-Commit-Position: refs/heads/master@{#36704}
This commit is contained in:
zhengxing.li 2016-06-03 02:49:29 -07:00 committed by Commit bot
parent f2da19fe39
commit 486f8dd899

View File

@ -1664,27 +1664,29 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
if (instr->InputAt(0)->IsFPRegister()) {
auto allocated = AllocatedOperand::cast(*instr->InputAt(0));
if (allocated.representation() == MachineRepresentation::kFloat32) {
__ sub(esp, Immediate(kDoubleSize));
__ sub(esp, Immediate(kFloatSize));
__ fst_s(Operand(esp, 0));
frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
} else {
DCHECK(allocated.representation() == MachineRepresentation::kFloat64);
__ sub(esp, Immediate(kDoubleSize));
__ fst_d(Operand(esp, 0));
}
frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
}
} else if (instr->InputAt(0)->IsFPStackSlot()) {
auto allocated = AllocatedOperand::cast(*instr->InputAt(0));
if (allocated.representation() == MachineRepresentation::kFloat32) {
__ sub(esp, Immediate(kDoubleSize));
__ sub(esp, Immediate(kFloatSize));
__ fld_s(i.InputOperand(0));
__ fstp_s(MemOperand(esp, 0));
frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize);
} else {
DCHECK(allocated.representation() == MachineRepresentation::kFloat64);
__ sub(esp, Immediate(kDoubleSize));
__ fld_d(i.InputOperand(0));
__ fstp_d(MemOperand(esp, 0));
}
frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
}
} else if (HasImmediateInput(instr, 0)) {
__ push(i.InputImmediate(0));
frame_access_state()->IncreaseSPDelta(1);