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

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

Issue 2896303003: Reland of Reland of "ARM64: Add NEON support" (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/crankshaft/arm64/delayed-masm-arm64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/assembler-inl.h" 5 #include "src/assembler-inl.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 9
10 namespace v8 { 10 namespace v8 {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // TODO(dcarney): some unencodable values can be handled by 96 // TODO(dcarney): some unencodable values can be handled by
97 // switching instructions. 97 // switching instructions.
98 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 32, 98 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 32,
99 &ignored, &ignored, &ignored); 99 &ignored, &ignored, &ignored);
100 case kLogical64Imm: 100 case kLogical64Imm:
101 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 64, 101 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 64,
102 &ignored, &ignored, &ignored); 102 &ignored, &ignored, &ignored);
103 case kArithmeticImm: 103 case kArithmeticImm:
104 return Assembler::IsImmAddSub(value); 104 return Assembler::IsImmAddSub(value);
105 case kLoadStoreImm8: 105 case kLoadStoreImm8:
106 return IsLoadStoreImmediate(value, LSByte); 106 return IsLoadStoreImmediate(value, 0);
107 case kLoadStoreImm16: 107 case kLoadStoreImm16:
108 return IsLoadStoreImmediate(value, LSHalfword); 108 return IsLoadStoreImmediate(value, 1);
109 case kLoadStoreImm32: 109 case kLoadStoreImm32:
110 return IsLoadStoreImmediate(value, LSWord); 110 return IsLoadStoreImmediate(value, 2);
111 case kLoadStoreImm64: 111 case kLoadStoreImm64:
112 return IsLoadStoreImmediate(value, LSDoubleWord); 112 return IsLoadStoreImmediate(value, 3);
113 case kNoImmediate: 113 case kNoImmediate:
114 return false; 114 return false;
115 case kShift32Imm: // Fall through. 115 case kShift32Imm: // Fall through.
116 case kShift64Imm: 116 case kShift64Imm:
117 // Shift operations only observe the bottom 5 or 6 bits of the value. 117 // Shift operations only observe the bottom 5 or 6 bits of the value.
118 // All possible shifts can be encoded by discarding bits which have no 118 // All possible shifts can be encoded by discarding bits which have no
119 // effect. 119 // effect.
120 return true; 120 return true;
121 } 121 }
122 return false; 122 return false;
123 } 123 }
124 124
125 bool CanBeLoadStoreShiftImmediate(Node* node, MachineRepresentation rep) { 125 bool CanBeLoadStoreShiftImmediate(Node* node, MachineRepresentation rep) {
126 // TODO(arm64): Load and Store on 128 bit Q registers is not supported yet. 126 // TODO(arm64): Load and Store on 128 bit Q registers is not supported yet.
127 DCHECK_GT(MachineRepresentation::kSimd128, rep); 127 DCHECK_GT(MachineRepresentation::kSimd128, rep);
128 return IsIntegerConstant(node) && 128 return IsIntegerConstant(node) &&
129 (GetIntegerConstantValue(node) == ElementSizeLog2Of(rep)); 129 (GetIntegerConstantValue(node) == ElementSizeLog2Of(rep));
130 } 130 }
131 131
132 private: 132 private:
133 bool IsLoadStoreImmediate(int64_t value, LSDataSize size) { 133 bool IsLoadStoreImmediate(int64_t value, unsigned size) {
134 return Assembler::IsImmLSScaled(value, size) || 134 return Assembler::IsImmLSScaled(value, size) ||
135 Assembler::IsImmLSUnscaled(value); 135 Assembler::IsImmLSUnscaled(value);
136 } 136 }
137 }; 137 };
138 138
139 139
140 namespace { 140 namespace {
141 141
142 void VisitRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) { 142 void VisitRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
143 Arm64OperandGenerator g(selector); 143 Arm64OperandGenerator g(selector);
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 // static 2871 // static
2872 MachineOperatorBuilder::AlignmentRequirements 2872 MachineOperatorBuilder::AlignmentRequirements
2873 InstructionSelector::AlignmentRequirements() { 2873 InstructionSelector::AlignmentRequirements() {
2874 return MachineOperatorBuilder::AlignmentRequirements:: 2874 return MachineOperatorBuilder::AlignmentRequirements::
2875 FullUnalignedAccessSupport(); 2875 FullUnalignedAccessSupport();
2876 } 2876 }
2877 2877
2878 } // namespace compiler 2878 } // namespace compiler
2879 } // namespace internal 2879 } // namespace internal
2880 } // namespace v8 2880 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/crankshaft/arm64/delayed-masm-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698