| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 void InstructionSelector::VisitFloat64Add(Node* node) { | 748 void InstructionSelector::VisitFloat64Add(Node* node) { |
| 749 VisitRRR(this, kMipsAddD, node); | 749 VisitRRR(this, kMipsAddD, node); |
| 750 } | 750 } |
| 751 | 751 |
| 752 | 752 |
| 753 void InstructionSelector::VisitFloat32Sub(Node* node) { | 753 void InstructionSelector::VisitFloat32Sub(Node* node) { |
| 754 VisitRRR(this, kMipsSubS, node); | 754 VisitRRR(this, kMipsSubS, node); |
| 755 } | 755 } |
| 756 | 756 |
| 757 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) { | 757 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) { |
| 758 VisitRRR(this, kMipsSubS, node); | 758 MipsOperandGenerator g(this); |
| 759 Emit(kMipsSubPreserveNanS, g.DefineAsRegister(node), |
| 760 g.UseUniqueRegister(node->InputAt(0)), |
| 761 g.UseUniqueRegister(node->InputAt(1))); |
| 759 } | 762 } |
| 760 | 763 |
| 761 void InstructionSelector::VisitFloat64Sub(Node* node) { | 764 void InstructionSelector::VisitFloat64Sub(Node* node) { |
| 762 MipsOperandGenerator g(this); | 765 MipsOperandGenerator g(this); |
| 763 Float64BinopMatcher m(node); | 766 Float64BinopMatcher m(node); |
| 764 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && | 767 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && |
| 765 CanCover(m.node(), m.right().node())) { | 768 CanCover(m.node(), m.right().node())) { |
| 766 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && | 769 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && |
| 767 CanCover(m.right().node(), m.right().InputAt(0))) { | 770 CanCover(m.right().node(), m.right().InputAt(0))) { |
| 768 Float64BinopMatcher mright0(m.right().InputAt(0)); | 771 Float64BinopMatcher mright0(m.right().InputAt(0)); |
| 769 if (mright0.left().IsMinusZero()) { | 772 if (mright0.left().IsMinusZero()) { |
| 770 Emit(kMipsFloat64RoundUp, g.DefineAsRegister(node), | 773 Emit(kMipsFloat64RoundUp, g.DefineAsRegister(node), |
| 771 g.UseRegister(mright0.right().node())); | 774 g.UseRegister(mright0.right().node())); |
| 772 return; | 775 return; |
| 773 } | 776 } |
| 774 } | 777 } |
| 775 } | 778 } |
| 776 VisitRRR(this, kMipsSubD, node); | 779 VisitRRR(this, kMipsSubD, node); |
| 777 } | 780 } |
| 778 | 781 |
| 779 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) { | 782 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) { |
| 780 VisitRRR(this, kMipsSubD, node); | 783 MipsOperandGenerator g(this); |
| 784 Emit(kMipsSubPreserveNanD, g.DefineAsRegister(node), |
| 785 g.UseUniqueRegister(node->InputAt(0)), |
| 786 g.UseUniqueRegister(node->InputAt(1))); |
| 781 } | 787 } |
| 782 | 788 |
| 783 void InstructionSelector::VisitFloat32Mul(Node* node) { | 789 void InstructionSelector::VisitFloat32Mul(Node* node) { |
| 784 VisitRRR(this, kMipsMulS, node); | 790 VisitRRR(this, kMipsMulS, node); |
| 785 } | 791 } |
| 786 | 792 |
| 787 | 793 |
| 788 void InstructionSelector::VisitFloat64Mul(Node* node) { | 794 void InstructionSelector::VisitFloat64Mul(Node* node) { |
| 789 VisitRRR(this, kMipsMulD, node); | 795 VisitRRR(this, kMipsMulD, node); |
| 790 } | 796 } |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || | 1567 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || |
| 1562 IsMipsArchVariant(kMips32r2)); | 1568 IsMipsArchVariant(kMips32r2)); |
| 1563 return MachineOperatorBuilder::AlignmentRequirements:: | 1569 return MachineOperatorBuilder::AlignmentRequirements:: |
| 1564 NoUnalignedAccessSupport(); | 1570 NoUnalignedAccessSupport(); |
| 1565 } | 1571 } |
| 1566 } | 1572 } |
| 1567 | 1573 |
| 1568 } // namespace compiler | 1574 } // namespace compiler |
| 1569 } // namespace internal | 1575 } // namespace internal |
| 1570 } // namespace v8 | 1576 } // namespace v8 |
| OLD | NEW |