Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 2725853002: Revert of [wasm]implement simd lowering for f32x4->i32x4, i32x4 min/max and shift instructions (Closed)

Created:
3 years, 9 months ago by ahaas
Modified:
3 years, 9 months ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Revert of [wasm]implement simd lowering for f32x4->i32x4, i32x4 min/max and shift instructions (patchset #2 id:20001 of https://codereview.chromium.org/2718323003/ ) Reason for revert: There is a crash on a bot https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20debug/builds/13871/steps/Check%20-%20nosse4/logs/RunWasmCompiled_I32x4... Original issue's description: > [wasm]implement simd lowering for f32x4->i32x4, i32x4 min/max and shift instructions > > BUG=v8:4124 > R=bradnelson@chromium.org,bbudge@chromium.org,gdeepti@chromium.org,mtrofin@chromium.org,titzer@chromium.org > > Review-Url: https://codereview.chromium.org/2718323003 > Cr-Commit-Position: refs/heads/master@{#43510} > Committed: https://chromium.googlesource.com/v8/v8/+/f75748cf4ca696fff268787068419604815f8090 TBR=bbudge@chromium.org,bradnelson@chromium.org,gdeepti@chromium.org,mtrofin@chromium.org,titzer@chromium.org,aseemgarg@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=v8:4124

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -143 lines) Patch
M src/compiler/simd-scalar-lowering.h View 1 chunk +0 lines, -3 lines 0 comments Download
M src/compiler/simd-scalar-lowering.cc View 5 chunks +6 lines, -126 lines 0 comments Download
M test/cctest/wasm/test-run-wasm-simd.cc View 6 chunks +11 lines, -14 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
ahaas
Created Revert of [wasm]implement simd lowering for f32x4->i32x4, i32x4 min/max and shift instructions
3 years, 9 months ago (2017-03-01 12:39:52 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2725853002/1
3 years, 9 months ago (2017-03-01 12:40:02 UTC) #3
commit-bot: I haz the power
3 years, 9 months ago (2017-03-01 12:41:00 UTC) #5
Failed to apply patch for src/compiler/simd-scalar-lowering.cc:
While running git apply --index -p1;
  error: patch failed: src/compiler/simd-scalar-lowering.cc:80
  error: src/compiler/simd-scalar-lowering.cc: patch does not apply

Patch:       src/compiler/simd-scalar-lowering.cc
Index: src/compiler/simd-scalar-lowering.cc
diff --git a/src/compiler/simd-scalar-lowering.cc
b/src/compiler/simd-scalar-lowering.cc
index
8e1bf81917713df13fe64db136c2b014119a15dc..cfa46c3cafe817c92ee61c462928a8aa67fddbff
100644
--- a/src/compiler/simd-scalar-lowering.cc
+++ b/src/compiler/simd-scalar-lowering.cc
@@ -80,15 +80,9 @@
   V(Int32x4Add)                   \
   V(Int32x4Sub)                   \
   V(Int32x4Mul)                   \
-  V(Int32x4Min)                   \
-  V(Int32x4Max)                   \
-  V(Uint32x4Min)                  \
-  V(Uint32x4Max)                  \
   V(Simd128And)                   \
   V(Simd128Or)                    \
-  V(Simd128Xor)                   \
-  V(Int32x4FromFloat32x4)         \
-  V(Uint32x4FromFloat32x4)
+  V(Simd128Xor)
 
 #define FOREACH_FLOAT32X4_OPCODE(V) \
   V(Float32x4Splat)                 \
@@ -121,20 +115,11 @@
       }
 #undef CASE_STMT
     default: {
-      switch (output->opcode()) {
-        case IrOpcode::kFloat32x4FromInt32x4:
-        case IrOpcode::kFloat32x4FromUint32x4: {
-          replacements_[node->id()].type = SimdType::kInt32;
-          break;
-        }
-        case IrOpcode::kInt32x4FromFloat32x4:
-        case IrOpcode::kUint32x4FromFloat32x4: {
-          replacements_[node->id()].type = SimdType::kFloat32;
-          break;
-        }
-        default: {
-          replacements_[node->id()].type = replacements_[output->id()].type;
-        }
+      if (output->opcode() == IrOpcode::kFloat32x4FromInt32x4 ||
+          output->opcode() == IrOpcode::kFloat32x4FromUint32x4) {
+        replacements_[node->id()].type = SimdType::kInt32;
+      } else {
+        replacements_[node->id()].type = replacements_[output->id()].type;
       }
     }
   }
@@ -279,75 +264,6 @@
   ReplaceNode(node, rep_node);
 }
 
