Commit a21725c5 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

[X87] [wasm] Fix one V8 x87 code generation bug in TurboFan compiler.

  The CL #37448 (https://codereview.chromium.org/2105313002) exposed one hidden bug in x87 turbofan compiler's code generation.

  This CL fixed that bugs.

BUG=

Review-Url: https://codereview.chromium.org/2117003002
Cr-Commit-Position: refs/heads/master@{#37494}
parent 9fdacb9e
......@@ -1499,12 +1499,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ TruncateX87TOSToI(i.OutputRegister(0));
__ test(i.OutputRegister(0), i.OutputRegister(0));
__ j(positive, &success);
// Need to reserve the input float32 data.
__ fld(0);
__ push(Immediate(INT32_MIN));
__ fild_s(Operand(esp, 0));
__ lea(esp, Operand(esp, kPointerSize));
__ faddp();
__ TruncateX87TOSToI(i.OutputRegister(0));
__ or_(i.OutputRegister(0), Immediate(0x80000000));
// Only keep input float32 data in x87 stack when return.
__ fstp(0);
__ bind(&success);
if (!instr->InputAt(0)->IsFPRegister()) {
__ fstp(0);
......
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