Commit df9deb53 authored by bbudge's avatar bbudge Committed by Commit bot

[Turbofan] Canonicalize SIMD 32x4 Select, Swizzle, and Shuffle.

- These operations are identical for Float32x4 and Int32x4.
- Make them generic, following the naming for generic Simd128 / S128
opcodes.
- F32x4/I32x4 -> S32x4, similarly to S128
- Float32x4/Int32x4 -> Simd32x4, similarly to Simd128.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2543773002
Cr-Commit-Position: refs/heads/master@{#41437}
parent 62d19db5
......@@ -307,8 +307,7 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
#define DECLARE_GENERATOR(x) void Visit##x(Node* node);
MACHINE_OP_LIST(DECLARE_GENERATOR)
MACHINE_SIMD_RETURN_NUM_OP_LIST(DECLARE_GENERATOR)
MACHINE_SIMD_RETURN_SIMD_OP_LIST(DECLARE_GENERATOR)
MACHINE_SIMD_OP_LIST(DECLARE_GENERATOR)
#undef DECLARE_GENERATOR
void VisitFinishRegion(Node* node);
......
......@@ -242,9 +242,6 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
V(Float32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
V(Float32x4GreaterThan, Operator::kNoProperties, 2, 0, 1) \
V(Float32x4GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
V(Float32x4Select, Operator::kNoProperties, 3, 0, 1) \
V(Float32x4Swizzle, Operator::kNoProperties, 5, 0, 1) \
V(Float32x4Shuffle, Operator::kNoProperties, 6, 0, 1) \
V(Float32x4FromInt32x4, Operator::kNoProperties, 1, 0, 1) \
V(Float32x4FromUint32x4, Operator::kNoProperties, 1, 0, 1) \
V(CreateInt32x4, Operator::kNoProperties, 4, 0, 1) \
......@@ -264,9 +261,6 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
V(Int32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
V(Int32x4GreaterThan, Operator::kNoProperties, 2, 0, 1) \
V(Int32x4GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \
V(Int32x4Select, Operator::kNoProperties, 3, 0, 1) \
V(Int32x4Swizzle, Operator::kNoProperties, 5, 0, 1) \
V(Int32x4Shuffle, Operator::kNoProperties, 6, 0, 1) \
V(Int32x4FromFloat32x4, Operator::kNoProperties, 1, 0, 1) \
V(Uint32x4Min, Operator::kCommutative, 2, 0, 1) \
V(Uint32x4Max, Operator::kCommutative, 2, 0, 1) \
......@@ -391,7 +385,10 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
V(Simd128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
V(Simd128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
V(Simd128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
V(Simd128Not, Operator::kNoProperties, 1, 0, 1)
V(Simd128Not, Operator::kNoProperties, 1, 0, 1) \
V(Simd32x4Select, Operator::kNoProperties, 3, 0, 1) \
V(Simd32x4Swizzle, Operator::kNoProperties, 5, 0, 1) \
V(Simd32x4Shuffle, Operator::kNoProperties, 6, 0, 1)
#define PURE_OPTIONAL_OP_LIST(V) \
V(Word32Ctz, Operator::kNoProperties, 1, 0, 1) \
......
......@@ -447,9 +447,6 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
const Operator* Float32x4LessThanOrEqual();
const Operator* Float32x4GreaterThan();
const Operator* Float32x4GreaterThanOrEqual();
const Operator* Float32x4Select();
const Operator* Float32x4Swizzle();
const Operator* Float32x4Shuffle();
const Operator* Float32x4FromInt32x4();
const Operator* Float32x4FromUint32x4();
......@@ -470,9 +467,6 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
const Operator* Int32x4LessThanOrEqual();
const Operator* Int32x4GreaterThan();
const Operator* Int32x4GreaterThanOrEqual();
const Operator* Int32x4Select();
const Operator* Int32x4Swizzle();
const Operator* Int32x4Shuffle();
const Operator* Int32x4FromFloat32x4();
const Operator* Uint32x4Min();
......@@ -607,6 +601,9 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final
const Operator* Simd128Or();
const Operator* Simd128Xor();
const Operator* Simd128Not();
const Operator* Simd32x4Select();
const Operator* Simd32x4Swizzle();
const Operator* Simd32x4Shuffle();
// load [base + index]
const Operator* Load(LoadRepresentation rep);
......
......@@ -555,9 +555,6 @@
V(Float32x4LessThanOrEqual) \
V(Float32x4GreaterThan) \
V(Float32x4GreaterThanOrEqual) \
V(Float32x4Select) \
V(Float32x4Swizzle) \
V(Float32x4Shuffle) \
V(Float32x4FromInt32x4) \
V(Float32x4FromUint32x4) \
V(CreateInt32x4) \
......@@ -576,9 +573,6 @@
V(Int32x4LessThanOrEqual) \
V(Int32x4GreaterThan) \
V(Int32x4GreaterThanOrEqual) \
V(Int32x4Select) \
V(Int32x4Swizzle) \
V(Int32x4Shuffle) \
V(Int32x4FromFloat32x4) \
V(Uint32x4Min) \
V(Uint32x4Max) \
......@@ -711,7 +705,10 @@
V(Simd128And) \
V(Simd128Or) \
V(Simd128Xor) \
V(Simd128Not)
V(Simd128Not) \
V(Simd32x4Select) \
V(Simd32x4Swizzle) \
V(Simd32x4Shuffle)
#define MACHINE_SIMD_OP_LIST(V) \
MACHINE_SIMD_RETURN_SIMD_OP_LIST(V) \
......
......@@ -296,9 +296,6 @@ const WasmCodePosition kNoCodePosition = -1;
V(F32x4Le, 0xe513, s_ss) \
V(F32x4Gt, 0xe514, s_ss) \
V(F32x4Ge, 0xe515, s_ss) \
V(F32x4Select, 0xe516, s_sss) \
V(F32x4Swizzle, 0xe517, s_s) \
V(F32x4Shuffle, 0xe518, s_ss) \
V(F32x4FromInt32x4, 0xe519, s_s) \
V(F32x4FromUint32x4, 0xe51a, s_s) \
V(I32x4Splat, 0xe51b, s_i) \
......@@ -392,7 +389,10 @@ const WasmCodePosition kNoCodePosition = -1;
V(S128And, 0xe576, s_ss) \
V(S128Ior, 0xe577, s_ss) \
V(S128Xor, 0xe578, s_ss) \
V(S128Not, 0xe579, s_s)
V(S128Not, 0xe579, s_s) \
V(S32x4Select, 0xe580, s_sss) \
V(S32x4Swizzle, 0xe581, s_s) \
V(S32x4Shuffle, 0xe582, s_ss)
#define FOREACH_SIMD_1_OPERAND_OPCODE(V) \
V(F32x4ExtractLane, 0xe501, _) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment