summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/simd-scalar-lowering.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/simd-scalar-lowering.cc')
-rw-r--r--deps/v8/src/compiler/simd-scalar-lowering.cc50
1 files changed, 38 insertions, 12 deletions
diff --git a/deps/v8/src/compiler/simd-scalar-lowering.cc b/deps/v8/src/compiler/simd-scalar-lowering.cc
index f9bf22f8be..445898d882 100644
--- a/deps/v8/src/compiler/simd-scalar-lowering.cc
+++ b/deps/v8/src/compiler/simd-scalar-lowering.cc
@@ -114,6 +114,8 @@ void SimdScalarLowering::LowerGraph() {
V(I64x2Splat) \
V(I64x2ExtractLane) \
V(I64x2ReplaceLane) \
+ V(I64x2Eq) \
+ V(I64x2Ne) \
V(I64x2Neg) \
V(I64x2Shl) \
V(I64x2ShrS) \
@@ -166,11 +168,10 @@ void SimdScalarLowering::LowerGraph() {
V(S128Not) \
V(S128AndNot) \
V(S128Select) \
- V(V32x4AnyTrue) \
+ V(V64x2AllTrue) \
V(V32x4AllTrue) \
- V(V16x8AnyTrue) \
V(V16x8AllTrue) \
- V(V8x16AnyTrue) \
+ V(V128AnyTrue) \
V(V8x16AllTrue) \
V(I32x4BitMask) \
V(I32x4ExtMulLowI16x8S) \
@@ -1188,7 +1189,7 @@ Node* SimdScalarLowering::ConstructPhiForComparison(Diamond d,
int false_value) {
// Close the given Diamond d using a Phi node, taking care of constructing the
// right kind of constants (Int32 or Int64) based on rep_type.
- if (rep_type == SimdType::kFloat64x2) {
+ if (rep_type == SimdType::kFloat64x2 || rep_type == SimdType::kInt64x2) {
MachineRepresentation rep = MachineRepresentation::kWord64;
return d.Phi(rep, mcgraph_->Int64Constant(true_value),
mcgraph_->Int64Constant(false_value));
@@ -1261,15 +1262,33 @@ void SimdScalarLowering::LowerAllTrueOp(Node* node, SimdType rep_type) {
int num_lanes = NumLanes(rep_type);
DCHECK_EQ(1, node->InputCount());
Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type);
+ Node* zero;
+ Node* tmp_result;
+ MachineRepresentation result_rep = MachineRepresentation::kWord32;
+ const Operator* equals;
+
+ if (SimdType::kInt64x2 == rep_type) {
+ zero = mcgraph_->Int64Constant(0);
+ tmp_result = mcgraph_->Int64Constant(1);
+ result_rep = MachineRepresentation::kWord64;
+ equals = machine()->Word64Equal();
+ } else {
+ zero = mcgraph_->Int32Constant(0);
+ tmp_result = mcgraph_->Int32Constant(1);
+ equals = machine()->Word32Equal();
+ }
Node** rep_node = zone()->NewArray<Node*>(num_lanes);
- Node* zero = mcgraph_->Int32Constant(0);
- Node* tmp_result = mcgraph_->Int32Constant(1);
for (int i = 0; i < num_lanes; ++i) {
- Diamond d(graph(), common(),
- graph()->NewNode(machine()->Word32Equal(), rep[i], zero));
- tmp_result = d.Phi(MachineRepresentation::kWord32, zero, tmp_result);
+ Diamond d(graph(), common(), graph()->NewNode(equals, rep[i], zero));
+ tmp_result = d.Phi(result_rep, zero, tmp_result);
+ }
+
+ if (SimdType::kInt64x2 == rep_type) {
+ tmp_result =
+ graph()->NewNode(machine()->TruncateInt64ToInt32(), tmp_result);
}
+
rep_node[0] = tmp_result;
ReplaceNode(node, rep_node, 1);
}
@@ -2102,6 +2121,7 @@ void SimdScalarLowering::LowerNode(Node* node) {
COMPARISON_CASE(Float32x4, kF32x4Le, Float32LessThanOrEqual, false)
COMPARISON_CASE(Float32x4, kF32x4Gt, Float32LessThan, true)
COMPARISON_CASE(Float32x4, kF32x4Ge, Float32LessThanOrEqual, true)
+ COMPARISON_CASE(Int64x2, kI64x2Eq, Word64Equal, false)
COMPARISON_CASE(Int32x4, kI32x4Eq, Word32Equal, false)
COMPARISON_CASE(Int32x4, kI32x4LtS, Int32LessThan, false)
COMPARISON_CASE(Int32x4, kI32x4LeS, Int32LessThanOrEqual, false)
@@ -2138,6 +2158,10 @@ void SimdScalarLowering::LowerNode(Node* node) {
LowerNotEqual(node, SimdType::kFloat32x4, machine()->Float32Equal());
break;
}
+ case IrOpcode::kI64x2Ne: {
+ LowerNotEqual(node, SimdType::kInt64x2, machine()->Word64Equal());
+ break;
+ }
case IrOpcode::kI32x4Ne: {
LowerNotEqual(node, SimdType::kInt32x4, machine()->Word32Equal());
break;
@@ -2220,9 +2244,7 @@ void SimdScalarLowering::LowerNode(Node* node) {
ReplaceNode(node, rep_node, 16);
break;
}
- case IrOpcode::kV32x4AnyTrue:
- case IrOpcode::kV16x8AnyTrue:
- case IrOpcode::kV8x16AnyTrue: {
+ case IrOpcode::kV128AnyTrue: {
DCHECK_EQ(1, node->InputCount());
// AnyTrue always returns a I32x4, and can work with inputs of any shape,
// but we still need GetReplacementsWithType if input is float.
@@ -2242,6 +2264,10 @@ void SimdScalarLowering::LowerNode(Node* node) {
ReplaceNode(node, rep_node, 1);
break;
}
+ case IrOpcode::kV64x2AllTrue: {
+ LowerAllTrueOp(node, SimdType::kInt64x2);
+ break;
+ }
case IrOpcode::kV32x4AllTrue: {
LowerAllTrueOp(node, SimdType::kInt32x4);
break;