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

Unified Diff: src/compiler/wasm-compiler.cc

Issue 1698483002: [arm][arm64] Improve CountTrailingZero implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments addressed 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/verifier.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index aabd778b14061862807a3117a770bf49ce18a89a..f4373a4e2fee527a1ee71d20a59c93cc9014c00a 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -728,6 +728,10 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) {
if (m->Word32Ctz().IsSupported()) {
op = m->Word32Ctz().op();
break;
+ } else if (m->Word32ReverseBits().IsSupported()) {
+ Node* reversed = graph()->NewNode(m->Word32ReverseBits().op(), input);
+ Node* result = graph()->NewNode(m->Word32Clz(), reversed);
+ return result;
} else {
return BuildI32Ctz(input);
}
@@ -855,6 +859,10 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) {
if (m->Word64Ctz().IsSupported()) {
op = m->Word64Ctz().op();
break;
+ } else if (m->Word64ReverseBits().IsSupported()) {
+ Node* reversed = graph()->NewNode(m->Word64ReverseBits().op(), input);
+ Node* result = graph()->NewNode(m->Word64Clz(), reversed);
+ return result;
} else {
return BuildI64Ctz(input);
}
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698