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

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

Issue 1729263002: [wasm] I added comparison operators to the Int64Lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git rebase Created 4 years, 10 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/int64-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/int64-lowering.cc
diff --git a/src/compiler/int64-lowering.cc b/src/compiler/int64-lowering.cc
index 064c86c679a766157fe16bbbc0743fe565055fd6..0345d26d396d7364ac29be985ce47e8826083d41 100644
--- a/src/compiler/int64-lowering.cc
+++ b/src/compiler/int64-lowering.cc
@@ -313,13 +313,26 @@ void Int64Lowering::LowerNode(Node* node) {
}
// kExprI64Ne:
// kExprI64LtS:
- // kExprI64LeS:
- // kExprI64LtU:
- // kExprI64LeU:
- // kExprI64GtS:
- // kExprI64GeS:
- // kExprI64GtU:
- // kExprI64GeU:
+ case IrOpcode::kInt64LessThan: {
+ LowerComparison(node, machine()->Int32LessThan(),
+ machine()->Uint32LessThan());
+ break;
+ }
+ case IrOpcode::kInt64LessThanOrEqual: {
+ LowerComparison(node, machine()->Int32LessThan(),
+ machine()->Uint32LessThanOrEqual());
+ break;
+ }
+ case IrOpcode::kUint64LessThan: {
+ LowerComparison(node, machine()->Uint32LessThan(),
+ machine()->Uint32LessThan());
+ break;
+ }
+ case IrOpcode::kUint64LessThanOrEqual: {
+ LowerComparison(node, machine()->Uint32LessThan(),
+ machine()->Uint32LessThanOrEqual());
+ break;
+ }
// kExprI64SConvertI32:
// kExprI64UConvertI32:
@@ -343,6 +356,25 @@ void Int64Lowering::LowerNode(Node* node) {
}
}
+void Int64Lowering::LowerComparison(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--) {
« no previous file with comments | « src/compiler/int64-lowering.h ('k') | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698