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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 inputs[(*input_count)++] = UseRegister(index); | 121 inputs[(*input_count)++] = UseRegister(index); |
122 } | 122 } |
123 } | 123 } |
124 } | 124 } |
125 return mode; | 125 return mode; |
126 } | 126 } |
127 | 127 |
128 AddressingMode GetEffectiveAddressMemoryOperand(Node* operand, | 128 AddressingMode GetEffectiveAddressMemoryOperand(Node* operand, |
129 InstructionOperand inputs[], | 129 InstructionOperand inputs[], |
130 size_t* input_count) { | 130 size_t* input_count) { |
131 BaseWithIndexAndDisplacement64Matcher m(operand, true); | 131 BaseWithIndexAndDisplacement64Matcher m(operand, AddressOption::kAllowAll); |
132 DCHECK(m.matches()); | 132 DCHECK(m.matches()); |
133 if ((m.displacement() == nullptr || CanBeImmediate(m.displacement()))) { | 133 if ((m.displacement() == nullptr || CanBeImmediate(m.displacement()))) { |
134 return GenerateMemoryOperandInputs( | 134 return GenerateMemoryOperandInputs( |
135 m.index(), m.scale(), m.base(), m.displacement(), | 135 m.index(), m.scale(), m.base(), m.displacement(), |
136 m.displacement_mode(), inputs, input_count); | 136 m.displacement_mode(), inputs, input_count); |
137 } else { | 137 } else { |
138 inputs[(*input_count)++] = UseRegister(operand->InputAt(0)); | 138 inputs[(*input_count)++] = UseRegister(operand->InputAt(0)); |
139 inputs[(*input_count)++] = UseRegister(operand->InputAt(1)); | 139 inputs[(*input_count)++] = UseRegister(operand->InputAt(1)); |
140 return kMode_MR1; | 140 return kMode_MR1; |
141 } | 141 } |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 } | 646 } |
647 | 647 |
648 | 648 |
649 void InstructionSelector::VisitWord64Sar(Node* node) { | 649 void InstructionSelector::VisitWord64Sar(Node* node) { |
650 X64OperandGenerator g(this); | 650 X64OperandGenerator g(this); |
651 Int64BinopMatcher m(node); | 651 Int64BinopMatcher m(node); |
652 if (CanCover(m.node(), m.left().node()) && m.left().IsLoad() && | 652 if (CanCover(m.node(), m.left().node()) && m.left().IsLoad() && |
653 m.right().Is(32)) { | 653 m.right().Is(32)) { |
654 // Just load and sign-extend the interesting 4 bytes instead. This happens, | 654 // Just load and sign-extend the interesting 4 bytes instead. This happens, |
655 // for example, when we're loading and untagging SMIs. | 655 // for example, when we're loading and untagging SMIs. |
656 BaseWithIndexAndDisplacement64Matcher mleft(m.left().node(), true); | 656 BaseWithIndexAndDisplacement64Matcher mleft(m.left().node(), |
| 657 AddressOption::kAllowAll); |
657 if (mleft.matches() && (mleft.displacement() == nullptr || | 658 if (mleft.matches() && (mleft.displacement() == nullptr || |
658 g.CanBeImmediate(mleft.displacement()))) { | 659 g.CanBeImmediate(mleft.displacement()))) { |
659 size_t input_count = 0; | 660 size_t input_count = 0; |
660 InstructionOperand inputs[3]; | 661 InstructionOperand inputs[3]; |
661 AddressingMode mode = g.GetEffectiveAddressMemoryOperand( | 662 AddressingMode mode = g.GetEffectiveAddressMemoryOperand( |
662 m.left().node(), inputs, &input_count); | 663 m.left().node(), inputs, &input_count); |
663 if (mleft.displacement() == nullptr) { | 664 if (mleft.displacement() == nullptr) { |
664 // Make sure that the addressing mode indicates the presence of an | 665 // Make sure that the addressing mode indicates the presence of an |
665 // immediate displacement. It seems that we never use M1 and M2, but we | 666 // immediate displacement. It seems that we never use M1 and M2, but we |
666 // handle them here anyways. | 667 // handle them here anyways. |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2202 // static | 2203 // static |
2203 MachineOperatorBuilder::AlignmentRequirements | 2204 MachineOperatorBuilder::AlignmentRequirements |
2204 InstructionSelector::AlignmentRequirements() { | 2205 InstructionSelector::AlignmentRequirements() { |
2205 return MachineOperatorBuilder::AlignmentRequirements:: | 2206 return MachineOperatorBuilder::AlignmentRequirements:: |
2206 FullUnalignedAccessSupport(); | 2207 FullUnalignedAccessSupport(); |
2207 } | 2208 } |
2208 | 2209 |
2209 } // namespace compiler | 2210 } // namespace compiler |
2210 } // namespace internal | 2211 } // namespace internal |
2211 } // namespace v8 | 2212 } // namespace v8 |
OLD | NEW |