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

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: comments addressed 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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 753
754 754
755 void InstructionSelector::VisitWord32Clz(Node* node) { 755 void InstructionSelector::VisitWord32Clz(Node* node) {
756 VisitRR(this, kArmClz, node); 756 VisitRR(this, kArmClz, node);
757 } 757 }
758 758
759 759
760 void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); } 760 void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); }
761 761
762 762
763 void InstructionSelector::VisitWord32ReverseBits(Node* node) {
764 DCHECK(IsSupported(ARMv7));
765 VisitRR(this, kArmRbit, node);
766 }
767
768
763 void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); } 769 void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); }
764 770
765 771
766 void InstructionSelector::VisitInt32Add(Node* node) { 772 void InstructionSelector::VisitInt32Add(Node* node) {
767 ArmOperandGenerator g(this); 773 ArmOperandGenerator g(this);
768 Int32BinopMatcher m(node); 774 Int32BinopMatcher m(node);
769 if (CanCover(node, m.left().node())) { 775 if (CanCover(node, m.left().node())) {
770 switch (m.left().opcode()) { 776 switch (m.left().opcode()) {
771 case IrOpcode::kInt32Mul: { 777 case IrOpcode::kInt32Mul: {
772 Int32BinopMatcher mleft(m.left().node()); 778 Int32BinopMatcher mleft(m.left().node());
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 g.UseRegister(right)); 1644 g.UseRegister(right));
1639 } 1645 }
1640 1646
1641 1647
1642 // static 1648 // static
1643 MachineOperatorBuilder::Flags 1649 MachineOperatorBuilder::Flags
1644 InstructionSelector::SupportedMachineOperatorFlags() { 1650 InstructionSelector::SupportedMachineOperatorFlags() {
1645 MachineOperatorBuilder::Flags flags = 1651 MachineOperatorBuilder::Flags flags =
1646 MachineOperatorBuilder::kInt32DivIsSafe | 1652 MachineOperatorBuilder::kInt32DivIsSafe |
1647 MachineOperatorBuilder::kUint32DivIsSafe; 1653 MachineOperatorBuilder::kUint32DivIsSafe;
1654 if (CpuFeatures::IsSupported(ARMv7)) {
1655 flags |= MachineOperatorBuilder::kWord32ReverseBits;
1656 }
1648 if (CpuFeatures::IsSupported(ARMv8)) { 1657 if (CpuFeatures::IsSupported(ARMv8)) {
1649 flags |= MachineOperatorBuilder::kFloat32RoundDown | 1658 flags |= MachineOperatorBuilder::kFloat32RoundDown |
1650 MachineOperatorBuilder::kFloat64RoundDown | 1659 MachineOperatorBuilder::kFloat64RoundDown |
1651 MachineOperatorBuilder::kFloat32RoundUp | 1660 MachineOperatorBuilder::kFloat32RoundUp |
1652 MachineOperatorBuilder::kFloat64RoundUp | 1661 MachineOperatorBuilder::kFloat64RoundUp |
1653 MachineOperatorBuilder::kFloat32RoundTruncate | 1662 MachineOperatorBuilder::kFloat32RoundTruncate |
1654 MachineOperatorBuilder::kFloat64RoundTruncate | 1663 MachineOperatorBuilder::kFloat64RoundTruncate |
1655 MachineOperatorBuilder::kFloat64RoundTiesAway | 1664 MachineOperatorBuilder::kFloat64RoundTiesAway |
1656 MachineOperatorBuilder::kFloat32RoundTiesEven | 1665 MachineOperatorBuilder::kFloat32RoundTiesEven |
1657 MachineOperatorBuilder::kFloat64RoundTiesEven; 1666 MachineOperatorBuilder::kFloat64RoundTiesEven;
1658 } 1667 }
1659 return flags; 1668 return flags;
1660 } 1669 }
1661 1670
1662 } // namespace compiler 1671 } // namespace compiler
1663 } // namespace internal 1672 } // namespace internal
1664 } // namespace v8 1673 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm/instruction-scheduler-arm.cc ('k') | src/compiler/arm64/code-generator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698