Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: src/compiler/arm/instruction-selector-arm.cc

Issue 1698483002: [arm][arm64] Improve CountTrailingZero implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 719
720 720
721 void InstructionSelector::VisitWord32Clz(Node* node) { 721 void InstructionSelector::VisitWord32Clz(Node* node) {
722 VisitRR(this, kArmClz, node); 722 VisitRR(this, kArmClz, node);
723 } 723 }
724 724
725 725
726 void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); } 726 void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); }
727 727
728 728
729 void InstructionSelector::VisitWord32ReverseBits(Node* node) {
730 DCHECK(IsSupported(ARMv7));
731 VisitRR(this, kArmRbit, node);
732 }
733
734
729 void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); } 735 void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); }
730 736
731 737
732 void InstructionSelector::VisitInt32Add(Node* node) { 738 void InstructionSelector::VisitInt32Add(Node* node) {
733 ArmOperandGenerator g(this); 739 ArmOperandGenerator g(this);
734 Int32BinopMatcher m(node); 740 Int32BinopMatcher m(node);
735 if (CanCover(node, m.left().node())) { 741 if (CanCover(node, m.left().node())) {
736 switch (m.left().opcode()) { 742 switch (m.left().opcode()) {
737 case IrOpcode::kInt32Mul: { 743 case IrOpcode::kInt32Mul: {
738 Int32BinopMatcher mleft(m.left().node()); 744 Int32BinopMatcher mleft(m.left().node());
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 g.UseRegister(right)); 1610 g.UseRegister(right));
1605 } 1611 }
1606 1612
1607 1613
1608 // static 1614 // static
1609 MachineOperatorBuilder::Flags 1615 MachineOperatorBuilder::Flags
1610 InstructionSelector::SupportedMachineOperatorFlags() { 1616 InstructionSelector::SupportedMachineOperatorFlags() {
1611 MachineOperatorBuilder::Flags flags = 1617 MachineOperatorBuilder::Flags flags =
1612 MachineOperatorBuilder::kInt32DivIsSafe | 1618 MachineOperatorBuilder::kInt32DivIsSafe |
1613 MachineOperatorBuilder::kUint32DivIsSafe; 1619 MachineOperatorBuilder::kUint32DivIsSafe;
1620 if (CpuFeatures::IsSupported(ARMv7)) {
1621 flags |= MachineOperatorBuilder::kWord32ReverseBits;
1622 }
1614 if (CpuFeatures::IsSupported(ARMv8)) { 1623 if (CpuFeatures::IsSupported(ARMv8)) {
1615 flags |= MachineOperatorBuilder::kFloat32RoundDown | 1624 flags |= MachineOperatorBuilder::kFloat32RoundDown |
1616 MachineOperatorBuilder::kFloat64RoundDown | 1625 MachineOperatorBuilder::kFloat64RoundDown |
1617 MachineOperatorBuilder::kFloat32RoundUp | 1626 MachineOperatorBuilder::kFloat32RoundUp |
1618 MachineOperatorBuilder::kFloat64RoundUp | 1627 MachineOperatorBuilder::kFloat64RoundUp |
1619 MachineOperatorBuilder::kFloat32RoundTruncate | 1628 MachineOperatorBuilder::kFloat32RoundTruncate |
1620 MachineOperatorBuilder::kFloat64RoundTruncate | 1629 MachineOperatorBuilder::kFloat64RoundTruncate |
1621 MachineOperatorBuilder::kFloat64RoundTiesAway | 1630 MachineOperatorBuilder::kFloat64RoundTiesAway |
1622 MachineOperatorBuilder::kFloat32RoundTiesEven | 1631 MachineOperatorBuilder::kFloat32RoundTiesEven |
1623 MachineOperatorBuilder::kFloat64RoundTiesEven; 1632 MachineOperatorBuilder::kFloat64RoundTiesEven;
1624 } 1633 }
1625 return flags; 1634 return flags;
1626 } 1635 }
1627 1636
1628 } // namespace compiler 1637 } // namespace compiler
1629 } // namespace internal 1638 } // namespace internal
1630 } // namespace v8 1639 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698