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

Unified Diff: src/compiler/int64-lowering.cc

Issue 1756863002: [wasm] Int64Lowering of I64Shl on ia32. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Forgot to turn off the test for arm. Created 4 years, 9 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/instruction-selector.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/int64-lowering.cc
diff --git a/src/compiler/int64-lowering.cc b/src/compiler/int64-lowering.cc
index 0345d26d396d7364ac29be985ce47e8826083d41..253d2f0dc62df9f0eeb29ec744c2bd729c48336e 100644
--- a/src/compiler/int64-lowering.cc
+++ b/src/compiler/int64-lowering.cc
@@ -289,6 +289,28 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
// kExprI64Shl:
+ case IrOpcode::kWord64Shl: {
+ // TODO(turbofan): if the shift count >= 32, then we can set the low word
+ // of the output to 0 and just calculate the high word.
+ DCHECK(node->InputCount() == 2);
+ Node* shift = node->InputAt(1);
+ if (HasReplacementLow(shift)) {
+ // We do not have to care about the high word replacement, because
+ // the shift can only be between 0 and 63 anyways.
+ node->ReplaceInput(1, GetReplacementLow(shift));
+ }
+
+ Node* value = node->InputAt(0);
+ node->ReplaceInput(0, GetReplacementLow(value));
+ node->InsertInput(zone(), 1, GetReplacementHigh(value));
+
+ NodeProperties::ChangeOp(node, machine()->Word32PairShl());
+ // We access the additional return values through projections.
+ Node* low_node = graph()->NewNode(common()->Projection(0), node);
+ Node* high_node = graph()->NewNode(common()->Projection(1), node);
+ ReplaceNode(node, low_node, high_node);
+ break;
+ }
// kExprI64ShrU:
// kExprI64ShrS:
// kExprI64Eq:
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698