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

Unified Diff: src/compiler/simd-scalar-lowering.cc

Issue 2721223003: Revert of [wasm]implement simd lowering for simple F32x4 and I32x4 unops (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simd-scalar-lowering.h ('k') | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simd-scalar-lowering.cc
diff --git a/src/compiler/simd-scalar-lowering.cc b/src/compiler/simd-scalar-lowering.cc
index cfa46c3cafe817c92ee61c462928a8aa67fddbff..87a5e07281f4462d8406edd181bc218dd15e1ff7 100644
--- a/src/compiler/simd-scalar-lowering.cc
+++ b/src/compiler/simd-scalar-lowering.cc
@@ -75,8 +75,6 @@
V(Int32x4Splat) \
V(Int32x4ExtractLane) \
V(Int32x4ReplaceLane) \
- V(Int32x4Neg) \
- V(Simd128Not) \
V(Int32x4Add) \
V(Int32x4Sub) \
V(Int32x4Mul) \
@@ -88,16 +86,12 @@
V(Float32x4Splat) \
V(Float32x4ExtractLane) \
V(Float32x4ReplaceLane) \
- V(Float32x4Abs) \
- V(Float32x4Neg) \
V(Float32x4Add) \
V(Float32x4Sub) \
V(Float32x4Mul) \
V(Float32x4Div) \
V(Float32x4Min) \
- V(Float32x4Max) \
- V(Float32x4FromInt32x4) \
- V(Float32x4FromUint32x4)
+ V(Float32x4Max)
void SimdScalarLowering::SetLoweredType(Node* node, Node* output) {
switch (node->opcode()) {
@@ -114,14 +108,8 @@
break;
}
#undef CASE_STMT
- default: {
- if (output->opcode() == IrOpcode::kFloat32x4FromInt32x4 ||
- output->opcode() == IrOpcode::kFloat32x4FromUint32x4) {
- replacements_[node->id()].type = SimdType::kInt32;
- } else {
- replacements_[node->id()].type = replacements_[output->id()].type;
- }
- }
+ default:
+ replacements_[node->id()].type = replacements_[output->id()].type;
}
}
@@ -241,25 +229,14 @@
}
}
-void SimdScalarLowering::LowerBinaryOp(Node* node, SimdType input_rep_type,
+void SimdScalarLowering::LowerBinaryOp(Node* node, SimdType rep_type,
const Operator* op) {
DCHECK(node->InputCount() == 2);
- Node** rep_left = GetReplacementsWithType(node->InputAt(0), input_rep_type);
- Node** rep_right = GetReplacementsWithType(node->InputAt(1), input_rep_type);
+ Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type);
+ Node** rep_right = GetReplacementsWithType(node->InputAt(1), rep_type);
Node* rep_node[kMaxLanes];
for (int i = 0; i < kMaxLanes; ++i) {
rep_node[i] = graph()->NewNode(op, rep_left[i], rep_right[i]);
- }
- ReplaceNode(node, rep_node);
-}
-
-void SimdScalarLowering::LowerUnaryOp(Node* node, SimdType input_rep_type,
- const Operator* op) {
- DCHECK(node->InputCount() == 1);
- Node** rep = GetReplacementsWithType(node->InputAt(0), input_rep_type);
- Node* rep_node[kMaxLanes];
- for (int i = 0; i < kMaxLanes; ++i) {
- rep_node[i] = graph()->NewNode(op, rep[i]);
}
ReplaceNode(node, rep_node);
}
@@ -422,28 +399,6 @@
I32X4_BINOP_CASE(kSimd128Or, Word32Or)
I32X4_BINOP_CASE(kSimd128Xor, Word32Xor)
#undef I32X4_BINOP_CASE
- case IrOpcode::kInt32x4Neg: {
- DCHECK(node->InputCount() == 1);
- Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type);
- Node* rep_node[kMaxLanes];
- Node* zero = graph()->NewNode(common()->Int32Constant(0));
- for (int i = 0; i < kMaxLanes; ++i) {
- rep_node[i] = graph()->NewNode(machine()->Int32Sub(), zero, rep[i]);
- }
- ReplaceNode(node, rep_node);
- break;
- }
- case IrOpcode::kSimd128Not: {
- DCHECK(node->InputCount() == 1);
- Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type);
- Node* rep_node[kMaxLanes];
- Node* mask = graph()->NewNode(common()->Int32Constant(0xffffffff));
- for (int i = 0; i < kMaxLanes; ++i) {
- rep_node[i] = graph()->NewNode(machine()->Word32Xor(), rep[i], mask);
- }
- ReplaceNode(node, rep_node);
- break;
- }
#define F32X4_BINOP_CASE(name) \
case IrOpcode::kFloat32x4##name: { \
LowerBinaryOp(node, rep_type, machine()->Float32##name()); \
@@ -456,23 +411,6 @@
F32X4_BINOP_CASE(Min)
F32X4_BINOP_CASE(Max)
#undef F32X4_BINOP_CASE
-#define F32X4_UNOP_CASE(name) \
- case IrOpcode::kFloat32x4##name: { \
- LowerUnaryOp(node, rep_type, machine()->Float32##name()); \
- break; \
- }
- F32X4_UNOP_CASE(Abs)
- F32X4_UNOP_CASE(Neg)
- F32X4_UNOP_CASE(Sqrt)
-#undef F32x4_UNOP_CASE
- case IrOpcode::kFloat32x4FromInt32x4: {
- LowerUnaryOp(node, SimdType::kInt32, machine()->RoundInt32ToFloat32());
- break;
- }
- case IrOpcode::kFloat32x4FromUint32x4: {
- LowerUnaryOp(node, SimdType::kInt32, machine()->RoundUint32ToFloat32());
- break;
- }
case IrOpcode::kInt32x4Splat:
case IrOpcode::kFloat32x4Splat: {
Node* rep_node[kMaxLanes];
« no previous file with comments | « src/compiler/simd-scalar-lowering.h ('k') | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698