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

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

Issue 2294743003: [wasm] simd scalar lowering F32x4Add and I32x4Add (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] simd scalar lowering F32x4Add and I32x4Add Created 4 years, 2 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 | « BUILD.gn ('k') | src/compiler/simd-scalar-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simd-scalar-lowering.h
diff --git a/src/compiler/int64-lowering.h b/src/compiler/simd-scalar-lowering.h
similarity index 52%
copy from src/compiler/int64-lowering.h
copy to src/compiler/simd-scalar-lowering.h
index 66a54e9c3f9be2b2d595a4d69c0c562d197f0f0a..c10b5cdf0eb2b21018f379c30adc83408d9c6465 100644
--- a/src/compiler/int64-lowering.h
+++ b/src/compiler/simd-scalar-lowering.h
@@ -1,41 +1,40 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
+// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef V8_COMPILER_INT64_LOWERING_H_
-#define V8_COMPILER_INT64_LOWERING_H_
+#ifndef V8_COMPILER_SIMD_SCALAR_LOWERING_H_
+#define V8_COMPILER_SIMD_SCALAR_LOWERING_H_
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-marker.h"
-#include "src/globals.h"
#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
namespace compiler {
-class V8_EXPORT_PRIVATE Int64Lowering {
+class SimdScalarLowering {
public:
- Int64Lowering(Graph* graph, MachineOperatorBuilder* machine,
- CommonOperatorBuilder* common, Zone* zone,
- Signature<MachineRepresentation>* signature);
+ SimdScalarLowering(Graph* graph, MachineOperatorBuilder* machine,
+ CommonOperatorBuilder* common, Zone* zone,
+ Signature<MachineRepresentation>* signature);
void LowerGraph();
- static int GetParameterCountAfterLowering(
- Signature<MachineRepresentation>* signature);
-
- static const int kLowerWordOffset;
- static const int kHigherWordOffset;
+ int GetParameterCountAfterLowering();
private:
enum class State : uint8_t { kUnvisited, kOnStack, kVisited };
+ enum class SimdType : uint8_t { kInt32, kFloat32 };
+
+ static const size_t kMaxLanes = 4;
+
struct Replacement {
- Node* low;
- Node* high;
+ Node* node[kMaxLanes];
+ SimdType type; // represents what input type is expected
};
Zone* zone() const { return zone_; }
@@ -44,21 +43,16 @@ class V8_EXPORT_PRIVATE Int64Lowering {
CommonOperatorBuilder* common() const { return common_; }
Signature<MachineRepresentation>* signature() const { return signature_; }
- void PrepareReplacements(Node* node);
- void PushNode(Node* node);
void LowerNode(Node* node);
bool DefaultLowering(Node* node);
- void LowerComparison(Node* node, const Operator* signed_op,
- const Operator* unsigned_op);
- void PrepareProjectionReplacements(Node* node);
-
- void ReplaceNode(Node* old, Node* new_low, Node* new_high);
- bool HasReplacementLow(Node* node);
- Node* GetReplacementLow(Node* node);
- bool HasReplacementHigh(Node* node);
- Node* GetReplacementHigh(Node* node);
+
+ void ReplaceNode(Node* old, Node** new_nodes);
+ bool HasReplacement(size_t index, Node* node);
+ Node** GetReplacements(Node* node);
+ Node** GetReplacementsWithType(Node* node, SimdType type);
+ SimdType ReplacementType(Node* node);
void PreparePhiReplacement(Node* phi);
- void GetIndexNodes(Node* index, Node*& index_low, Node*& index_high);
+ void SetLoweredType(Node* node, Node* output);
struct NodeState {
Node* node;
@@ -74,10 +68,11 @@ class V8_EXPORT_PRIVATE Int64Lowering {
Replacement* replacements_;
Signature<MachineRepresentation>* signature_;
Node* placeholder_;
+ int parameter_count_after_lowering_;
};
} // namespace compiler
} // namespace internal
} // namespace v8
-#endif // V8_COMPILER_INT64_LOWERING_H_
+#endif // V8_COMPILER_SIMD_SCALAR_LOWERING_H_
« no previous file with comments | « BUILD.gn ('k') | src/compiler/simd-scalar-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698