Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index 5742a08c1de4859bed32eb0bd1bacabc312d14b8..14d504dcb0dcb531f02901a5aa79de8078bce0d1 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -864,6 +864,16 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) { |
// kExprI64Clz: |
// kExprI64Ctz: |
// kExprI64Popcnt: |
+ case wasm::kExprI64Popcnt: { |
+ if (m->Word64Popcnt().IsSupported()) { |
+ op = m->Word64Popcnt().op(); |
+ } else if (m->Is32() && m->Word32Popcnt().IsSupported()) { |
+ op = m->Word64PopcntPlaceholder(); |
+ } else { |
+ return BuildI64Popcnt(input); |
+ } |
+ break; |
+ } |
// kExprF32SConvertI64: |
case wasm::kExprF32SConvertI64: |
if (m->Is32()) { |
@@ -956,14 +966,6 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input) { |
return BuildI64Ctz(input); |
} |
} |
- case wasm::kExprI64Popcnt: { |
- if (m->Word64Popcnt().IsSupported()) { |
- op = m->Word64Popcnt().op(); |
- break; |
- } else { |
- return BuildI64Popcnt(input); |
- } |
- } |
#endif |
default: |
op = UnsupportedOpcode(opcode); |