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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 VisitRR(this, kMipsCvtDW, node); | 480 VisitRR(this, kMipsCvtDW, node); |
481 } | 481 } |
482 | 482 |
483 | 483 |
484 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { | 484 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { |
485 VisitRR(this, kMipsCvtDUw, node); | 485 VisitRR(this, kMipsCvtDUw, node); |
486 } | 486 } |
487 | 487 |
488 | 488 |
489 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { | 489 void InstructionSelector::VisitChangeFloat64ToInt32(Node* node) { |
| 490 MipsOperandGenerator g(this); |
| 491 Node* value = node->InputAt(0); |
| 492 // Match ChangeFloat64ToInt32(Float64Round##OP) to corresponding instruction |
| 493 // which does rounding and conversion to integer format. |
| 494 if (CanCover(node, value)) { |
| 495 switch (value->opcode()) { |
| 496 case IrOpcode::kFloat64RoundDown: |
| 497 Emit(kMipsFloorWD, g.DefineAsRegister(node), |
| 498 g.UseRegister(value->InputAt(0))); |
| 499 return; |
| 500 case IrOpcode::kFloat64RoundUp: |
| 501 Emit(kMipsCeilWD, g.DefineAsRegister(node), |
| 502 g.UseRegister(value->InputAt(0))); |
| 503 return; |
| 504 case IrOpcode::kFloat64RoundTiesEven: |
| 505 Emit(kMipsRoundWD, g.DefineAsRegister(node), |
| 506 g.UseRegister(value->InputAt(0))); |
| 507 return; |
| 508 case IrOpcode::kFloat64RoundTruncate: |
| 509 Emit(kMipsTruncWD, g.DefineAsRegister(node), |
| 510 g.UseRegister(value->InputAt(0))); |
| 511 return; |
| 512 default: |
| 513 VisitRR(this, kMipsTruncWD, node); |
| 514 return; |
| 515 } |
| 516 } |
490 VisitRR(this, kMipsTruncWD, node); | 517 VisitRR(this, kMipsTruncWD, node); |
491 } | 518 } |
492 | 519 |
493 | 520 |
494 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { | 521 void InstructionSelector::VisitChangeFloat64ToUint32(Node* node) { |
495 VisitRR(this, kMipsTruncUwD, node); | 522 VisitRR(this, kMipsTruncUwD, node); |
496 } | 523 } |
497 | 524 |
498 | 525 |
499 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { | 526 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 MachineOperatorBuilder::kFloat32Max | | 1253 MachineOperatorBuilder::kFloat32Max | |
1227 MachineOperatorBuilder::kFloat32RoundDown | | 1254 MachineOperatorBuilder::kFloat32RoundDown | |
1228 MachineOperatorBuilder::kFloat32RoundUp | | 1255 MachineOperatorBuilder::kFloat32RoundUp | |
1229 MachineOperatorBuilder::kFloat32RoundTruncate | | 1256 MachineOperatorBuilder::kFloat32RoundTruncate | |
1230 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1257 MachineOperatorBuilder::kFloat32RoundTiesEven; |
1231 } | 1258 } |
1232 | 1259 |
1233 } // namespace compiler | 1260 } // namespace compiler |
1234 } // namespace internal | 1261 } // namespace internal |
1235 } // namespace v8 | 1262 } // namespace v8 |
OLD | NEW |