| 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/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
| 6 | 6 |
| 7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
| 8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
| 9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
| 10 | 10 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 V(I8x16MaxU, Operator::kCommutative, 2, 0, 1) \ | 310 V(I8x16MaxU, Operator::kCommutative, 2, 0, 1) \ |
| 311 V(I8x16LtU, Operator::kNoProperties, 2, 0, 1) \ | 311 V(I8x16LtU, Operator::kNoProperties, 2, 0, 1) \ |
| 312 V(I8x16LeU, Operator::kNoProperties, 2, 0, 1) \ | 312 V(I8x16LeU, Operator::kNoProperties, 2, 0, 1) \ |
| 313 V(S128Load, Operator::kNoProperties, 2, 0, 1) \ | 313 V(S128Load, Operator::kNoProperties, 2, 0, 1) \ |
| 314 V(S128Store, Operator::kNoProperties, 3, 0, 1) \ | 314 V(S128Store, Operator::kNoProperties, 3, 0, 1) \ |
| 315 V(S128Zero, Operator::kNoProperties, 0, 0, 1) \ | 315 V(S128Zero, Operator::kNoProperties, 0, 0, 1) \ |
| 316 V(S128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 316 V(S128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 317 V(S128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 317 V(S128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 318 V(S128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 318 V(S128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 319 V(S128Not, Operator::kNoProperties, 1, 0, 1) \ | 319 V(S128Not, Operator::kNoProperties, 1, 0, 1) \ |
| 320 V(S32x4ZipLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 321 V(S32x4ZipRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 322 V(S32x4UnzipLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 323 V(S32x4UnzipRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 324 V(S32x4TransposeLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 325 V(S32x4TransposeRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 326 V(S32x4Select, Operator::kNoProperties, 3, 0, 1) \ | 320 V(S32x4Select, Operator::kNoProperties, 3, 0, 1) \ |
| 327 V(S16x8ZipLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 328 V(S16x8ZipRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 329 V(S16x8UnzipLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 330 V(S16x8UnzipRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 331 V(S16x8TransposeLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 332 V(S16x8TransposeRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 333 V(S16x8Select, Operator::kNoProperties, 3, 0, 1) \ | 321 V(S16x8Select, Operator::kNoProperties, 3, 0, 1) \ |
| 334 V(S8x16ZipLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 335 V(S8x16ZipRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 336 V(S8x16UnzipLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 337 V(S8x16UnzipRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 338 V(S8x16TransposeLeft, Operator::kNoProperties, 2, 0, 1) \ | |
| 339 V(S8x16TransposeRight, Operator::kNoProperties, 2, 0, 1) \ | |
| 340 V(S8x16Select, Operator::kNoProperties, 3, 0, 1) \ | 322 V(S8x16Select, Operator::kNoProperties, 3, 0, 1) \ |
| 341 V(S32x2Reverse, Operator::kNoProperties, 1, 0, 1) \ | |
| 342 V(S16x4Reverse, Operator::kNoProperties, 1, 0, 1) \ | |
| 343 V(S16x2Reverse, Operator::kNoProperties, 1, 0, 1) \ | |
| 344 V(S8x8Reverse, Operator::kNoProperties, 1, 0, 1) \ | |
| 345 V(S8x4Reverse, Operator::kNoProperties, 1, 0, 1) \ | |
| 346 V(S8x2Reverse, Operator::kNoProperties, 1, 0, 1) \ | |
| 347 V(S1x4Zero, Operator::kNoProperties, 0, 0, 1) \ | 323 V(S1x4Zero, Operator::kNoProperties, 0, 0, 1) \ |
| 348 V(S1x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 324 V(S1x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 349 V(S1x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 325 V(S1x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 350 V(S1x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 326 V(S1x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 351 V(S1x4Not, Operator::kNoProperties, 1, 0, 1) \ | 327 V(S1x4Not, Operator::kNoProperties, 1, 0, 1) \ |
| 352 V(S1x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \ | 328 V(S1x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \ |
| 353 V(S1x4AllTrue, Operator::kNoProperties, 1, 0, 1) \ | 329 V(S1x4AllTrue, Operator::kNoProperties, 1, 0, 1) \ |
| 354 V(S1x8Zero, Operator::kNoProperties, 0, 0, 1) \ | 330 V(S1x8Zero, Operator::kNoProperties, 0, 0, 1) \ |
| 355 V(S1x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 331 V(S1x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 356 V(S1x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 332 V(S1x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 } \ | 997 } \ |
| 1022 const Operator* MachineOperatorBuilder::I##format##ShrU(int32_t shift) { \ | 998 const Operator* MachineOperatorBuilder::I##format##ShrU(int32_t shift) { \ |
| 1023 DCHECK(0 <= shift && shift < bits); \ | 999 DCHECK(0 <= shift && shift < bits); \ |
| 1024 return new (zone_) \ | 1000 return new (zone_) \ |
| 1025 Operator1<int32_t>(IrOpcode::kI##format##ShrU, Operator::kPure, \ | 1001 Operator1<int32_t>(IrOpcode::kI##format##ShrU, Operator::kPure, \ |
| 1026 "Shift right", 1, 0, 0, 1, 0, 0, shift); \ | 1002 "Shift right", 1, 0, 0, 1, 0, 0, shift); \ |
| 1027 } | 1003 } |
| 1028 SIMD_FORMAT_LIST(SIMD_SHIFT_OPS) | 1004 SIMD_FORMAT_LIST(SIMD_SHIFT_OPS) |
| 1029 #undef SIMD_SHIFT_OPS | 1005 #undef SIMD_SHIFT_OPS |
| 1030 | 1006 |
| 1031 const Operator* MachineOperatorBuilder::S8x16Concat(int32_t bytes) { | 1007 const Operator* MachineOperatorBuilder::S32x4Shuffle(uint8_t shuffle[16]) { |
| 1032 DCHECK(0 <= bytes && bytes < kSimd128Size); | 1008 uint8_t* array = zone_->NewArray<uint8_t>(4); |
| 1033 return new (zone_) Operator1<int32_t>(IrOpcode::kS8x16Concat, Operator::kPure, | 1009 memcpy(array, shuffle, 4); |
| 1034 "Concat", 2, 0, 0, 1, 0, 0, bytes); | 1010 return new (zone_) |
| 1011 Operator1<uint8_t*>(IrOpcode::kS32x4Shuffle, Operator::kPure, "Shuffle", |
| 1012 2, 0, 0, 1, 0, 0, array); |
| 1013 } |
| 1014 |
| 1015 const Operator* MachineOperatorBuilder::S16x8Shuffle(uint8_t shuffle[16]) { |
| 1016 uint8_t* array = zone_->NewArray<uint8_t>(8); |
| 1017 memcpy(array, shuffle, 8); |
| 1018 return new (zone_) |
| 1019 Operator1<uint8_t*>(IrOpcode::kS16x8Shuffle, Operator::kPure, "Shuffle", |
| 1020 2, 0, 0, 1, 0, 0, array); |
| 1021 } |
| 1022 |
| 1023 const Operator* MachineOperatorBuilder::S8x16Shuffle(uint8_t shuffle[16]) { |
| 1024 uint8_t* array = zone_->NewArray<uint8_t>(16); |
| 1025 memcpy(array, shuffle, 16); |
| 1026 return new (zone_) |
| 1027 Operator1<uint8_t*>(IrOpcode::kS8x16Shuffle, Operator::kPure, "Shuffle", |
| 1028 2, 0, 0, 1, 0, 0, array); |
| 1035 } | 1029 } |
| 1036 | 1030 |
| 1037 } // namespace compiler | 1031 } // namespace compiler |
| 1038 } // namespace internal | 1032 } // namespace internal |
| 1039 } // namespace v8 | 1033 } // namespace v8 |
| OLD | NEW |