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

Unified Diff: src/compiler/simd-scalar-lowering.h

Issue 2843523002: [wasm] Implement simd lowering for I16x8 (Closed)
Patch Set: [wasm] Implement simd lowering for I16x8 Created 3 years, 8 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 | « no previous file | src/compiler/simd-scalar-lowering.cc » ('j') | src/compiler/simd-scalar-lowering.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simd-scalar-lowering.h
diff --git a/src/compiler/simd-scalar-lowering.h b/src/compiler/simd-scalar-lowering.h
index 70186fdf11d4283868f8215bbab12e4908428493..34b24e1cf026831dbc7c7c16871d98c7ea9d8feb 100644
--- a/src/compiler/simd-scalar-lowering.h
+++ b/src/compiler/simd-scalar-lowering.h
@@ -28,14 +28,18 @@ class SimdScalarLowering {
private:
enum class State : uint8_t { kUnvisited, kOnStack, kVisited };
- enum class SimdType : uint8_t { kInt32, kFloat32, kSimd1x4 };
-
- static const int kMaxLanes = 4;
- static const int kLaneWidth = 16 / kMaxLanes;
+ enum class SimdType : uint8_t {
+ kFloat32x4,
+ kInt32x4,
+ kInt16x8,
+ kSimd1x4,
+ kSimd1x8
+ };
struct Replacement {
- Node* node[kMaxLanes];
- SimdType type; // represents what input type is expected
+ Node** node;
+ SimdType type; // represents output type
+ int num_replacements;
};
struct NodeState {
@@ -52,24 +56,35 @@ class SimdScalarLowering {
void LowerNode(Node* node);
bool DefaultLowering(Node* node);
- void ReplaceNode(Node* old, Node** new_nodes);
+ int NumLanes(SimdType type);
+ void ReplaceNode(Node* old, Node** new_nodes, int count);
bool HasReplacement(size_t index, Node* node);
Node** GetReplacements(Node* node);
+ int ReplacementCount(Node* node);
+ void Float32ToInt32(Node** replacements, Node** result);
+ void Int32ToFloat32(Node** replacements, Node** result);
Node** GetReplacementsWithType(Node* node, SimdType type);
SimdType ReplacementType(Node* node);
void PreparePhiReplacement(Node* phi);
void SetLoweredType(Node* node, Node* output);
- void GetIndexNodes(Node* index, Node** new_indices);
+ void GetIndexNodes(Node* index, Node** new_indices, SimdType type);
void LowerLoadOp(MachineRepresentation rep, Node* node,
- const Operator* load_op);
+ const Operator* load_op, SimdType type);
void LowerStoreOp(MachineRepresentation rep, Node* node,
const Operator* store_op, SimdType rep_type);
void LowerBinaryOp(Node* node, SimdType input_rep_type, const Operator* op,
bool invert_inputs = false);
+ Node* FixUpperBits(Node* input, int32_t shift);
+ void LowerBinaryOpForSmallInt(Node* node, SimdType input_rep_type,
+ const Operator* op);
+ Node* Mask(Node* input, int32_t mask);
+ void LowerSaturateBinaryOp(Node* node, SimdType input_rep_type,
+ const Operator* op, bool is_signed);
void LowerUnaryOp(Node* node, SimdType input_rep_type, const Operator* op);
- void LowerIntMinMax(Node* node, const Operator* op, bool is_max);
+ void LowerIntMinMax(Node* node, const Operator* op, bool is_max,
+ SimdType type);
void LowerConvertFromFloat(Node* node, bool is_signed);
- void LowerShiftOp(Node* node, const Operator* op);
+ void LowerShiftOp(Node* node, SimdType type);
Node* BuildF64Trunc(Node* input);
void LowerNotEqual(Node* node, SimdType input_rep_type, const Operator* op);
« no previous file with comments | « no previous file | src/compiler/simd-scalar-lowering.cc » ('j') | src/compiler/simd-scalar-lowering.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698