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

Unified Diff: src/compiler/wasm-compiler.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 | « src/compiler/machine-operator.cc ('k') | test/cctest/wasm/test-run-wasm-64.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 2b75b0a60e5e6f17a26b75727ac5f60d51c0f485..245d921b9da6fef6aa1eab16fa345c0777fa4aa3 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -842,6 +842,21 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) {
op = m->Word64Clz();
break;
// kExprI64Ctz:
+ case wasm::kExprI64Ctz: {
+ if (m->Word64Ctz().IsSupported()) {
+ op = m->Word64Ctz().op();
+ break;
+ } else if (m->Is32() && m->Word32Ctz().IsSupported()) {
+ op = m->Word64CtzPlaceholder();
+ 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);
+ }
+ }
// kExprI64Popcnt:
case wasm::kExprI64Popcnt: {
if (m->Word64Popcnt().IsSupported()) {
@@ -900,22 +915,6 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) {
case wasm::kExprI64UConvertF64: {
return BuildI64UConvertF64(input);
}
-#if WASM_64
- // Opcodes only supported on 64-bit platforms.
- // TODO(titzer): query the machine operator builder here instead of #ifdef.
- case wasm::kExprI64Ctz: {
- 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);
- }
- }
-#endif
default:
op = UnsupportedOpcode(opcode);
}
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | test/cctest/wasm/test-run-wasm-64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698