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) { |