Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index 5b1ff409ad20e0bd9542d6b31ab355226d7bdded..73a140a9ced509fe0c22811a2e0644bd58dc8d16 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -834,6 +834,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::kExprI64Eqz: |
op = m->Word64Equal(); |
@@ -905,14 +915,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); |