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

Unified Diff: src/compiler/wasm-compiler.cc

Issue 2847663005: [WASM SIMD] Replace primitive shuffles with general Shuffle. (Closed)
Patch Set: Rebase. Created 3 years, 7 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/wasm-compiler.h ('k') | src/wasm/function-body-decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index f5cb58085e3bafd4a137a1ea5a14bddb91e1e754..06377336c864ba7c91f7aca69f7dcaababb96b9c 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -3478,81 +3478,15 @@ Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode,
inputs[1]);
case wasm::kExprS128Not:
return graph()->NewNode(jsgraph()->machine()->S128Not(), inputs[0]);
- case wasm::kExprS32x4ZipLeft:
- return graph()->NewNode(jsgraph()->machine()->S32x4ZipLeft(), inputs[0],
- inputs[1]);
- case wasm::kExprS32x4ZipRight:
- return graph()->NewNode(jsgraph()->machine()->S32x4ZipRight(), inputs[0],
- inputs[1]);
- case wasm::kExprS32x4UnzipLeft:
- return graph()->NewNode(jsgraph()->machine()->S32x4UnzipLeft(), inputs[0],
- inputs[1]);
- case wasm::kExprS32x4UnzipRight:
- return graph()->NewNode(jsgraph()->machine()->S32x4UnzipRight(),
- inputs[0], inputs[1]);
- case wasm::kExprS32x4TransposeLeft:
- return graph()->NewNode(jsgraph()->machine()->S32x4TransposeLeft(),
- inputs[0], inputs[1]);
- case wasm::kExprS32x4TransposeRight:
- return graph()->NewNode(jsgraph()->machine()->S32x4TransposeRight(),
- inputs[0], inputs[1]);
case wasm::kExprS32x4Select:
return graph()->NewNode(jsgraph()->machine()->S32x4Select(), inputs[0],
inputs[1], inputs[2]);
- case wasm::kExprS16x8ZipLeft:
- return graph()->NewNode(jsgraph()->machine()->S16x8ZipLeft(), inputs[0],
- inputs[1]);
- case wasm::kExprS16x8ZipRight:
- return graph()->NewNode(jsgraph()->machine()->S16x8ZipRight(), inputs[0],
- inputs[1]);
- case wasm::kExprS16x8UnzipLeft:
- return graph()->NewNode(jsgraph()->machine()->S16x8UnzipLeft(), inputs[0],
- inputs[1]);
- case wasm::kExprS16x8UnzipRight:
- return graph()->NewNode(jsgraph()->machine()->S16x8UnzipRight(),
- inputs[0], inputs[1]);
- case wasm::kExprS16x8TransposeLeft:
- return graph()->NewNode(jsgraph()->machine()->S16x8TransposeLeft(),
- inputs[0], inputs[1]);
- case wasm::kExprS16x8TransposeRight:
- return graph()->NewNode(jsgraph()->machine()->S16x8TransposeRight(),
- inputs[0], inputs[1]);
case wasm::kExprS16x8Select:
return graph()->NewNode(jsgraph()->machine()->S16x8Select(), inputs[0],
inputs[1], inputs[2]);
- case wasm::kExprS8x16ZipLeft:
- return graph()->NewNode(jsgraph()->machine()->S8x16ZipLeft(), inputs[0],
- inputs[1]);
- case wasm::kExprS8x16ZipRight:
- return graph()->NewNode(jsgraph()->machine()->S8x16ZipRight(), inputs[0],
- inputs[1]);
- case wasm::kExprS8x16UnzipLeft:
- return graph()->NewNode(jsgraph()->machine()->S8x16UnzipLeft(), inputs[0],
- inputs[1]);
- case wasm::kExprS8x16UnzipRight:
- return graph()->NewNode(jsgraph()->machine()->S8x16UnzipRight(),
- inputs[0], inputs[1]);
- case wasm::kExprS8x16TransposeLeft:
- return graph()->NewNode(jsgraph()->machine()->S8x16TransposeLeft(),
- inputs[0], inputs[1]);
- case wasm::kExprS8x16TransposeRight:
- return graph()->NewNode(jsgraph()->machine()->S8x16TransposeRight(),
- inputs[0], inputs[1]);
case wasm::kExprS8x16Select:
return graph()->NewNode(jsgraph()->machine()->S8x16Select(), inputs[0],
inputs[1], inputs[2]);
- case wasm::kExprS32x2Reverse:
- return graph()->NewNode(jsgraph()->machine()->S32x2Reverse(), inputs[0]);
- case wasm::kExprS16x4Reverse:
- return graph()->NewNode(jsgraph()->machine()->S16x4Reverse(), inputs[0]);
- case wasm::kExprS16x2Reverse:
- return graph()->NewNode(jsgraph()->machine()->S16x2Reverse(), inputs[0]);
- case wasm::kExprS8x8Reverse:
- return graph()->NewNode(jsgraph()->machine()->S8x8Reverse(), inputs[0]);
- case wasm::kExprS8x4Reverse:
- return graph()->NewNode(jsgraph()->machine()->S8x4Reverse(), inputs[0]);
- case wasm::kExprS8x2Reverse:
- return graph()->NewNode(jsgraph()->machine()->S8x2Reverse(), inputs[0]);
case wasm::kExprS1x4And:
return graph()->NewNode(jsgraph()->machine()->S1x4And(), inputs[0],
inputs[1]);
@@ -3669,10 +3603,23 @@ Node* WasmGraphBuilder::SimdShiftOp(wasm::WasmOpcode opcode, uint8_t shift,
}
}
-Node* WasmGraphBuilder::SimdConcatOp(uint8_t bytes, const NodeVector& inputs) {
+Node* WasmGraphBuilder::SimdShuffleOp(uint8_t shuffle[16], unsigned lanes,
+ const NodeVector& inputs) {
has_simd_ = true;
- return graph()->NewNode(jsgraph()->machine()->S8x16Concat(bytes), inputs[0],
- inputs[1]);
+ switch (lanes) {
+ case 4:
+ return graph()->NewNode(jsgraph()->machine()->S32x4Shuffle(shuffle),
+ inputs[0], inputs[1]);
+ case 8:
+ return graph()->NewNode(jsgraph()->machine()->S16x8Shuffle(shuffle),
+ inputs[0], inputs[1]);
+ case 16:
+ return graph()->NewNode(jsgraph()->machine()->S8x16Shuffle(shuffle),
+ inputs[0], inputs[1]);
+ default:
+ UNREACHABLE();
+ return nullptr;
+ }
}
static void RecordFunctionCompilation(CodeEventListener::LogEventsAndTags tag,
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/function-body-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698