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

Side by Side Diff: src/compiler/simd-scalar-lowering.h

Issue 2728823005: [wasm] Implement simd lowering for F32x4 and I32x4 compare ops (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/simd-scalar-lowering.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_SIMD_SCALAR_LOWERING_H_ 5 #ifndef V8_COMPILER_SIMD_SCALAR_LOWERING_H_
6 #define V8_COMPILER_SIMD_SCALAR_LOWERING_H_ 6 #define V8_COMPILER_SIMD_SCALAR_LOWERING_H_
7 7
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 10 matching lines...) Expand all
21 SimdScalarLowering(JSGraph* jsgraph, 21 SimdScalarLowering(JSGraph* jsgraph,
22 Signature<MachineRepresentation>* signature); 22 Signature<MachineRepresentation>* signature);
23 23
24 void LowerGraph(); 24 void LowerGraph();
25 25
26 int GetParameterCountAfterLowering(); 26 int GetParameterCountAfterLowering();
27 27
28 private: 28 private:
29 enum class State : uint8_t { kUnvisited, kOnStack, kVisited }; 29 enum class State : uint8_t { kUnvisited, kOnStack, kVisited };
30 30
31 enum class SimdType : uint8_t { kInt32, kFloat32 }; 31 enum class SimdType : uint8_t { kInt32, kFloat32, kSimd1x4 };
32 32
33 static const int kMaxLanes = 4; 33 static const int kMaxLanes = 4;
34 static const int kLaneWidth = 16 / kMaxLanes; 34 static const int kLaneWidth = 16 / kMaxLanes;
35 35
36 struct Replacement { 36 struct Replacement {
37 Node* node[kMaxLanes]; 37 Node* node[kMaxLanes];
38 SimdType type; // represents what input type is expected 38 SimdType type; // represents what input type is expected
39 }; 39 };
40 40
41 struct NodeState { 41 struct NodeState {
(...skipping 15 matching lines...) Expand all
57 Node** GetReplacements(Node* node); 57 Node** GetReplacements(Node* node);
58 Node** GetReplacementsWithType(Node* node, SimdType type); 58 Node** GetReplacementsWithType(Node* node, SimdType type);
59 SimdType ReplacementType(Node* node); 59 SimdType ReplacementType(Node* node);
60 void PreparePhiReplacement(Node* phi); 60 void PreparePhiReplacement(Node* phi);
61 void SetLoweredType(Node* node, Node* output); 61 void SetLoweredType(Node* node, Node* output);
62 void GetIndexNodes(Node* index, Node** new_indices); 62 void GetIndexNodes(Node* index, Node** new_indices);
63 void LowerLoadOp(MachineRepresentation rep, Node* node, 63 void LowerLoadOp(MachineRepresentation rep, Node* node,
64 const Operator* load_op); 64 const Operator* load_op);
65 void LowerStoreOp(MachineRepresentation rep, Node* node, 65 void LowerStoreOp(MachineRepresentation rep, Node* node,
66 const Operator* store_op, SimdType rep_type); 66 const Operator* store_op, SimdType rep_type);
67 void LowerBinaryOp(Node* node, SimdType input_rep_type, const Operator* op); 67 void LowerBinaryOp(Node* node, SimdType input_rep_type, const Operator* op,
68 bool invert_inputs = false);
68 void LowerUnaryOp(Node* node, SimdType input_rep_type, const Operator* op); 69 void LowerUnaryOp(Node* node, SimdType input_rep_type, const Operator* op);
69 void LowerIntMinMax(Node* node, const Operator* op, bool is_max); 70 void LowerIntMinMax(Node* node, const Operator* op, bool is_max);
70 void LowerConvertFromFloat(Node* node, bool is_signed); 71 void LowerConvertFromFloat(Node* node, bool is_signed);
71 void LowerShiftOp(Node* node, const Operator* op); 72 void LowerShiftOp(Node* node, const Operator* op);
72 Node* BuildF64Trunc(Node* input); 73 Node* BuildF64Trunc(Node* input);
74 void LowerNotEqual(Node* node, SimdType input_rep_type, const Operator* op);
73 75
74 JSGraph* const jsgraph_; 76 JSGraph* const jsgraph_;
75 NodeMarker<State> state_; 77 NodeMarker<State> state_;
76 ZoneDeque<NodeState> stack_; 78 ZoneDeque<NodeState> stack_;
77 Replacement* replacements_; 79 Replacement* replacements_;
78 Signature<MachineRepresentation>* signature_; 80 Signature<MachineRepresentation>* signature_;
79 Node* placeholder_; 81 Node* placeholder_;
80 int parameter_count_after_lowering_; 82 int parameter_count_after_lowering_;
81 }; 83 };
82 84
83 } // namespace compiler 85 } // namespace compiler
84 } // namespace internal 86 } // namespace internal
85 } // namespace v8 87 } // namespace v8
86 88
87 #endif // V8_COMPILER_SIMD_SCALAR_LOWERING_H_ 89 #endif // V8_COMPILER_SIMD_SCALAR_LOWERING_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/simd-scalar-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698