-void SimdScalarLowering::LowerIntMinMax(Node* node, const Operator* op,
-                                        bool is_max) {
-  DCHECK(node->InputCount() == 2);
-  Node** rep_left = GetReplacementsWithType(node->InputAt(0),
SimdType::kInt32);
-  Node** rep_right =
-      GetReplacementsWithType(node->InputAt(1), SimdType::kInt32);
-  Node* rep_node[kMaxLanes];
-  for (int i = 0; i < kMaxLanes; ++i) {
-    Diamond d(graph(), common(),
-              graph()->NewNode(op, rep_left[i], rep_right[i]));
-    if (is_max) {
-      rep_node[i] =
-          d.Phi(MachineRepresentation::kWord32, rep_right[i], rep_left[i]);
-    } else {
-      rep_node[i] =
-          d.Phi(MachineRepresentation::kWord32, rep_left[i], rep_right[i]);
-    }
-  }
-  ReplaceNode(node, rep_node);
-}
-
-void SimdScalarLowering::LowerConvertFromFloat(Node* node, bool is_signed) {
-  DCHECK(node->InputCount() == 1);
-  Node** rep = GetReplacementsWithType(node->InputAt(0), SimdType::kFloat32);
-  Node* rep_node[kMaxLanes];
-  Node* double_zero = graph()->NewNode(common()->Float64Constant(0.0));
-  Node* min = graph()->NewNode(
-      common()->Float64Constant(static_cast<double>(is_signed ? kMinInt : 0)));
-  Node* max = graph()->NewNode(common()->Float64Constant(
-      static_cast<double>(is_signed ? kMaxInt : 0xffffffffu)));
-  for (int i = 0; i < kMaxLanes; ++i) {
-    Node* double_rep =
-        graph()->NewNode(machine()->ChangeFloat32ToFloat64(), rep[i]);
-    Diamond nan_d(graph(), common(),
graph()->NewNode(machine()->Float64Equal(),
-                                                      double_rep, double_rep));
-    Node* temp =
-        nan_d.Phi(MachineRepresentation::kFloat64, double_rep, double_zero);
-    Diamond min_d(graph(), common(),
-                  graph()->NewNode(machine()->Float64LessThan(), temp, min));
-    temp = min_d.Phi(MachineRepresentation::kFloat64, min, temp);
-    Diamond max_d(graph(), common(),
-                  graph()->NewNode(machine()->Float64LessThan(), max, temp));
-    temp = max_d.Phi(MachineRepresentation::kFloat64, max, temp);
-    Node* trunc =
-        graph()->NewNode(machine()->Float64RoundTruncate().op(), temp);
-    if (is_signed) {
-      rep_node[i] = graph()->NewNode(machine()->ChangeFloat64ToInt32(), trunc);
-    } else {
-      rep_node[i] =
-          graph()->NewNode(machine()->TruncateFloat64ToUint32(), trunc);
-    }
-  }
-  ReplaceNode(node, rep_node);
-}
-
-void SimdScalarLowering::LowerShiftOp(Node* node, const Operator* op) {
-  static int32_t shift_mask = 0x1f;
-  DCHECK_EQ(1, node->InputCount());
-  int32_t shift_amount = OpParameter<int32_t>(node);
-  Node* shift_node =
-      graph()->NewNode(common()->Int32Constant(shift_amount & shift_mask));
-  Node** rep = GetReplacementsWithType(node->InputAt(0), SimdType::kInt32);
-  Node* rep_node[kMaxLanes];
-  for (int i = 0; i < kMaxLanes; ++i) {
-    rep_node[i] = graph()->NewNode(op, rep[i], shift_node);
-  }
-  ReplaceNode(node, rep_node);
-}
-
 void SimdScalarLowering::LowerNode(Node* node) {
   SimdType rep_type = ReplacementType(node);
   switch (node->opcode()) {
@@ -506,22 +422,6 @@
       I32X4_BINOP_CASE(kSimd128Or, Word32Or)
       I32X4_BINOP_CASE(kSimd128Xor, Word32Xor)
 #undef I32X4_BINOP_CASE
-    case IrOpcode::kInt32x4Max: {
-      LowerIntMinMax(node, machine()->Int32LessThan(), true);
-      break;
-    }
-    case IrOpcode::kInt32x4Min: {
-      LowerIntMinMax(node, machine()->Int32LessThan(), false);
-      break;
-    }
-    case IrOpcode::kUint32x4Max: {
-      LowerIntMinMax(node, machine()->Uint32LessThan(), true);
-      break;
-    }
-    case IrOpcode::kUint32x4Min: {
-      LowerIntMinMax(node, machine()->Uint32LessThan(), false);
-      break;
-    }
     case IrOpcode::kInt32x4Neg: {
       DCHECK(node->InputCount() == 1);
       Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type);
@@ -542,26 +442,6 @@
         rep_node[i] = graph()->NewNode(machine()->Word32Xor(), rep[i], mask);
       }
       ReplaceNode(node, rep_node);
-      break;
-    }
-    case IrOpcode::kInt32x4FromFloat32x4: {
-      LowerConvertFromFloat(node, true);
-      break;
-    }
-    case IrOpcode::kUint32x4FromFloat32x4: {
-      LowerConvertFromFloat(node, false);
-      break;
-    }
-    case IrOpcode::kInt32x4ShiftLeftByScalar: {
-      LowerShiftOp(node, machine()->Word32Shl());
-      break;
-    }
-    case IrOpcode::kInt32x4ShiftRightByScalar: {
-      LowerShiftOp(node, machine()->Word32Sar());
-      break;
-    }
-    case IrOpcode::kUint32x4ShiftRightByScalar: {
-      LowerShiftOp(node, machine()->Word32Shr());
       break;
     }
 #define F32X4_BINOP_CASE(name)                                 \

Powered by Google App Engine
This is Rietveld 408576698