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

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

Issue 2622643005: ARM64: Add NEON support (Closed)
Patch Set: Created 3 years, 11 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/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 {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // TODO(dcarney): some unencodable values can be handled by 95 // TODO(dcarney): some unencodable values can be handled by
96 // switching instructions. 96 // switching instructions.
97 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 32, 97 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 32,
98 &ignored, &ignored, &ignored); 98 &ignored, &ignored, &ignored);
99 case kLogical64Imm: 99 case kLogical64Imm:
100 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 64, 100 return Assembler::IsImmLogical(static_cast<uint64_t>(value), 64,
101 &ignored, &ignored, &ignored); 101 &ignored, &ignored, &ignored);
102 case kArithmeticImm: 102 case kArithmeticImm:
103 return Assembler::IsImmAddSub(value); 103 return Assembler::IsImmAddSub(value);
104 case kLoadStoreImm8: 104 case kLoadStoreImm8:
105 return IsLoadStoreImmediate(value, LSByte); 105 return IsLoadStoreImmediate(value, 0);
106 case kLoadStoreImm16: 106 case kLoadStoreImm16:
107 return IsLoadStoreImmediate(value, LSHalfword); 107 return IsLoadStoreImmediate(value, 1);
108 case kLoadStoreImm32: 108 case kLoadStoreImm32:
109 return IsLoadStoreImmediate(value, LSWord); 109 return IsLoadStoreImmediate(value, 2);
110 case kLoadStoreImm64: 110 case kLoadStoreImm64:
111 return IsLoadStoreImmediate(value, LSDoubleWord); 111 return IsLoadStoreImmediate(value, 3);
112 case kNoImmediate: 112 case kNoImmediate:
113 return false; 113 return false;
114 case kShift32Imm: // Fall through. 114 case kShift32Imm: // Fall through.
115 case kShift64Imm: 115 case kShift64Imm:
116 // Shift operations only observe the bottom 5 or 6 bits of the value. 116 // Shift operations only observe the bottom 5 or 6 bits of the value.
117 // All possible shifts can be encoded by discarding bits which have no 117 // All possible shifts can be encoded by discarding bits which have no
118 // effect. 118 // effect.
119 return true; 119 return true;
120 } 120 }
121 return false; 121 return false;
122 } 122 }
123 123
124 bool CanBeLoadStoreShiftImmediate(Node* node, MachineRepresentation rep) { 124 bool CanBeLoadStoreShiftImmediate(Node* node, MachineRepresentation rep) {
125 // TODO(arm64): Load and Store on 128 bit Q registers is not supported yet. 125 // TODO(arm64): Load and Store on 128 bit Q registers is not supported yet.
126 DCHECK_NE(MachineRepresentation::kSimd128, rep); 126 DCHECK_NE(MachineRepresentation::kSimd128, rep);
127 return IsIntegerConstant(node) && 127 return IsIntegerConstant(node) &&
128 (GetIntegerConstantValue(node) == ElementSizeLog2Of(rep)); 128 (GetIntegerConstantValue(node) == ElementSizeLog2Of(rep));
129 } 129 }
130 130
131 private: 131 private:
132 bool IsLoadStoreImmediate(int64_t value, LSDataSize size) { 132 bool IsLoadStoreImmediate(int64_t value, unsigned size) {
133 return Assembler::IsImmLSScaled(value, size) || 133 return Assembler::IsImmLSScaled(value, size) ||
134 Assembler::IsImmLSUnscaled(value); 134 Assembler::IsImmLSUnscaled(value);
135 } 135 }
136 }; 136 };
137 137
138 138
139 namespace { 139 namespace {
140 140
141 void VisitRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) { 141 void VisitRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) {
142 Arm64OperandGenerator g(selector); 142 Arm64OperandGenerator g(selector);
(...skipping 2776 matching lines...) Expand 10 before | Expand all | Expand 10 after
2919 // static 2919 // static
2920 MachineOperatorBuilder::AlignmentRequirements 2920 MachineOperatorBuilder::AlignmentRequirements
2921 InstructionSelector::AlignmentRequirements() { 2921 InstructionSelector::AlignmentRequirements() {
2922 return MachineOperatorBuilder::AlignmentRequirements:: 2922 return MachineOperatorBuilder::AlignmentRequirements::
2923 FullUnalignedAccessSupport(); 2923 FullUnalignedAccessSupport();
2924 } 2924 }
2925 2925
2926 } // namespace compiler 2926 } // namespace compiler
2927 } // namespace internal 2927 } // namespace internal
2928 } // namespace v8 2928 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698