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..60c10c5321004fa858f8711b5f0f249c130b9eee 100644 |
--- a/src/compiler/simd-scalar-lowering.h |
+++ b/src/compiler/simd-scalar-lowering.h |
@@ -28,14 +28,23 @@ class SimdScalarLowering { |
private: |
enum class State : uint8_t { kUnvisited, kOnStack, kVisited }; |
- enum class SimdType : uint8_t { kInt32, kFloat32, kSimd1x4 }; |
+ enum class SimdType : uint8_t { |
+ kFloat32, |
+ kInt32, |
+ kInt16, |
+ kSimd1x4, |
bbudge
2017/04/27 18:03:42
It's strange to see lane types (e.g. kFloat32) mix
aseemgarg
2017/04/28 20:50:41
We do need the various types. Basically, this is t
|
+ kSimd1x8 |
+ }; |
bbudge
2017/04/27 18:03:42
On further thought, is this enum really needed? Co
aseemgarg
2017/04/28 20:50:41
Machine representation won't work as we need to di
|
- static const int kMaxLanes = 4; |
- static const int kLaneWidth = 16 / kMaxLanes; |
+ static const int kNumLanes32 = 4; |
+ static const int kNumLanes16 = 8; |
+ static const int32_t kMask16 = 0xffff; |
+ static const int32_t kShift16 = 16; |
bbudge
2017/04/27 18:03:42
Define these in the .cc file in an anonymous names
aseemgarg
2017/04/28 20:50:41
Done.
|
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 +61,37 @@ 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); |
+ void Int32ToInt16(Node** replacements, Node** result); |
+ void Int16ToInt32(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); |