| 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 #include "src/compilation-info.h" | 6 #include "src/compilation-info.h" |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
| (...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2378 break; | 2378 break; |
| 2379 } | 2379 } |
| 2380 case Constant::kRpoNumber: | 2380 case Constant::kRpoNumber: |
| 2381 UNREACHABLE(); // TODO(titzer): loading RPO numbers on mips64. | 2381 UNREACHABLE(); // TODO(titzer): loading RPO numbers on mips64. |
| 2382 break; | 2382 break; |
| 2383 } | 2383 } |
| 2384 if (destination->IsStackSlot()) __ sd(dst, g.ToMemOperand(destination)); | 2384 if (destination->IsStackSlot()) __ sd(dst, g.ToMemOperand(destination)); |
| 2385 } else if (src.type() == Constant::kFloat32) { | 2385 } else if (src.type() == Constant::kFloat32) { |
| 2386 if (destination->IsFPStackSlot()) { | 2386 if (destination->IsFPStackSlot()) { |
| 2387 MemOperand dst = g.ToMemOperand(destination); | 2387 MemOperand dst = g.ToMemOperand(destination); |
| 2388 __ li(at, Operand(bit_cast<int32_t>(src.ToFloat32()))); | 2388 if (bit_cast<int32_t>(src.ToFloat32()) == 0) { |
| 2389 __ sw(at, dst); | 2389 __ sw(zero_reg, dst); |
| 2390 } else { |
| 2391 __ li(at, Operand(bit_cast<int32_t>(src.ToFloat32()))); |
| 2392 __ sw(at, dst); |
| 2393 } |
| 2390 } else { | 2394 } else { |
| 2395 DCHECK(destination->IsFPRegister()); |
| 2391 FloatRegister dst = g.ToSingleRegister(destination); | 2396 FloatRegister dst = g.ToSingleRegister(destination); |
| 2392 __ Move(dst, src.ToFloat32()); | 2397 __ Move(dst, src.ToFloat32()); |
| 2393 } | 2398 } |
| 2394 } else { | 2399 } else { |
| 2395 DCHECK_EQ(Constant::kFloat64, src.type()); | 2400 DCHECK_EQ(Constant::kFloat64, src.type()); |
| 2396 DoubleRegister dst = destination->IsFPRegister() | 2401 DoubleRegister dst = destination->IsFPRegister() |
| 2397 ? g.ToDoubleRegister(destination) | 2402 ? g.ToDoubleRegister(destination) |
| 2398 : kScratchDoubleReg; | 2403 : kScratchDoubleReg; |
| 2399 __ Move(dst, src.ToFloat64()); | 2404 __ Move(dst, src.ToFloat64()); |
| 2400 if (destination->IsFPStackSlot()) { | 2405 if (destination->IsFPStackSlot()) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 padding_size -= v8::internal::Assembler::kInstrSize; | 2524 padding_size -= v8::internal::Assembler::kInstrSize; |
| 2520 } | 2525 } |
| 2521 } | 2526 } |
| 2522 } | 2527 } |
| 2523 | 2528 |
| 2524 #undef __ | 2529 #undef __ |
| 2525 | 2530 |
| 2526 } // namespace compiler | 2531 } // namespace compiler |
| 2527 } // namespace internal | 2532 } // namespace internal |
| 2528 } // namespace v8 | 2533 } // namespace v8 |
| OLD | NEW |