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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 | 662 |
663 | 663 |
664 void InstructionSelector::VisitFloat64Mod(Node* node) { | 664 void InstructionSelector::VisitFloat64Mod(Node* node) { |
665 Mips64OperandGenerator g(this); | 665 Mips64OperandGenerator g(this); |
666 Emit(kMips64ModD, g.DefineAsFixed(node, f0), | 666 Emit(kMips64ModD, g.DefineAsFixed(node, f0), |
667 g.UseFixed(node->InputAt(0), f12), | 667 g.UseFixed(node->InputAt(0), f12), |
668 g.UseFixed(node->InputAt(1), f14))->MarkAsCall(); | 668 g.UseFixed(node->InputAt(1), f14))->MarkAsCall(); |
669 } | 669 } |
670 | 670 |
671 | 671 |
672 void InstructionSelector::VisitFloat32Max(Node* node) { UNREACHABLE(); } | 672 void InstructionSelector::VisitFloat32Max(Node* node) { |
| 673 Mips64OperandGenerator g(this); |
| 674 if (kArchVariant == kMips64r6) { |
| 675 Emit(kMips64Float32Max, g.DefineAsRegister(node), |
| 676 g.UseUniqueRegister(node->InputAt(0)), |
| 677 g.UseUniqueRegister(node->InputAt(1))); |
| 678 |
| 679 } else { |
| 680 // Reverse operands, and use same reg. for result and right operand. |
| 681 Emit(kMips64Float32Max, g.DefineSameAsFirst(node), |
| 682 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
| 683 } |
| 684 } |
673 | 685 |
674 | 686 |
675 void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); } | 687 void InstructionSelector::VisitFloat64Max(Node* node) { |
| 688 Mips64OperandGenerator g(this); |
| 689 if (kArchVariant == kMips64r6) { |
| 690 Emit(kMips64Float64Max, g.DefineAsRegister(node), |
| 691 g.UseUniqueRegister(node->InputAt(0)), |
| 692 g.UseUniqueRegister(node->InputAt(1))); |
| 693 |
| 694 } else { |
| 695 // Reverse operands, and use same reg. for result and right operand. |
| 696 Emit(kMips64Float64Max, g.DefineSameAsFirst(node), |
| 697 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
| 698 } |
| 699 } |
676 | 700 |
677 | 701 |
678 void InstructionSelector::VisitFloat32Min(Node* node) { UNREACHABLE(); } | 702 void InstructionSelector::VisitFloat32Min(Node* node) { |
| 703 Mips64OperandGenerator g(this); |
| 704 if (kArchVariant == kMips64r6) { |
| 705 Emit(kMips64Float32Min, g.DefineAsRegister(node), |
| 706 g.UseUniqueRegister(node->InputAt(0)), |
| 707 g.UseUniqueRegister(node->InputAt(1))); |
| 708 |
| 709 } else { |
| 710 // Reverse operands, and use same reg. for result and right operand. |
| 711 Emit(kMips64Float32Min, g.DefineSameAsFirst(node), |
| 712 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
| 713 } |
| 714 } |
679 | 715 |
680 | 716 |
681 void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); } | 717 void InstructionSelector::VisitFloat64Min(Node* node) { |
| 718 Mips64OperandGenerator g(this); |
| 719 if (kArchVariant == kMips64r6) { |
| 720 Emit(kMips64Float64Min, g.DefineAsRegister(node), |
| 721 g.UseUniqueRegister(node->InputAt(0)), |
| 722 g.UseUniqueRegister(node->InputAt(1))); |
| 723 |
| 724 } else { |
| 725 // Reverse operands, and use same reg. for result and right operand. |
| 726 Emit(kMips64Float64Min, g.DefineSameAsFirst(node), |
| 727 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0))); |
| 728 } |
| 729 } |
682 | 730 |
683 | 731 |
684 void InstructionSelector::VisitFloat32Abs(Node* node) { | 732 void InstructionSelector::VisitFloat32Abs(Node* node) { |
685 VisitRR(this, kMips64AbsS, node); | 733 VisitRR(this, kMips64AbsS, node); |
686 } | 734 } |
687 | 735 |
688 | 736 |
689 void InstructionSelector::VisitFloat64Abs(Node* node) { | 737 void InstructionSelector::VisitFloat64Abs(Node* node) { |
690 VisitRR(this, kMips64AbsD, node); | 738 VisitRR(this, kMips64AbsD, node); |
691 } | 739 } |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 Node* left = node->InputAt(0); | 1332 Node* left = node->InputAt(0); |
1285 Node* right = node->InputAt(1); | 1333 Node* right = node->InputAt(1); |
1286 Emit(kMips64Float64InsertHighWord32, g.DefineSameAsFirst(node), | 1334 Emit(kMips64Float64InsertHighWord32, g.DefineSameAsFirst(node), |
1287 g.UseRegister(left), g.UseRegister(right)); | 1335 g.UseRegister(left), g.UseRegister(right)); |
1288 } | 1336 } |
1289 | 1337 |
1290 | 1338 |
1291 // static | 1339 // static |
1292 MachineOperatorBuilder::Flags | 1340 MachineOperatorBuilder::Flags |
1293 InstructionSelector::SupportedMachineOperatorFlags() { | 1341 InstructionSelector::SupportedMachineOperatorFlags() { |
1294 return MachineOperatorBuilder::kFloat64RoundDown | | 1342 return MachineOperatorBuilder::kFloat64Min | |
| 1343 MachineOperatorBuilder::kFloat64Max | |
| 1344 MachineOperatorBuilder::kFloat32Min | |
| 1345 MachineOperatorBuilder::kFloat32Max | |
| 1346 MachineOperatorBuilder::kFloat64RoundDown | |
1295 MachineOperatorBuilder::kFloat64RoundTruncate; | 1347 MachineOperatorBuilder::kFloat64RoundTruncate; |
1296 } | 1348 } |
1297 | 1349 |
1298 } // namespace compiler | 1350 } // namespace compiler |
1299 } // namespace internal | 1351 } // namespace internal |
1300 } // namespace v8 | 1352 } // namespace v8 |
OLD | NEW |