| Index: src/compiler/wasm-compiler.cc
|
| diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
|
| index 3308d4393d001b0fbfd6c72e45ac4e32c730d1f9..adbab7d5070e40673ad0f72d807690a9de05907e 100644
|
| --- a/src/compiler/wasm-compiler.cc
|
| +++ b/src/compiler/wasm-compiler.cc
|
| @@ -24,6 +24,7 @@
|
| #include "src/compiler/machine-operator.h"
|
| #include "src/compiler/node-matchers.h"
|
| #include "src/compiler/pipeline.h"
|
| +#include "src/compiler/simd-scalar-lowering.h"
|
| #include "src/compiler/source-position.h"
|
| #include "src/compiler/zone-pool.h"
|
|
|
| @@ -3021,6 +3022,13 @@ void WasmGraphBuilder::Int64LoweringForTesting() {
|
| }
|
| }
|
|
|
| +void WasmGraphBuilder::SimdScalarLoweringForTesting() {
|
| + SimdScalarLowering(jsgraph()->graph(), jsgraph()->machine(),
|
| + jsgraph()->common(), jsgraph()->zone(),
|
| + function_signature_)
|
| + .LowerGraph();
|
| +}
|
| +
|
| void WasmGraphBuilder::SetSourcePosition(Node* node,
|
| wasm::WasmCodePosition position) {
|
| DCHECK_NE(position, wasm::kNoCodePosition);
|
| @@ -3043,6 +3051,18 @@ Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode,
|
| case wasm::kExprI32x4Splat:
|
| return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(), inputs[0],
|
| inputs[0], inputs[0], inputs[0]);
|
| + case wasm::kExprI32x4Add:
|
| + return graph()->NewNode(jsgraph()->machine()->Int32x4Add(), inputs[0],
|
| + inputs[1]);
|
| + case wasm::kExprF32x4ExtractLane:
|
| + return graph()->NewNode(jsgraph()->machine()->Float32x4ExtractLane(),
|
| + inputs[0], inputs[1]);
|
| + case wasm::kExprF32x4Splat:
|
| + return graph()->NewNode(jsgraph()->machine()->CreateFloat32x4(),
|
| + inputs[0], inputs[0], inputs[0], inputs[0]);
|
| + case wasm::kExprF32x4Add:
|
| + return graph()->NewNode(jsgraph()->machine()->Float32x4Add(), inputs[0],
|
| + inputs[1]);
|
| default:
|
| return graph()->NewNode(UnsupportedOpcode(opcode), nullptr);
|
| }
|
| @@ -3054,6 +3074,9 @@ Node* WasmGraphBuilder::SimdExtractLane(wasm::WasmOpcode opcode, uint8_t lane,
|
| 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);
|
| }
|
| @@ -3269,6 +3292,9 @@ SourcePositionTable* WasmCompilationUnit::BuildGraphForWasmFunction(
|
| r.LowerGraph();
|
| }
|
|
|
| + SimdScalarLowering(graph, machine, common, jsgraph_->zone(), function_->sig)
|
| + .LowerGraph();
|
| +
|
| int index = static_cast<int>(function_->func_index);
|
|
|
| if (index >= FLAG_trace_wasm_ast_start && index < FLAG_trace_wasm_ast_end) {
|
|
|