Index: src/compiler/int64-lowering.cc |
diff --git a/src/compiler/int64-lowering.cc b/src/compiler/int64-lowering.cc |
index 23774a670bafd8d77215cd800c5e7858d6169c66..c6bd909b75442c453681b7846e98c2e2bba29a6b 100644 |
--- a/src/compiler/int64-lowering.cc |
+++ b/src/compiler/int64-lowering.cc |
@@ -312,7 +312,51 @@ void Int64Lowering::LowerNode(Node* node) { |
break; |
} |
// kExprI64ShrU: |
+ case IrOpcode::kWord64Shr: { |
+ // 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()->Word32PairShr()); |
+ // 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; |
+ } |
// kExprI64ShrS: |
+ case IrOpcode::kWord64Sar: { |
+ // 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()->Word32PairSar()); |
+ // 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; |
+ } |
// kExprI64Eq: |
case IrOpcode::kWord64Equal: { |
DCHECK(node->InputCount() == 2); |