Commit 66f2d7b6 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [wasm] Fix I32ReinterpretF32 and I64ReinterpretF64 on ia32.

  port ea925431 (r42545)

  original commit message:
  On ia32 return statements in C++ automatically convert signalling NaNs
  to quiet NaNs, even when bit_cast is used. This CL removes all uses of
  bit_cast<float> and bit_cast<double> in the wasm compiler and wasm
  interpreter.

BUG=

Review-Url: https://codereview.chromium.org/2648203002
Cr-Commit-Position: refs/heads/master@{#42588}
parent 8b5d1aa6
......@@ -2562,7 +2562,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ Move(dst, g.ToImmediate(source));
} else if (src_constant.type() == Constant::kFloat32) {
// TODO(turbofan): Can we do better here?
uint32_t src = bit_cast<uint32_t>(src_constant.ToFloat32());
uint32_t src = src_constant.ToFloat32AsInt();
if (destination->IsFPRegister()) {
__ sub(esp, Immediate(kInt32Size));
__ mov(MemOperand(esp, 0), Immediate(src));
......@@ -2577,7 +2577,7 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
}
} else {
DCHECK_EQ(Constant::kFloat64, src_constant.type());
uint64_t src = bit_cast<uint64_t>(src_constant.ToFloat64());
uint64_t src = src_constant.ToFloat64AsInt();
uint32_t lower = static_cast<uint32_t>(src);
uint32_t upper = static_cast<uint32_t>(src >> 32);
if (destination->IsFPRegister()) {
......
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