| Index: src/compiler/int64-lowering.cc
|
| diff --git a/src/compiler/int64-lowering.cc b/src/compiler/int64-lowering.cc
|
| index 2c32b962c3fc00d4af846adf6c9ae13f4137b8e2..94c7b3b15bf6d6759cb095b1ab0d901387ec7400 100644
|
| --- a/src/compiler/int64-lowering.cc
|
| +++ b/src/compiler/int64-lowering.cc
|
| @@ -294,13 +294,30 @@ void Int64Lowering::LowerNode(Node* node) {
|
| // kExprI64Eq:
|
| // kExprI64Ne:
|
| // kExprI64LtS:
|
| + case IrOpcode::kInt64LessThan: {
|
| + LowerComparisonToLexicographicComparison(node, machine()->Int32LessThan(),
|
| + machine()->Uint32LessThan());
|
| + break;
|
| + }
|
| // kExprI64LeS:
|
| + case IrOpcode::kInt64LessThanOrEqual: {
|
| + LowerComparisonToLexicographicComparison(
|
| + node, machine()->Int32LessThan(), machine()->Uint32LessThanOrEqual());
|
| + break;
|
| + }
|
| // kExprI64LtU:
|
| + case IrOpcode::kUint64LessThan: {
|
| + LowerComparisonToLexicographicComparison(
|
| + node, machine()->Uint32LessThan(), machine()->Uint32LessThan());
|
| + break;
|
| + }
|
| // kExprI64LeU:
|
| - // kExprI64GtS:
|
| - // kExprI64GeS:
|
| - // kExprI64GtU:
|
| - // kExprI64GeU:
|
| + case IrOpcode::kUint64LessThanOrEqual: {
|
| + LowerComparisonToLexicographicComparison(
|
| + node, machine()->Uint32LessThan(),
|
| + machine()->Uint32LessThanOrEqual());
|
| + break;
|
| + }
|
|
|
| // kExprI64SConvertI32:
|
| // kExprI64UConvertI32:
|
| @@ -324,6 +341,25 @@ void Int64Lowering::LowerNode(Node* node) {
|
| }
|
| }
|
|
|
| +void Int64Lowering::LowerComparisonToLexicographicComparison(
|
| + Node* node, const Operator* high_word_op, const Operator* low_word_op) {
|
| + DCHECK(node->InputCount() == 2);
|
| + Node* left = node->InputAt(0);
|
| + Node* right = node->InputAt(1);
|
| + Node* replacement = graph()->NewNode(
|
| + machine()->Word32Or(),
|
| + graph()->NewNode(high_word_op, GetReplacementHigh(left),
|
| + GetReplacementHigh(right)),
|
| + graph()->NewNode(
|
| + machine()->Word32And(),
|
| + graph()->NewNode(machine()->Word32Equal(), GetReplacementHigh(left),
|
| + GetReplacementHigh(right)),
|
| + graph()->NewNode(low_word_op, GetReplacementLow(left),
|
| + GetReplacementLow(right))));
|
| +
|
| + ReplaceNode(node, replacement, nullptr);
|
| +}
|
| +
|
| bool Int64Lowering::DefaultLowering(Node* node) {
|
| bool something_changed = false;
|
| for (int i = NodeProperties::PastValueIndex(node) - 1; i >= 0; i--) {
|
|
|