| 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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
| 6 | 6 |
| 7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
| 8 #include "src/base/lazy-instance.h" | 8 #include "src/base/lazy-instance.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 } else if (op->opcode() == IrOpcode::kMerge) { | 1346 } else if (op->opcode() == IrOpcode::kMerge) { |
| 1347 return Merge(size); | 1347 return Merge(size); |
| 1348 } else if (op->opcode() == IrOpcode::kLoop) { | 1348 } else if (op->opcode() == IrOpcode::kLoop) { |
| 1349 return Loop(size); | 1349 return Loop(size); |
| 1350 } else { | 1350 } else { |
| 1351 UNREACHABLE(); | 1351 UNREACHABLE(); |
| 1352 return nullptr; | 1352 return nullptr; |
| 1353 } | 1353 } |
| 1354 } | 1354 } |
| 1355 | 1355 |
| 1356 const Operator* CommonOperatorBuilder::Float32x4ExtractLane( |
| 1357 int32_t lane_number) { |
| 1358 DCHECK(0 <= lane_number && lane_number < 4); |
| 1359 return new (zone()) Operator1<int32_t>( // -- |
| 1360 IrOpcode::kFloat32x4ExtractLane, Operator::kPure, // opcode |
| 1361 "Float32x4ExtractLane", // name |
| 1362 1, 0, 0, 1, 0, 0, // counts |
| 1363 lane_number); // parameter |
| 1364 } |
| 1365 |
| 1366 const Operator* CommonOperatorBuilder::Float32x4ReplaceLane( |
| 1367 int32_t lane_number) { |
| 1368 DCHECK(0 <= lane_number && lane_number < 4); |
| 1369 return new (zone()) Operator1<int32_t>( // -- |
| 1370 IrOpcode::kFloat32x4ReplaceLane, Operator::kPure, // opcode |
| 1371 "Float32x4ReplaceLane", // name |
| 1372 2, 0, 0, 1, 0, 0, // counts |
| 1373 lane_number); // parameter |
| 1374 } |
| 1375 |
| 1356 const Operator* CommonOperatorBuilder::Int32x4ExtractLane(int32_t lane_number) { | 1376 const Operator* CommonOperatorBuilder::Int32x4ExtractLane(int32_t lane_number) { |
| 1357 DCHECK(0 <= lane_number && lane_number < 4); | 1377 DCHECK(0 <= lane_number && lane_number < 4); |
| 1358 return new (zone()) Operator1<int32_t>( // -- | 1378 return new (zone()) Operator1<int32_t>( // -- |
| 1359 IrOpcode::kInt32x4ExtractLane, Operator::kPure, // opcode | 1379 IrOpcode::kInt32x4ExtractLane, Operator::kPure, // opcode |
| 1360 "Int32x4ExtractLane", // name | 1380 "Int32x4ExtractLane", // name |
| 1361 1, 0, 0, 1, 0, 0, // counts | 1381 1, 0, 0, 1, 0, 0, // counts |
| 1362 lane_number); // parameter | 1382 lane_number); // parameter |
| 1363 } | 1383 } |
| 1364 | 1384 |
| 1365 const Operator* CommonOperatorBuilder::Int32x4ReplaceLane(int32_t lane_number) { | 1385 const Operator* CommonOperatorBuilder::Int32x4ReplaceLane(int32_t lane_number) { |
| 1366 DCHECK(0 <= lane_number && lane_number < 4); | 1386 DCHECK(0 <= lane_number && lane_number < 4); |
| 1367 return new (zone()) Operator1<int32_t>( // -- | 1387 return new (zone()) Operator1<int32_t>( // -- |
| 1368 IrOpcode::kInt32x4ReplaceLane, Operator::kPure, // opcode | 1388 IrOpcode::kInt32x4ReplaceLane, Operator::kPure, // opcode |
| 1369 "Int32x4ReplaceLane", // name | 1389 "Int32x4ReplaceLane", // name |
| 1370 2, 0, 0, 1, 0, 0, // counts | 1390 2, 0, 0, 1, 0, 0, // counts |
| 1371 lane_number); // parameter | 1391 lane_number); // parameter |
| 1372 } | 1392 } |
| 1373 | 1393 |
| 1374 const Operator* CommonOperatorBuilder::Float32x4ExtractLane( | 1394 const Operator* CommonOperatorBuilder::Int16x8ExtractLane(int32_t lane_number) { |
| 1375 int32_t lane_number) { | 1395 DCHECK(0 <= lane_number && lane_number < 8); |
| 1376 DCHECK(0 <= lane_number && lane_number < 4); | 1396 return new (zone()) Operator1<int32_t>( // -- |
| 1377 return new (zone()) Operator1<int32_t>( // -- | 1397 IrOpcode::kInt16x8ExtractLane, Operator::kPure, // opcode |
| 1378 IrOpcode::kFloat32x4ExtractLane, Operator::kPure, // opcode | 1398 "Int16x8ExtractLane", // name |
| 1379 "Float32x4ExtractLane", // name | 1399 1, 0, 0, 1, 0, 0, // counts |
| 1380 1, 0, 0, 1, 0, 0, // counts | 1400 lane_number); // parameter |
| 1381 lane_number); // parameter | |
| 1382 } | 1401 } |
| 1383 | 1402 |
| 1384 const Operator* CommonOperatorBuilder::Float32x4ReplaceLane( | 1403 const Operator* CommonOperatorBuilder::Int16x8ReplaceLane(int32_t lane_number) { |
| 1385 int32_t lane_number) { | 1404 DCHECK(0 <= lane_number && lane_number < 8); |
| 1386 DCHECK(0 <= lane_number && lane_number < 4); | 1405 return new (zone()) Operator1<int32_t>( // -- |
| 1387 return new (zone()) Operator1<int32_t>( // -- | 1406 IrOpcode::kInt16x8ReplaceLane, Operator::kPure, // opcode |
| 1388 IrOpcode::kFloat32x4ReplaceLane, Operator::kPure, // opcode | 1407 "Int16x8ReplaceLane", // name |
| 1389 "Float32x4ReplaceLane", // name | 1408 2, 0, 0, 1, 0, 0, // counts |
| 1390 2, 0, 0, 1, 0, 0, // counts | 1409 lane_number); // parameter |
| 1391 lane_number); // parameter | 1410 } |
| 1411 |
| 1412 const Operator* CommonOperatorBuilder::Int8x16ExtractLane(int32_t lane_number) { |
| 1413 DCHECK(0 <= lane_number && lane_number < 16); |
| 1414 return new (zone()) Operator1<int32_t>( // -- |
| 1415 IrOpcode::kInt8x16ExtractLane, Operator::kPure, // opcode |
| 1416 "Int8x16ExtractLane", // name |
| 1417 1, 0, 0, 1, 0, 0, // counts |
| 1418 lane_number); // parameter |
| 1419 } |
| 1420 |
| 1421 const Operator* CommonOperatorBuilder::Int8x16ReplaceLane(int32_t lane_number) { |
| 1422 DCHECK(0 <= lane_number && lane_number < 16); |
| 1423 return new (zone()) Operator1<int32_t>( // -- |
| 1424 IrOpcode::kInt8x16ReplaceLane, Operator::kPure, // opcode |
| 1425 "Int8x16ReplaceLane", // name |
| 1426 2, 0, 0, 1, 0, 0, // counts |
| 1427 lane_number); // parameter |
| 1392 } | 1428 } |
| 1393 | 1429 |
| 1394 const FrameStateFunctionInfo* | 1430 const FrameStateFunctionInfo* |
| 1395 CommonOperatorBuilder::CreateFrameStateFunctionInfo( | 1431 CommonOperatorBuilder::CreateFrameStateFunctionInfo( |
| 1396 FrameStateType type, int parameter_count, int local_count, | 1432 FrameStateType type, int parameter_count, int local_count, |
| 1397 Handle<SharedFunctionInfo> shared_info) { | 1433 Handle<SharedFunctionInfo> shared_info) { |
| 1398 return new (zone()->New(sizeof(FrameStateFunctionInfo))) | 1434 return new (zone()->New(sizeof(FrameStateFunctionInfo))) |
| 1399 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); | 1435 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); |
| 1400 } | 1436 } |
| 1401 | 1437 |
| 1402 } // namespace compiler | 1438 } // namespace compiler |
| 1403 } // namespace internal | 1439 } // namespace internal |
| 1404 } // namespace v8 | 1440 } // namespace v8 |
| OLD | NEW |