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

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

Issue 2385393002: [wasm] Implement I32x4ReplaceLane, I32x4Add, I32x4Sub. (Closed)
Patch Set: Fix check Created 4 years 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/compiler/x64/code-generator-x64.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 df4f96ff63a35d54c3fad25005447db483ebd6cd..dd223bb84177f1b3622b09ec71474b459e5540a6 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -3124,6 +3124,9 @@ Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode,
case wasm::kExprI32x4Add:
return graph()->NewNode(jsgraph()->machine()->Int32x4Add(), inputs[0],
inputs[1]);
+ case wasm::kExprI32x4Sub:
+ return graph()->NewNode(jsgraph()->machine()->Int32x4Sub(), inputs[0],
+ inputs[1]);
case wasm::kExprF32x4Splat:
return graph()->NewNode(jsgraph()->machine()->CreateFloat32x4(),
inputs[0], inputs[0], inputs[0], inputs[0]);
@@ -3135,29 +3138,21 @@ Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode,
}
}
-Node* WasmGraphBuilder::SimdExtractLane(wasm::WasmOpcode opcode, uint8_t lane,
- Node* input) {
+Node* WasmGraphBuilder::SimdLaneOp(wasm::WasmOpcode opcode, uint8_t lane,
+ const NodeVector& inputs) {
switch (opcode) {
case wasm::kExprI32x4ExtractLane:
- return graph()->NewNode(jsgraph()->machine()->Int32x4ExtractLane(), input,
- Int32Constant(lane));
- case wasm::kExprF32x4ExtractLane:
- return graph()->NewNode(jsgraph()->machine()->Float32x4ExtractLane(),
- input, Int32Constant(lane));
- default:
- return graph()->NewNode(UnsupportedOpcode(opcode), nullptr);
- }
-}
-
-Node* WasmGraphBuilder::SimdReplaceLane(wasm::WasmOpcode opcode, uint8_t lane,
- Node* input, Node* replacement) {
- switch (opcode) {
+ return graph()->NewNode(jsgraph()->common()->Int32x4ExtractLane(lane),
+ inputs[0]);
case wasm::kExprI32x4ReplaceLane:
- return graph()->NewNode(jsgraph()->machine()->Int32x4ReplaceLane(), input,
- Int32Constant(lane), replacement);
+ return graph()->NewNode(jsgraph()->common()->Int32x4ReplaceLane(lane),
+ inputs[0], inputs[1]);
+ case wasm::kExprF32x4ExtractLane:
+ return graph()->NewNode(jsgraph()->common()->Float32x4ExtractLane(lane),
+ inputs[0]);
case wasm::kExprF32x4ReplaceLane:
- return graph()->NewNode(jsgraph()->machine()->Float32x4ReplaceLane(),
- input, Int32Constant(lane), replacement);
+ return graph()->NewNode(jsgraph()->common()->Float32x4ReplaceLane(lane),
+ inputs[0], inputs[1]);
default:
return graph()->NewNode(UnsupportedOpcode(opcode), nullptr);
}
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698