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/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler-intrinsics.h" | 7 #include "src/compiler-intrinsics.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 CanCover(node, m.right().node())) { | 609 CanCover(node, m.right().node())) { |
610 Int32BinopMatcher mright(m.right().node()); | 610 Int32BinopMatcher mright(m.right().node()); |
611 Emit(kArmMls, g.DefineAsRegister(node), g.UseRegister(mright.left().node()), | 611 Emit(kArmMls, g.DefineAsRegister(node), g.UseRegister(mright.left().node()), |
612 g.UseRegister(mright.right().node()), g.UseRegister(m.left().node())); | 612 g.UseRegister(mright.right().node()), g.UseRegister(m.left().node())); |
613 return; | 613 return; |
614 } | 614 } |
615 VisitBinop(this, node, kArmSub, kArmRsb); | 615 VisitBinop(this, node, kArmSub, kArmRsb); |
616 } | 616 } |
617 | 617 |
618 | 618 |
| 619 void InstructionSelector::VisitInt32SubWithOverflow(Node* node) { |
| 620 VisitBinopWithOverflow(this, node, kArmSub, kArmRsb); |
| 621 } |
| 622 |
| 623 |
619 void InstructionSelector::VisitInt32Mul(Node* node) { | 624 void InstructionSelector::VisitInt32Mul(Node* node) { |
620 ArmOperandGenerator g(this); | 625 ArmOperandGenerator g(this); |
621 Int32BinopMatcher m(node); | 626 Int32BinopMatcher m(node); |
622 if (m.right().HasValue() && m.right().Value() > 0) { | 627 if (m.right().HasValue() && m.right().Value() > 0) { |
623 int32_t value = m.right().Value(); | 628 int32_t value = m.right().Value(); |
624 if (IsPowerOf2(value - 1)) { | 629 if (IsPowerOf2(value - 1)) { |
625 Emit(kArmAdd | AddressingModeField::encode(kMode_Operand2_R_LSL_I), | 630 Emit(kArmAdd | AddressingModeField::encode(kMode_Operand2_R_LSL_I), |
626 g.DefineAsRegister(node), g.UseRegister(m.left().node()), | 631 g.DefineAsRegister(node), g.UseRegister(m.left().node()), |
627 g.UseRegister(m.left().node()), | 632 g.UseRegister(m.left().node()), |
628 g.TempImmediate(WhichPowerOf2(value - 1))); | 633 g.TempImmediate(WhichPowerOf2(value - 1))); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 ASSERT(cont->IsSet()); | 962 ASSERT(cont->IsSet()); |
958 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), | 963 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), |
959 g.UseDoubleRegister(m.left().node()), | 964 g.UseDoubleRegister(m.left().node()), |
960 g.UseDoubleRegister(m.right().node())); | 965 g.UseDoubleRegister(m.right().node())); |
961 } | 966 } |
962 } | 967 } |
963 | 968 |
964 } // namespace compiler | 969 } // namespace compiler |
965 } // namespace internal | 970 } // namespace internal |
966 } // namespace v8 | 971 } // namespace v8 |
OLD | NEW |