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

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

Issue 1806593003: [wasm] Int64Lowering of Word64Ctz. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. 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 | « no previous file | 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 c8b9fdec05afb304e5a035284e5581ff1db62a1c..403d4c961cfc3ebf6668c674138bda1cd1ea6546 100644
--- a/src/compiler/int64-lowering.cc
+++ b/src/compiler/int64-lowering.cc
@@ -542,6 +542,26 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
// kExprI64Ctz:
+ case IrOpcode::kWord64Ctz: {
+ DCHECK(node->InputCount() == 1);
+ DCHECK(machine()->Word32Ctz().IsSupported());
+ Node* input = node->InputAt(0);
+ Diamond d(
+ graph(), common(),
+ graph()->NewNode(machine()->Word32Equal(), GetReplacementLow(input),
+ graph()->NewNode(common()->Int32Constant(0))));
+ Node* low_node =
+ d.Phi(MachineRepresentation::kWord32,
+ graph()->NewNode(machine()->Int32Add(),
+ graph()->NewNode(machine()->Word32Ctz().op(),
+ GetReplacementHigh(input)),
+ graph()->NewNode(common()->Int32Constant(32))),
+ graph()->NewNode(machine()->Word32Ctz().op(),
+ GetReplacementLow(input)));
+ ReplaceNode(node, low_node, graph()->NewNode(common()->Int32Constant(0)));
+ break;
+ }
+ // kExprI64Popcnt:
case IrOpcode::kWord64Popcnt: {
DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0);
@@ -557,7 +577,6 @@ void Int64Lowering::LowerNode(Node* node) {
graph()->NewNode(common()->Int32Constant(0)));
break;
}
- // kExprI64Popcnt:
default: { DefaultLowering(node); }
}
« no previous file with comments | « no previous file | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698