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

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

Issue 1991143002: Convert SIMD wasm ops to runtime function calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 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
Index: src/compiler/wasm-compiler.h
diff --git a/src/compiler/wasm-compiler.h b/src/compiler/wasm-compiler.h
index a0209c316e16b0114beb25c60a6a01271be62f2f..ef7be2fd642ed3f5717881dc51430ba5b330c1a3 100644
--- a/src/compiler/wasm-compiler.h
+++ b/src/compiler/wasm-compiler.h
@@ -22,6 +22,7 @@ class JSGraph;
class Graph;
class Operator;
class SourcePositionTable;
+class MachineOperatorBuilder;
} // namespace compiler
namespace wasm {
@@ -90,6 +91,8 @@ Handle<Code> CompileJSToWasmWrapper(Isolate* isolate, wasm::ModuleEnv* module,
// Abstracts details of building TurboFan graph nodes for WASM to separate
// the WASM decoder from the internal details of TurboFan.
class WasmTrapHelper;
+enum class Conversion { kNone, kOpaque, kInt32, kFloat32, kFloat64 };
+typedef ZoneVector<Node*> NodeVector;
class WasmGraphBuilder {
public:
WasmGraphBuilder(
@@ -123,6 +126,7 @@ class WasmGraphBuilder {
Node* Float32Constant(float value);
Node* Float64Constant(double value);
Node* HeapConstant(Handle<HeapObject> value);
+ Node* DefaultS128Value();
Node* Binop(wasm::WasmOpcode opcode, Node* left, Node* right,
wasm::WasmCodePosition position = wasm::kNoCodePosition);
Node* Unop(wasm::WasmOpcode opcode, Node* input,
@@ -157,6 +161,8 @@ class WasmGraphBuilder {
Node* FromJS(Node* node, Node* context, wasm::LocalType type);
Node* Invert(Node* node);
Node* FunctionTable();
+ Node* ChangeToRuntimeCall(Node* node, Runtime::FunctionId function_id,
+ Signature<Conversion>* signature);
//-----------------------------------------------------------------------
// Operations that concern the linear memory.
@@ -188,6 +194,10 @@ class WasmGraphBuilder {
void SetSourcePosition(Node* node, wasm::WasmCodePosition position);
+ Node* SimdOp(wasm::WasmOpcode opcode, const NodeVector& inputs);
+
+ bool has_simd_ops() { return has_simd_ops_; }
+
private:
static const int kDefaultBufferSize = 16;
friend class WasmTrapHelper;
@@ -209,6 +219,7 @@ class WasmGraphBuilder {
SetOncePointer<const Operator> allocate_heap_number_operator_;
compiler::SourcePositionTable* source_position_table_ = nullptr;
+ bool has_simd_ops_;
// Internal helper methods.
JSGraph* jsgraph() { return jsgraph_; }
@@ -312,6 +323,7 @@ class WasmGraphBuilder {
Node* BuildJavaScriptToNumber(Node* node, Node* context, Node* effect,
Node* control);
Node* BuildChangeInt32ToTagged(Node* value);
+ Node* BuildChangeTaggedToInt32(Node* value);
Node* BuildChangeFloat64ToTagged(Node* value);
Node* BuildChangeTaggedToFloat64(Node* value);
@@ -344,6 +356,9 @@ class WasmGraphBuilder {
if (buf != buffer) memcpy(buf, buffer, old_count * sizeof(Node*));
return buf;
}
+
+ // Simd helper functions
+ MachineOperatorBuilder* simd();
};
} // namespace compiler
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698