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

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

Issue 1810473002: [wasm] Int64Lowering of Word64Clz. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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.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 6a9d68124439bb8eec5994eff2b36b28920397c9..95acd64327bb86079d855333c747880e30eeb5ac 100644
--- a/src/compiler/int64-lowering.cc
+++ b/src/compiler/int64-lowering.cc
@@ -4,6 +4,7 @@
#include "src/compiler/int64-lowering.h"
#include "src/compiler/common-operator.h"
+#include "src/compiler/diamond.h"
#include "src/compiler/graph.h"
#include "src/compiler/linkage.h"
#include "src/compiler/machine-operator.h"
@@ -504,6 +505,24 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
// kExprI64Clz:
+ case IrOpcode::kWord64Clz: {
+ DCHECK(node->InputCount() == 1);
+ Node* input = node->InputAt(0);
+ Diamond d(
+ graph(), common(),
+ graph()->NewNode(machine()->Word32Equal(), GetReplacementHigh(input),
+ graph()->NewNode(common()->Int32Constant(0))));
+
+ Node* low_node = d.Phi(
+ MachineRepresentation::kWord32,
+ graph()->NewNode(machine()->Int32Add(),
+ graph()->NewNode(machine()->Word32Clz(),
+ GetReplacementLow(input)),
+ graph()->NewNode(common()->Int32Constant(32))),
+ graph()->NewNode(machine()->Word32Clz(), GetReplacementHigh(input)));
+ ReplaceNode(node, low_node, graph()->NewNode(common()->Int32Constant(0)));
+ break;
+ }
// kExprI64Ctz:
case IrOpcode::kWord64Popcnt: {
DCHECK(node->InputCount() == 1);
« no previous file with comments | « no previous file | src/compiler/machine-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698