File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -3436,6 +3436,11 @@ uint32_t BitOperations::Log2(uint64_t value)
3436
3436
// Return Value:
3437
3437
// The population count (number of bits set) of value
3438
3438
//
3439
+ #if defined(_MSC_VER)
3440
+ // Disable optimizations for PopCount to avoid the compiler from generating intrinsics
3441
+ // not supported on all platforms.
3442
+ #pragma optimize("", off)
3443
+ #endif // _MSC_VER
3439
3444
uint32_t BitOperations::PopCount (uint32_t value)
3440
3445
{
3441
3446
#if defined(_MSC_VER)
@@ -3488,6 +3493,9 @@ uint32_t BitOperations::PopCount(uint64_t value)
3488
3493
return static_cast <uint32_t >(result);
3489
3494
#endif
3490
3495
}
3496
+ #if defined(_MSC_VER)
3497
+ #pragma optimize("", on)
3498
+ #endif // _MSC_VER
3491
3499
3492
3500
// ------------------------------------------------------------------------
3493
3501
// BitOperations::ReverseBits: Reverses the bits in an integer value
You can’t perform that action at this time.
0 commit comments