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/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
11 namespace compiler { | 11 namespace compiler { |
12 | 12 |
13 enum ImmediateMode { | 13 enum ImmediateMode { |
14 kArithmeticImm, // 12 bit unsigned immediate shifted left 0 or 12 bits | 14 kArithmeticImm, // 12 bit unsigned immediate shifted left 0 or 12 bits |
15 kShift32Imm, // 0 - 31 | 15 kShift32Imm, // 0 - 31 |
16 kShift64Imm, // 0 - 63 | 16 kShift64Imm, // 0 - 63 |
17 kLogical32Imm, | 17 kLogical32Imm, |
18 kLogical64Imm, | 18 kLogical64Imm, |
19 kLoadStoreImm8, // signed 8 bit or 12 bit unsigned scaled by access size | 19 kLoadStoreImm8, // signed 8 bit or 12 bit unsigned scaled by access size |
20 kLoadStoreImm16, | 20 kLoadStoreImm16, |
21 kLoadStoreImm32, | 21 kLoadStoreImm32, |
22 kLoadStoreImm64, | 22 kLoadStoreImm64, |
23 kNoImmediate | 23 kNoImmediate |
24 }; | 24 }; |
25 | 25 |
26 | 26 |
27 // Adds Arm64-specific methods for generating operands. | 27 // Adds Arm64-specific methods for generating operands. |
28 class Arm64OperandGenerator FINAL : public OperandGenerator { | 28 class Arm64OperandGenerator final : public OperandGenerator { |
29 public: | 29 public: |
30 explicit Arm64OperandGenerator(InstructionSelector* selector) | 30 explicit Arm64OperandGenerator(InstructionSelector* selector) |
31 : OperandGenerator(selector) {} | 31 : OperandGenerator(selector) {} |
32 | 32 |
33 InstructionOperand UseOperand(Node* node, ImmediateMode mode) { | 33 InstructionOperand UseOperand(Node* node, ImmediateMode mode) { |
34 if (CanBeImmediate(node, mode)) { | 34 if (CanBeImmediate(node, mode)) { |
35 return UseImmediate(node); | 35 return UseImmediate(node); |
36 } | 36 } |
37 return UseRegister(node); | 37 return UseRegister(node); |
38 } | 38 } |
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 MachineOperatorBuilder::kFloat64RoundTruncate | | 1773 MachineOperatorBuilder::kFloat64RoundTruncate | |
1774 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1774 MachineOperatorBuilder::kFloat64RoundTiesAway | |
1775 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1775 MachineOperatorBuilder::kWord32ShiftIsSafe | |
1776 MachineOperatorBuilder::kInt32DivIsSafe | | 1776 MachineOperatorBuilder::kInt32DivIsSafe | |
1777 MachineOperatorBuilder::kUint32DivIsSafe; | 1777 MachineOperatorBuilder::kUint32DivIsSafe; |
1778 } | 1778 } |
1779 | 1779 |
1780 } // namespace compiler | 1780 } // namespace compiler |
1781 } // namespace internal | 1781 } // namespace internal |
1782 } // namespace v8 | 1782 } // namespace v8 |
OLD | NEW |