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

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

Issue 2838943002: [wasm] Implement 128-bit endian swap for simd type (Closed)
Patch Set: address comments 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 | « src/compiler/simd-scalar-lowering.h ('k') | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simd-scalar-lowering.cc
diff --git a/src/compiler/simd-scalar-lowering.cc b/src/compiler/simd-scalar-lowering.cc
index 10c43f1aa38f1b077f7fe042478b51532b5577c0..af7dae91b9c4f3c92e87486b6e49ca6a8d7df48a 100644
--- a/src/compiler/simd-scalar-lowering.cc
+++ b/src/compiler/simd-scalar-lowering.cc
@@ -199,12 +199,17 @@ static int GetReturnCountAfterLowering(
return result;
}
+constexpr int SimdScalarLowering::kLaneOffsets[];
+
void SimdScalarLowering::GetIndexNodes(Node* index, Node** new_indices) {
- new_indices[0] = index;
+ int laneIndex = kLaneOffsets[0];
+ new_indices[laneIndex] = index;
for (size_t i = 1; i < kMaxLanes; ++i) {
- new_indices[i] = graph()->NewNode(machine()->Int32Add(), index,
- graph()->NewNode(common()->Int32Constant(
- static_cast<int>(i) * kLaneWidth)));
+ laneIndex = kLaneOffsets[i];
+ new_indices[laneIndex] = graph()->NewNode(
+ machine()->Int32Add(), index,
+ graph()->NewNode(
+ common()->Int32Constant(static_cast<int>(i) * kLaneWidth)));
}
}
@@ -229,6 +234,7 @@ void SimdScalarLowering::LowerLoadOp(MachineRepresentation rep, Node* node,
rep_nodes[1] = graph()->NewNode(load_op, base, indices[1], rep_nodes[2],
control_input);
rep_nodes[0]->ReplaceInput(2, rep_nodes[1]);
+ rep_nodes[0]->ReplaceInput(1, indices[0]);
aseemgarg 2017/05/02 21:20:21 This is not correct. The else case (without contro
john.yan 2017/05/03 19:39:40 Hello, do you mean the else case below? I don't un
aseemgarg 2017/05/03 22:04:13 yes the else case below. Since the indices have po
} else {
for (size_t i = 1; i < kMaxLanes; ++i) {
rep_nodes[i] = graph()->NewNode(load_op, base, indices[i]);
@@ -267,6 +273,7 @@ void SimdScalarLowering::LowerStoreOp(MachineRepresentation rep, Node* node,
rep_nodes[1] = graph()->NewNode(store_op, base, indices[1], rep_inputs[1],
rep_nodes[2], control_input);
rep_nodes[0]->ReplaceInput(3, rep_nodes[1]);
+ rep_nodes[0]->ReplaceInput(1, indices[0]);
} else {
for (size_t i = 1; i < kMaxLanes; ++i) {
« no previous file with comments | « src/compiler/simd-scalar-lowering.h ('k') | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698