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

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: Use NodeVector instead of std::vector 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 406336b0e189a05e50fe13987d2ef0924d35e496..de5721b4d9155fc456226e1e8dbc3707f71345c5 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 {
@@ -94,6 +95,8 @@ Handle<JSFunction> CompileJSToWasmWrapper(Isolate* isolate,
// 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(
@@ -127,6 +130,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,
@@ -161,6 +165,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.
@@ -192,6 +198,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;
@@ -213,6 +223,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_; }
@@ -316,6 +327,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);
@@ -348,6 +360,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