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

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

Issue 2713613005: [wasm]implement simd lowering for F32x4 and I32x4 binops (Closed)
Patch Set: rebase 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 | « no previous file | 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 601ccb20a2bab27682adffe0140d2860691ddd5e..87a5e07281f4462d8406edd181bc218dd15e1ff7 100644
--- a/src/compiler/simd-scalar-lowering.cc
+++ b/src/compiler/simd-scalar-lowering.cc
@@ -72,16 +72,26 @@ void SimdScalarLowering::LowerGraph() {
}
#define FOREACH_INT32X4_OPCODE(V) \
- V(Int32x4Add) \
- V(Int32x4ExtractLane) \
V(Int32x4Splat) \
- V(Int32x4ReplaceLane)
+ V(Int32x4ExtractLane) \
+ V(Int32x4ReplaceLane) \
+ V(Int32x4Add) \
+ V(Int32x4Sub) \
+ V(Int32x4Mul) \
+ V(Simd128And) \
+ V(Simd128Or) \
+ V(Simd128Xor)
#define FOREACH_FLOAT32X4_OPCODE(V) \
- V(Float32x4Add) \
- V(Float32x4ExtractLane) \
V(Float32x4Splat) \
- V(Float32x4ReplaceLane)
+ V(Float32x4ExtractLane) \
+ V(Float32x4ReplaceLane) \
+ V(Float32x4Add) \
+ V(Float32x4Sub) \
+ V(Float32x4Mul) \
+ V(Float32x4Div) \
+ V(Float32x4Min) \
+ V(Float32x4Max)
void SimdScalarLowering::SetLoweredType(Node* node, Node* output) {
switch (node->opcode()) {
@@ -377,14 +387,30 @@ void SimdScalarLowering::LowerNode(Node* node) {
}
break;
}
- case IrOpcode::kInt32x4Add: {
- LowerBinaryOp(node, rep_type, machine()->Int32Add());
- break;
- }
- case IrOpcode::kFloat32x4Add: {
- LowerBinaryOp(node, rep_type, machine()->Float32Add());
- break;
- }
+#define I32X4_BINOP_CASE(opcode, instruction) \
+ case IrOpcode::opcode: { \
+ LowerBinaryOp(node, rep_type, machine()->instruction()); \
+ break; \
+ }
+ I32X4_BINOP_CASE(kInt32x4Add, Int32Add)
+ I32X4_BINOP_CASE(kInt32x4Sub, Int32Sub)
+ I32X4_BINOP_CASE(kInt32x4Mul, Int32Mul)
+ I32X4_BINOP_CASE(kSimd128And, Word32And)
+ I32X4_BINOP_CASE(kSimd128Or, Word32Or)
+ I32X4_BINOP_CASE(kSimd128Xor, Word32Xor)
+#undef I32X4_BINOP_CASE
+#define F32X4_BINOP_CASE(name) \
+ case IrOpcode::kFloat32x4##name: { \
+ LowerBinaryOp(node, rep_type, machine()->Float32##name()); \
+ break; \
+ }
+ F32X4_BINOP_CASE(Add)
+ F32X4_BINOP_CASE(Sub)
+ F32X4_BINOP_CASE(Mul)
+ F32X4_BINOP_CASE(Div)
+ F32X4_BINOP_CASE(Min)
+ F32X4_BINOP_CASE(Max)
+#undef F32X4_BINOP_CASE
case IrOpcode::kInt32x4Splat:
case IrOpcode::kFloat32x4Splat: {
Node* rep_node[kMaxLanes];
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698