Chromium Code Reviews| Index: src/compiler/ppc/code-generator-ppc.cc |
| diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc |
| index 28ff242f66b36f01fb23559509aaf24c2072c7d8..886319c7c48191b8ba9fac1018ff14e1ca3d2201 100644 |
| --- a/src/compiler/ppc/code-generator-ppc.cc |
| +++ b/src/compiler/ppc/code-generator-ppc.cc |
| @@ -2346,8 +2346,23 @@ void CodeGenerator::AssembleMove(InstructionOperand* source, |
| DoubleRegister dst = destination->IsFPRegister() |
| ? g.ToDoubleRegister(destination) |
| : kScratchDoubleReg; |
| - double value = (src.type() == Constant::kFloat32) ? src.ToFloat32() |
| - : src.ToFloat64(); |
| + double value; |
| +// bit_cast of snan is converted to qnan on ia32/x64 |
| +#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 |
| + intptr_t valueInt = (src.type() == Constant::kFloat32) |
| + ? src.ToFloat32AsInt() |
| + : src.ToFloat64AsInt(); |
| + if (valueInt == ((src.type() == Constant::kFloat32) |
| + ? 2141192192 |
|
john.yan
2017/01/30 18:20:09
using hex seems more readable.
|
| + : 9196350439090552832)) { |
| + value = bit_cast<double, int64_t>(0x7ff4000000000000L); |
| + } else { |
| +#endif |
| + value = (src.type() == Constant::kFloat32) ? src.ToFloat32() |
| + : src.ToFloat64(); |
| +#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 |
| + } |
| +#endif |
| __ LoadDoubleLiteral(dst, value, kScratchReg); |
| if (destination->IsFPStackSlot()) { |
| __ StoreDouble(dst, g.ToMemOperand(destination), r0); |