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

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

Issue 1693963004: Add a kSimd128 machine type for Turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 <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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 case MachineRepresentation::kWord8: 123 case MachineRepresentation::kWord8:
124 opcode = load_rep.IsSigned() ? kX64Movsxbl : kX64Movzxbl; 124 opcode = load_rep.IsSigned() ? kX64Movsxbl : kX64Movzxbl;
125 break; 125 break;
126 case MachineRepresentation::kWord16: 126 case MachineRepresentation::kWord16:
127 opcode = load_rep.IsSigned() ? kX64Movsxwl : kX64Movzxwl; 127 opcode = load_rep.IsSigned() ? kX64Movsxwl : kX64Movzxwl;
128 break; 128 break;
129 case MachineRepresentation::kWord32: 129 case MachineRepresentation::kWord32:
130 opcode = kX64Movl; 130 opcode = kX64Movl;
131 break; 131 break;
132 case MachineRepresentation::kTagged: // Fall through. 132 case MachineRepresentation::kTagged: // Fall through.
133 case MachineRepresentation::kWord64: 133 case MachineRepresentation::kWord64: // Fall through.
134 case MachineRepresentation::kSimd128:
titzer 2016/02/17 11:57:02 Probably want to make this case unreachable for no
bbudge 2016/02/17 18:57:14 Done.
134 opcode = kX64Movq; 135 opcode = kX64Movq;
135 break; 136 break;
136 case MachineRepresentation::kNone: 137 case MachineRepresentation::kNone:
137 UNREACHABLE(); 138 UNREACHABLE();
138 return; 139 return;
139 } 140 }
140 141
141 InstructionOperand outputs[1]; 142 InstructionOperand outputs[1];
142 outputs[0] = g.DefineAsRegister(node); 143 outputs[0] = g.DefineAsRegister(node);
143 InstructionOperand inputs[3]; 144 InstructionOperand inputs[3];
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 case MachineRepresentation::kWord8: 210 case MachineRepresentation::kWord8:
210 opcode = kX64Movb; 211 opcode = kX64Movb;
211 break; 212 break;
212 case MachineRepresentation::kWord16: 213 case MachineRepresentation::kWord16:
213 opcode = kX64Movw; 214 opcode = kX64Movw;
214 break; 215 break;
215 case MachineRepresentation::kWord32: 216 case MachineRepresentation::kWord32:
216 opcode = kX64Movl; 217 opcode = kX64Movl;
217 break; 218 break;
218 case MachineRepresentation::kTagged: // Fall through. 219 case MachineRepresentation::kTagged: // Fall through.
219 case MachineRepresentation::kWord64: 220 case MachineRepresentation::kWord64: // Fall through.
221 case MachineRepresentation::kSimd128:
Jarin 2016/02/17 12:06:47 Preferably move this case to the unreachable case,
bbudge 2016/02/17 18:57:14 Done.
220 opcode = kX64Movq; 222 opcode = kX64Movq;
221 break; 223 break;
222 case MachineRepresentation::kNone: 224 case MachineRepresentation::kNone:
223 UNREACHABLE(); 225 UNREACHABLE();
224 return; 226 return;
225 } 227 }
226 InstructionOperand inputs[4]; 228 InstructionOperand inputs[4];
227 size_t input_count = 0; 229 size_t input_count = 0;
228 AddressingMode addressing_mode = 230 AddressingMode addressing_mode =
229 g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count); 231 g.GetEffectiveAddressMemoryOperand(node, inputs, &input_count);
(...skipping 27 matching lines...) Expand all
257 break; 259 break;
258 case MachineRepresentation::kWord64: 260 case MachineRepresentation::kWord64:
259 opcode = kCheckedLoadWord64; 261 opcode = kCheckedLoadWord64;
260 break; 262 break;
261 case MachineRepresentation::kFloat32: 263 case MachineRepresentation::kFloat32:
262 opcode = kCheckedLoadFloat32; 264 opcode = kCheckedLoadFloat32;
263 break; 265 break;
264 case MachineRepresentation::kFloat64: 266 case MachineRepresentation::kFloat64:
265 opcode = kCheckedLoadFloat64; 267 opcode = kCheckedLoadFloat64;
266 break; 268 break;
267 case MachineRepresentation::kBit: 269 case MachineRepresentation::kBit: // Fall through.
268 case MachineRepresentation::kTagged: 270 case MachineRepresentation::kSimd128: // Fall through.
271 case MachineRepresentation::kTagged: // Fall through.
269 case MachineRepresentation::kNone: 272 case MachineRepresentation::kNone:
270 UNREACHABLE(); 273 UNREACHABLE();
271 return; 274 return;
272 } 275 }
273 if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { 276 if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
274 Int32Matcher mlength(length); 277 Int32Matcher mlength(length);
275 Int32BinopMatcher moffset(offset); 278 Int32BinopMatcher moffset(offset);
276 if (mlength.HasValue() && moffset.right().HasValue() && 279 if (mlength.HasValue() && moffset.right().HasValue() &&
277 moffset.right().Value() >= 0 && 280 moffset.right().Value() >= 0 &&
278 mlength.Value() >= moffset.right().Value()) { 281 mlength.Value() >= moffset.right().Value()) {
(...skipping 30 matching lines...) Expand all
309 break; 312 break;
310 case MachineRepresentation::kWord64: 313 case MachineRepresentation::kWord64:
311 opcode = kCheckedStoreWord64; 314 opcode = kCheckedStoreWord64;
312 break; 315 break;
313 case MachineRepresentation::kFloat32: 316 case MachineRepresentation::kFloat32:
314 opcode = kCheckedStoreFloat32; 317 opcode = kCheckedStoreFloat32;
315 break; 318 break;
316 case MachineRepresentation::kFloat64: 319 case MachineRepresentation::kFloat64:
317 opcode = kCheckedStoreFloat64; 320 opcode = kCheckedStoreFloat64;
318 break; 321 break;
319 case MachineRepresentation::kBit: 322 case MachineRepresentation::kBit: // Fall through.
320 case MachineRepresentation::kTagged: 323 case MachineRepresentation::kSimd128: // Fall through.
324 case MachineRepresentation::kTagged: // Fall through.
321 case MachineRepresentation::kNone: 325 case MachineRepresentation::kNone:
322 UNREACHABLE(); 326 UNREACHABLE();
323 return; 327 return;
324 } 328 }
325 InstructionOperand value_operand = 329 InstructionOperand value_operand =
326 g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value); 330 g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value);
327 if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) { 331 if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
328 Int32Matcher mlength(length); 332 Int32Matcher mlength(length);
329 Int32BinopMatcher moffset(offset); 333 Int32BinopMatcher moffset(offset);
330 if (mlength.HasValue() && moffset.right().HasValue() && 334 if (mlength.HasValue() && moffset.right().HasValue() &&
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 MachineOperatorBuilder::kFloat64RoundTruncate | 1830 MachineOperatorBuilder::kFloat64RoundTruncate |
1827 MachineOperatorBuilder::kFloat32RoundTiesEven | 1831 MachineOperatorBuilder::kFloat32RoundTiesEven |
1828 MachineOperatorBuilder::kFloat64RoundTiesEven; 1832 MachineOperatorBuilder::kFloat64RoundTiesEven;
1829 } 1833 }
1830 return flags; 1834 return flags;
1831 } 1835 }
1832 1836
1833 } // namespace compiler 1837 } // namespace compiler
1834 } // namespace internal 1838 } // namespace internal
1835 } // namespace v8 1839 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698