Index: src/compiler/machine-operator.cc |
diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc |
index 0fb1c840ab4d762232dec0d56f0d40dc8639e33f..0b20cb7d49275ec397c2f945250c559f9bb14ef3 100644 |
--- a/src/compiler/machine-operator.cc |
+++ b/src/compiler/machine-operator.cc |
@@ -249,8 +249,6 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { |
V(Int32x4Mul, Operator::kCommutative, 2, 0, 1) \ |
V(Int32x4Min, Operator::kCommutative, 2, 0, 1) \ |
V(Int32x4Max, Operator::kCommutative, 2, 0, 1) \ |
- V(Int32x4ShiftLeftByScalar, Operator::kNoProperties, 2, 0, 1) \ |
- V(Int32x4ShiftRightByScalar, Operator::kNoProperties, 2, 0, 1) \ |
V(Int32x4Equal, Operator::kCommutative, 2, 0, 1) \ |
V(Int32x4NotEqual, Operator::kCommutative, 2, 0, 1) \ |
V(Int32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ |
@@ -260,16 +258,12 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { |
V(Int32x4FromFloat32x4, Operator::kNoProperties, 1, 0, 1) \ |
V(Uint32x4Min, Operator::kCommutative, 2, 0, 1) \ |
V(Uint32x4Max, Operator::kCommutative, 2, 0, 1) \ |
- V(Uint32x4ShiftLeftByScalar, Operator::kNoProperties, 2, 0, 1) \ |
- V(Uint32x4ShiftRightByScalar, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint32x4GreaterThan, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint32x4GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint32x4FromFloat32x4, Operator::kNoProperties, 1, 0, 1) \ |
V(CreateBool32x4, Operator::kNoProperties, 4, 0, 1) \ |
- V(Bool32x4ExtractLane, Operator::kNoProperties, 2, 0, 1) \ |
- V(Bool32x4ReplaceLane, Operator::kNoProperties, 3, 0, 1) \ |
V(Bool32x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
V(Bool32x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
V(Bool32x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
@@ -289,8 +283,6 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { |
V(Int16x8Mul, Operator::kCommutative, 2, 0, 1) \ |
V(Int16x8Min, Operator::kCommutative, 2, 0, 1) \ |
V(Int16x8Max, Operator::kCommutative, 2, 0, 1) \ |
- V(Int16x8ShiftLeftByScalar, Operator::kNoProperties, 2, 0, 1) \ |
- V(Int16x8ShiftRightByScalar, Operator::kNoProperties, 2, 0, 1) \ |
V(Int16x8Equal, Operator::kCommutative, 2, 0, 1) \ |
V(Int16x8NotEqual, Operator::kCommutative, 2, 0, 1) \ |
V(Int16x8LessThan, Operator::kNoProperties, 2, 0, 1) \ |
@@ -304,15 +296,11 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { |
V(Uint16x8SubSaturate, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint16x8Min, Operator::kCommutative, 2, 0, 1) \ |
V(Uint16x8Max, Operator::kCommutative, 2, 0, 1) \ |
- V(Uint16x8ShiftLeftByScalar, Operator::kNoProperties, 2, 0, 1) \ |
- V(Uint16x8ShiftRightByScalar, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint16x8LessThan, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint16x8LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint16x8GreaterThan, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint16x8GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ |
V(CreateBool16x8, Operator::kNoProperties, 8, 0, 1) \ |
- V(Bool16x8ExtractLane, Operator::kNoProperties, 2, 0, 1) \ |
- V(Bool16x8ReplaceLane, Operator::kNoProperties, 3, 0, 1) \ |
V(Bool16x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
V(Bool16x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
V(Bool16x8Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
@@ -332,8 +320,6 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { |
V(Int8x16Mul, Operator::kCommutative, 2, 0, 1) \ |
V(Int8x16Min, Operator::kCommutative, 2, 0, 1) \ |
V(Int8x16Max, Operator::kCommutative, 2, 0, 1) \ |
- V(Int8x16ShiftLeftByScalar, Operator::kNoProperties, 2, 0, 1) \ |
- V(Int8x16ShiftRightByScalar, Operator::kNoProperties, 2, 0, 1) \ |
V(Int8x16Equal, Operator::kCommutative, 2, 0, 1) \ |
V(Int8x16NotEqual, Operator::kCommutative, 2, 0, 1) \ |
V(Int8x16LessThan, Operator::kNoProperties, 2, 0, 1) \ |
@@ -347,15 +333,11 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { |
V(Uint8x16SubSaturate, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint8x16Min, Operator::kCommutative, 2, 0, 1) \ |
V(Uint8x16Max, Operator::kCommutative, 2, 0, 1) \ |
- V(Uint8x16ShiftLeftByScalar, Operator::kNoProperties, 2, 0, 1) \ |
- V(Uint8x16ShiftRightByScalar, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint8x16LessThan, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint8x16LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint8x16GreaterThan, Operator::kNoProperties, 2, 0, 1) \ |
V(Uint8x16GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ |
V(CreateBool8x16, Operator::kNoProperties, 16, 0, 1) \ |
- V(Bool8x16ExtractLane, Operator::kNoProperties, 2, 0, 1) \ |
- V(Bool8x16ReplaceLane, Operator::kNoProperties, 3, 0, 1) \ |
V(Bool8x16And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
V(Bool8x16Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
V(Bool8x16Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
@@ -453,8 +435,16 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { |
#define SIMD_LANE_OP_LIST(V) \ |
V(Float32x4, 4) \ |
V(Int32x4, 4) \ |
+ V(Bool32x4, 4) \ |
V(Int16x8, 8) \ |
- V(Int8x16, 16) |
+ V(Bool16x8, 8) \ |
+ V(Int8x16, 16) \ |
+ V(Bool8x16, 16) |
+ |
+#define SIMD_SHIFT_OP_LIST(V) \ |
+ V(32x4, 32) \ |
+ V(16x8, 16) \ |
+ V(8x16, 8) |
#define STACK_SLOT_CACHED_SIZES_LIST(V) V(4) V(8) V(16) |
@@ -632,24 +622,6 @@ struct MachineOperatorGlobalCache { |
ATOMIC_REPRESENTATION_LIST(ATOMIC_STORE) |
#undef STORE |
-#define SIMD_LANE_OPS(Name, lane_count) \ |
- struct Name##ExtractLaneOperator final : public Operator1<int> { \ |
- static int lane_number; \ |
- Name##ExtractLaneOperator() \ |
- : Operator1<int>(IrOpcode::k##Name##ExtractLane, Operator::kPure, \ |
- "ExtractLane", 1, 0, 0, 1, 0, 0, lane_number++) {} \ |
- }; \ |
- struct Name##ReplaceLaneOperator final : public Operator1<int> { \ |
- static int lane_number; \ |
- Name##ReplaceLaneOperator() \ |
- : Operator1<int>(IrOpcode::k##Name##ReplaceLane, Operator::kPure, \ |
- "ReplaceLane", 2, 0, 0, 1, 0, 0, lane_number++) {} \ |
- }; \ |
- Name##ExtractLaneOperator k##Name##ExtractLane[lane_count]; \ |
- Name##ReplaceLaneOperator k##Name##ReplaceLane[lane_count]; |
- SIMD_LANE_OP_LIST(SIMD_LANE_OPS) |
-#undef SIMD_LANE_OPS |
- |
struct DebugBreakOperator : public Operator { |
DebugBreakOperator() |
: Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0, |
@@ -877,22 +849,49 @@ const Operator* MachineOperatorBuilder::AtomicStore(MachineRepresentation rep) { |
return nullptr; |
} |
-#define SIMD_LANE_OPS(Name, lane_count) \ |
- const Operator* MachineOperatorBuilder::Name##ExtractLane( \ |
- int32_t lane_number) { \ |
- DCHECK(0 <= lane_number && lane_number < lane_count); \ |
- return &cache_.k##Name##ExtractLane[lane_number]; \ |
- } \ |
- const Operator* MachineOperatorBuilder::Name##ReplaceLane( \ |
- int32_t lane_number) { \ |
- DCHECK(0 <= lane_number && lane_number < lane_count); \ |
- return &cache_.k##Name##ReplaceLane[lane_number]; \ |
- } \ |
- int MachineOperatorGlobalCache::Name##ExtractLaneOperator::lane_number = 0; \ |
- int MachineOperatorGlobalCache::Name##ReplaceLaneOperator::lane_number = 0; |
+#define SIMD_LANE_OPS(Type, lane_count) \ |
+ const Operator* MachineOperatorBuilder::Type##ExtractLane( \ |
+ int32_t lane_index) { \ |
+ DCHECK(0 <= lane_index && lane_index < lane_count); \ |
+ return new (zone_) \ |
+ Operator1<int32_t>(IrOpcode::k##Type##ExtractLane, Operator::kPure, \ |
+ "Extract lane", 1, 0, 0, 1, 0, 0, lane_index); \ |
+ } \ |
+ const Operator* MachineOperatorBuilder::Type##ReplaceLane( \ |
+ int32_t lane_index) { \ |
+ DCHECK(0 <= lane_index && lane_index < lane_count); \ |
+ return new (zone_) \ |
+ Operator1<int32_t>(IrOpcode::k##Type##ReplaceLane, Operator::kPure, \ |
+ "Replace lane", 2, 0, 0, 1, 0, 0, lane_index); \ |
+ } |
SIMD_LANE_OP_LIST(SIMD_LANE_OPS) |
#undef SIMD_LANE_OPS |
+#define SIMD_SHIFT_OPS(format, bits) \ |
+ const Operator* MachineOperatorBuilder::Int##format##ShiftLeftByScalar( \ |
+ int32_t shift) { \ |
+ DCHECK(0 <= shift && shift < bits); \ |
+ return new (zone_) Operator1<int32_t>( \ |
+ IrOpcode::kInt##format##ShiftLeftByScalar, Operator::kPure, \ |
+ "Shift left", 1, 0, 0, 1, 0, 0, shift); \ |
+ } \ |
+ const Operator* MachineOperatorBuilder::Int##format##ShiftRightByScalar( \ |
+ int32_t shift) { \ |
+ DCHECK(0 < shift && shift <= bits); \ |
+ return new (zone_) Operator1<int32_t>( \ |
+ IrOpcode::kInt##format##ShiftRightByScalar, Operator::kPure, \ |
+ "Arithmetic shift right", 1, 0, 0, 1, 0, 0, shift); \ |
+ } \ |
+ const Operator* MachineOperatorBuilder::Uint##format##ShiftRightByScalar( \ |
+ int32_t shift) { \ |
+ DCHECK(0 <= shift && shift < bits); \ |
+ return new (zone_) Operator1<int32_t>( \ |
+ IrOpcode::kUint##format##ShiftRightByScalar, Operator::kPure, \ |
+ "Shift right", 1, 0, 0, 1, 0, 0, shift); \ |
+ } |
+SIMD_SHIFT_OP_LIST(SIMD_SHIFT_OPS) |
+#undef SIMD_SHIFT_OPS |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |