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/base/adapters.h" | 5 #include "src/base/adapters.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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 case MachineRepresentation::kWord8: | 183 case MachineRepresentation::kWord8: |
184 opcode = load_rep.IsSigned() ? kIA32Movsxbl : kIA32Movzxbl; | 184 opcode = load_rep.IsSigned() ? kIA32Movsxbl : kIA32Movzxbl; |
185 break; | 185 break; |
186 case MachineRepresentation::kWord16: | 186 case MachineRepresentation::kWord16: |
187 opcode = load_rep.IsSigned() ? kIA32Movsxwl : kIA32Movzxwl; | 187 opcode = load_rep.IsSigned() ? kIA32Movsxwl : kIA32Movzxwl; |
188 break; | 188 break; |
189 case MachineRepresentation::kTagged: // Fall through. | 189 case MachineRepresentation::kTagged: // Fall through. |
190 case MachineRepresentation::kWord32: | 190 case MachineRepresentation::kWord32: |
191 opcode = kIA32Movl; | 191 opcode = kIA32Movl; |
192 break; | 192 break; |
193 case MachineRepresentation::kWord64: // Fall through. | 193 case MachineRepresentation::kWord64: // Fall through. |
| 194 case MachineRepresentation::kSimd128: // Fall through. |
194 case MachineRepresentation::kNone: | 195 case MachineRepresentation::kNone: |
195 UNREACHABLE(); | 196 UNREACHABLE(); |
196 return; | 197 return; |
197 } | 198 } |
198 | 199 |
199 IA32OperandGenerator g(this); | 200 IA32OperandGenerator g(this); |
200 InstructionOperand outputs[1]; | 201 InstructionOperand outputs[1]; |
201 outputs[0] = g.DefineAsRegister(node); | 202 outputs[0] = g.DefineAsRegister(node); |
202 InstructionOperand inputs[3]; | 203 InstructionOperand inputs[3]; |
203 size_t input_count = 0; | 204 size_t input_count = 0; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 case MachineRepresentation::kWord8: | 269 case MachineRepresentation::kWord8: |
269 opcode = kIA32Movb; | 270 opcode = kIA32Movb; |
270 break; | 271 break; |
271 case MachineRepresentation::kWord16: | 272 case MachineRepresentation::kWord16: |
272 opcode = kIA32Movw; | 273 opcode = kIA32Movw; |
273 break; | 274 break; |
274 case MachineRepresentation::kTagged: // Fall through. | 275 case MachineRepresentation::kTagged: // Fall through. |
275 case MachineRepresentation::kWord32: | 276 case MachineRepresentation::kWord32: |
276 opcode = kIA32Movl; | 277 opcode = kIA32Movl; |
277 break; | 278 break; |
278 case MachineRepresentation::kWord64: // Fall through. | 279 case MachineRepresentation::kWord64: // Fall through. |
| 280 case MachineRepresentation::kSimd128: // Fall through. |
279 case MachineRepresentation::kNone: | 281 case MachineRepresentation::kNone: |
280 UNREACHABLE(); | 282 UNREACHABLE(); |
281 return; | 283 return; |
282 } | 284 } |
283 | 285 |
284 InstructionOperand val; | 286 InstructionOperand val; |
285 if (g.CanBeImmediate(value)) { | 287 if (g.CanBeImmediate(value)) { |
286 val = g.UseImmediate(value); | 288 val = g.UseImmediate(value); |
287 } else if (rep == MachineRepresentation::kWord8 || | 289 } else if (rep == MachineRepresentation::kWord8 || |
288 rep == MachineRepresentation::kBit) { | 290 rep == MachineRepresentation::kBit) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 break; | 322 break; |
321 case MachineRepresentation::kWord32: | 323 case MachineRepresentation::kWord32: |
322 opcode = kCheckedLoadWord32; | 324 opcode = kCheckedLoadWord32; |
323 break; | 325 break; |
324 case MachineRepresentation::kFloat32: | 326 case MachineRepresentation::kFloat32: |
325 opcode = kCheckedLoadFloat32; | 327 opcode = kCheckedLoadFloat32; |
326 break; | 328 break; |
327 case MachineRepresentation::kFloat64: | 329 case MachineRepresentation::kFloat64: |
328 opcode = kCheckedLoadFloat64; | 330 opcode = kCheckedLoadFloat64; |
329 break; | 331 break; |
330 case MachineRepresentation::kBit: // Fall through. | 332 case MachineRepresentation::kBit: // Fall through. |
331 case MachineRepresentation::kTagged: // Fall through. | 333 case MachineRepresentation::kTagged: // Fall through. |
332 case MachineRepresentation::kWord64: // Fall through. | 334 case MachineRepresentation::kWord64: // Fall through. |
| 335 case MachineRepresentation::kSimd128: // Fall through. |
333 case MachineRepresentation::kNone: | 336 case MachineRepresentation::kNone: |
334 UNREACHABLE(); | 337 UNREACHABLE(); |
335 return; | 338 return; |
336 } | 339 } |
337 InstructionOperand offset_operand = g.UseRegister(offset); | 340 InstructionOperand offset_operand = g.UseRegister(offset); |
338 InstructionOperand length_operand = | 341 InstructionOperand length_operand = |
339 g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); | 342 g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); |
340 if (g.CanBeImmediate(buffer)) { | 343 if (g.CanBeImmediate(buffer)) { |
341 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 344 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
342 g.DefineAsRegister(node), offset_operand, length_operand, | 345 g.DefineAsRegister(node), offset_operand, length_operand, |
(...skipping 23 matching lines...) Expand all Loading... |
366 break; | 369 break; |
367 case MachineRepresentation::kWord32: | 370 case MachineRepresentation::kWord32: |
368 opcode = kCheckedStoreWord32; | 371 opcode = kCheckedStoreWord32; |
369 break; | 372 break; |
370 case MachineRepresentation::kFloat32: | 373 case MachineRepresentation::kFloat32: |
371 opcode = kCheckedStoreFloat32; | 374 opcode = kCheckedStoreFloat32; |
372 break; | 375 break; |
373 case MachineRepresentation::kFloat64: | 376 case MachineRepresentation::kFloat64: |
374 opcode = kCheckedStoreFloat64; | 377 opcode = kCheckedStoreFloat64; |
375 break; | 378 break; |
376 case MachineRepresentation::kBit: // Fall through. | 379 case MachineRepresentation::kBit: // Fall through. |
377 case MachineRepresentation::kTagged: // Fall through. | 380 case MachineRepresentation::kTagged: // Fall through. |
378 case MachineRepresentation::kWord64: // Fall through. | 381 case MachineRepresentation::kWord64: // Fall through. |
| 382 case MachineRepresentation::kSimd128: // Fall through. |
379 case MachineRepresentation::kNone: | 383 case MachineRepresentation::kNone: |
380 UNREACHABLE(); | 384 UNREACHABLE(); |
381 return; | 385 return; |
382 } | 386 } |
383 InstructionOperand value_operand = | 387 InstructionOperand value_operand = |
384 g.CanBeImmediate(value) ? g.UseImmediate(value) | 388 g.CanBeImmediate(value) ? g.UseImmediate(value) |
385 : ((rep == MachineRepresentation::kWord8 || | 389 : ((rep == MachineRepresentation::kWord8 || |
386 rep == MachineRepresentation::kBit) | 390 rep == MachineRepresentation::kBit) |
387 ? g.UseByteRegister(value) | 391 ? g.UseByteRegister(value) |
388 : g.UseRegister(value)); | 392 : g.UseRegister(value)); |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 MachineOperatorBuilder::kFloat64RoundTruncate | | 1357 MachineOperatorBuilder::kFloat64RoundTruncate | |
1354 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1358 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1355 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1359 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1356 } | 1360 } |
1357 return flags; | 1361 return flags; |
1358 } | 1362 } |
1359 | 1363 |
1360 } // namespace compiler | 1364 } // namespace compiler |
1361 } // namespace internal | 1365 } // namespace internal |
1362 } // namespace v8 | 1366 } // namespace v8 |
OLD | NEW |