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/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/ppc/frames-ppc.h" | 9 #include "src/ppc/frames-ppc.h" |
10 | 10 |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 VisitPairShift(this, kPPC_ShiftRightPair, node); | 856 VisitPairShift(this, kPPC_ShiftRightPair, node); |
857 } | 857 } |
858 | 858 |
859 void InstructionSelector::VisitWord32PairSar(Node* node) { | 859 void InstructionSelector::VisitWord32PairSar(Node* node) { |
860 VisitPairShift(this, kPPC_ShiftRightAlgPair, node); | 860 VisitPairShift(this, kPPC_ShiftRightAlgPair, node); |
861 } | 861 } |
862 #endif | 862 #endif |
863 | 863 |
864 #if V8_TARGET_ARCH_PPC64 | 864 #if V8_TARGET_ARCH_PPC64 |
865 void InstructionSelector::VisitWord64Sar(Node* node) { | 865 void InstructionSelector::VisitWord64Sar(Node* node) { |
| 866 PPCOperandGenerator g(this); |
| 867 Int64BinopMatcher m(node); |
| 868 if (CanCover(m.node(), m.left().node()) && m.left().IsLoad() && |
| 869 m.right().Is(32)) { |
| 870 // Just load and sign-extend the interesting 4 bytes instead. This happens, |
| 871 // for example, when we're loading and untagging SMIs. |
| 872 BaseWithIndexAndDisplacement64Matcher mleft(m.left().node(), true); |
| 873 if (mleft.matches() && mleft.index() == nullptr) { |
| 874 int64_t offset = 0; |
| 875 Node* displacement = mleft.displacement(); |
| 876 if (displacement != nullptr) { |
| 877 Int64Matcher mdisplacement(displacement); |
| 878 DCHECK(mdisplacement.HasValue()); |
| 879 offset = mdisplacement.Value(); |
| 880 } |
| 881 offset = SmiWordOffset(offset); |
| 882 if (g.CanBeImmediate(offset, kInt16Imm_4ByteAligned)) { |
| 883 Emit(kPPC_LoadWordS32 | AddressingModeField::encode(kMode_MRI), |
| 884 g.DefineAsRegister(node), g.UseRegister(mleft.base()), |
| 885 g.TempImmediate(offset)); |
| 886 return; |
| 887 } |
| 888 } |
| 889 } |
866 VisitRRO(this, kPPC_ShiftRightAlg64, node, kShift64Imm); | 890 VisitRRO(this, kPPC_ShiftRightAlg64, node, kShift64Imm); |
867 } | 891 } |
868 #endif | 892 #endif |
869 | 893 |
870 | 894 |
871 // TODO(mbrandy): Absorb logical-and into rlwinm? | 895 // TODO(mbrandy): Absorb logical-and into rlwinm? |
872 void InstructionSelector::VisitWord32Ror(Node* node) { | 896 void InstructionSelector::VisitWord32Ror(Node* node) { |
873 VisitRRO(this, kPPC_RotRight32, node, kShift32Imm); | 897 VisitRRO(this, kPPC_RotRight32, node, kShift32Imm); |
874 } | 898 } |
875 | 899 |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1909 MachineOperatorBuilder::kFloat64RoundTruncate | | 1933 MachineOperatorBuilder::kFloat64RoundTruncate | |
1910 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1934 MachineOperatorBuilder::kFloat64RoundTiesAway | |
1911 MachineOperatorBuilder::kWord32Popcnt | | 1935 MachineOperatorBuilder::kWord32Popcnt | |
1912 MachineOperatorBuilder::kWord64Popcnt; | 1936 MachineOperatorBuilder::kWord64Popcnt; |
1913 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. | 1937 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. |
1914 } | 1938 } |
1915 | 1939 |
1916 } // namespace compiler | 1940 } // namespace compiler |
1917 } // namespace internal | 1941 } // namespace internal |
1918 } // namespace v8 | 1942 } // namespace v8 |
OLD | NEW |