[llvm] [SDag][ARM][RISCV] Allow lowering CTPOP into a libcall (PR #101786)

Nathan Chancellor via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 4 22:27:32 PDT 2024


nathanchance wrote:

> What about x86 CPUs that don't have POPCNT?

It appears the kernel handles this with an alternative that detects the feature and falls back to an out of line asm routine if it is not supported (perhaps because of something like this?):

https://elixir.bootlin.com/linux/v6.10.3/source/arch/x86/include/asm/arch_hweight.h

https://elixir.bootlin.com/linux/v6.10.3/source/arch/x86/lib/hweight.S

https://github.com/llvm/llvm-project/pull/101786


More information about the llvm-commits mailing list