[PATCH] D69334: [MathExtras] Add intrinsic for the PopulationCounter in Visual Studio

Ehud Katz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 15:15:25 PDT 2019


ekatz added a comment.

In D69334#1719297 <https://reviews.llvm.org/D69334#1719297>, @craig.topper wrote:

> I'm pretty sure MSVC will always turn this into a popcnt instruction on X86. It has no fall back because MSVC doesn't have a concept of a target CPU. So this would only work on a Nehalem or newer CPU that implements the instruction.


Actually, it seems MSVC never does that optimization. Not on 32-bit or 64-bit.
Regarding the supported CPU issue; Nehalem is over a decade old. How far back do we want to support? I think it is reasonable to assume `popcnt` is always available.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69334/new/

https://reviews.llvm.org/D69334





More information about the llvm-commits mailing list