Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.0-staging] disable optimizations for PopCount #99832

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coreclr/jit/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3192,6 +3192,11 @@ uint32_t BitOperations::Log2(uint64_t value)
// Return Value:
// The population count (number of bits set) of value
//
#if defined(_MSC_VER)
// Disable optimizations for PopCount to avoid the compiler from generating intrinsics
// not supported on all platforms.
#pragma optimize("", off)
#endif // _MSC_VER
uint32_t BitOperations::PopCount(uint32_t value)
{
#if defined(_MSC_VER)
Expand Down Expand Up @@ -3244,6 +3249,9 @@ uint32_t BitOperations::PopCount(uint64_t value)
return static_cast<uint32_t>(result);
#endif
}
#if defined(_MSC_VER)
#pragma optimize("", on)
#endif // _MSC_VER

//------------------------------------------------------------------------
// BitOperations::ReverseBits: Reverses the bits in an integer value
Expand Down
Loading