microsoft / STL

MSVC's implementation of the C++ Standard Library.
Other
9.88k stars 1.45k forks source link

Add MSVC-internal workaround for ARM64 `popcount` intrinsics #4733

Closed StephanTLavavej closed 1 week ago

StephanTLavavej commented 1 week ago

As mentioned in #4683, VS 2022 17.11 Preview 1 added ARM64 support for __popcnt64 etc. intrinsics. When merging #4695, everything seemed to be okay during MSVC-internal PR checks, but post-merge CI noticed that the MSVC-internal build starts with a checked-in 17.10p4, which is too old to know about the new intrinsics.

I missed this because I forgot that MSVC-internal PR checks don't build ARM64 (only the CI does) and I didn't build ARM64 locally.

The workaround is to check the compiler version. I'll be able to remove this after we update the internal toolset, which should happen very soon.