OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compilation-info.h" | 7 #include "src/compilation-info.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2339 UNREACHABLE(); // TODO(dcarney): loading RPO constants on PPC. | 2339 UNREACHABLE(); // TODO(dcarney): loading RPO constants on PPC. |
2340 break; | 2340 break; |
2341 } | 2341 } |
2342 if (destination->IsStackSlot()) { | 2342 if (destination->IsStackSlot()) { |
2343 __ StoreP(dst, g.ToMemOperand(destination), r0); | 2343 __ StoreP(dst, g.ToMemOperand(destination), r0); |
2344 } | 2344 } |
2345 } else { | 2345 } else { |
2346 DoubleRegister dst = destination->IsFPRegister() | 2346 DoubleRegister dst = destination->IsFPRegister() |
2347 ? g.ToDoubleRegister(destination) | 2347 ? g.ToDoubleRegister(destination) |
2348 : kScratchDoubleReg; | 2348 : kScratchDoubleReg; |
2349 double value = (src.type() == Constant::kFloat32) ? src.ToFloat32() | 2349 double value; |
2350 : src.ToFloat64(); | 2350 // bit_cast of snan is converted to qnan on ia32/x64 |
| 2351 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 |
| 2352 intptr_t valueInt = (src.type() == Constant::kFloat32) |
| 2353 ? src.ToFloat32AsInt() |
| 2354 : src.ToFloat64AsInt(); |
| 2355 if (valueInt == ((src.type() == Constant::kFloat32) |
| 2356 ? 0x7fa00000 |
| 2357 : 0x7fa0000000000000)) { |
| 2358 value = bit_cast<double, int64_t>(0x7ff4000000000000L); |
| 2359 } else { |
| 2360 #endif |
| 2361 value = (src.type() == Constant::kFloat32) ? src.ToFloat32() |
| 2362 : src.ToFloat64(); |
| 2363 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 |
| 2364 } |
| 2365 #endif |
2351 __ LoadDoubleLiteral(dst, value, kScratchReg); | 2366 __ LoadDoubleLiteral(dst, value, kScratchReg); |
2352 if (destination->IsFPStackSlot()) { | 2367 if (destination->IsFPStackSlot()) { |
2353 __ StoreDouble(dst, g.ToMemOperand(destination), r0); | 2368 __ StoreDouble(dst, g.ToMemOperand(destination), r0); |
2354 } | 2369 } |
2355 } | 2370 } |
2356 } else if (source->IsFPRegister()) { | 2371 } else if (source->IsFPRegister()) { |
2357 DoubleRegister src = g.ToDoubleRegister(source); | 2372 DoubleRegister src = g.ToDoubleRegister(source); |
2358 if (destination->IsFPRegister()) { | 2373 if (destination->IsFPRegister()) { |
2359 DoubleRegister dst = g.ToDoubleRegister(destination); | 2374 DoubleRegister dst = g.ToDoubleRegister(destination); |
2360 __ Move(dst, src); | 2375 __ Move(dst, src); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 padding_size -= v8::internal::Assembler::kInstrSize; | 2505 padding_size -= v8::internal::Assembler::kInstrSize; |
2491 } | 2506 } |
2492 } | 2507 } |
2493 } | 2508 } |
2494 | 2509 |
2495 #undef __ | 2510 #undef __ |
2496 | 2511 |
2497 } // namespace compiler | 2512 } // namespace compiler |
2498 } // namespace internal | 2513 } // namespace internal |
2499 } // namespace v8 | 2514 } // namespace v8 |
OLD | NEW |