OLD | NEW |
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 15 matching lines...) Expand all Loading... |
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, kSimd1x4 }; | 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 #if defined(V8_TARGET_BIG_ENDIAN) |
| 37 static constexpr int kLaneOffsets[4] = {3, 2, 1, 0}; |
| 38 #else |
| 39 static constexpr int kLaneOffsets[4] = {0, 1, 2, 3}; |
| 40 #endif |
36 struct Replacement { | 41 struct Replacement { |
37 Node* node[kMaxLanes]; | 42 Node* node[kMaxLanes]; |
38 SimdType type; // represents what input type is expected | 43 SimdType type; // represents what input type is expected |
39 }; | 44 }; |
40 | 45 |
41 struct NodeState { | 46 struct NodeState { |
42 Node* node; | 47 Node* node; |
43 int input_index; | 48 int input_index; |
44 }; | 49 }; |
45 | 50 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 Signature<MachineRepresentation>* signature_; | 85 Signature<MachineRepresentation>* signature_; |
81 Node* placeholder_; | 86 Node* placeholder_; |
82 int parameter_count_after_lowering_; | 87 int parameter_count_after_lowering_; |
83 }; | 88 }; |
84 | 89 |
85 } // namespace compiler | 90 } // namespace compiler |
86 } // namespace internal | 91 } // namespace internal |
87 } // namespace v8 | 92 } // namespace v8 |
88 | 93 |
89 #endif // V8_COMPILER_SIMD_SCALAR_LOWERING_H_ | 94 #endif // V8_COMPILER_SIMD_SCALAR_LOWERING_H_ |
OLD | NEW |